-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add source file location into RDF output #17
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,7 +96,7 @@ impl Validate for DatatypeDef { | |
loader | ||
.report(&type_definition_not_found( | ||
top.file_id().copied().unwrap_or_default(), | ||
self.span.as_ref().map(|span| span.clone().into()), | ||
self.span.as_ref().map(|span| span.into()), | ||
self.base_type(), | ||
)) | ||
.unwrap(); | ||
|
@@ -156,4 +156,6 @@ impl DatatypeDef { | |
get_and_set_bool!(pub opaque, is_opaque, set_opaque); | ||
|
||
get_and_set!(pub base_type, set_base_type => IdentifierReference); | ||
|
||
get_and_set!(pub span, set_span, unset_span => optional has_span, Span); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment above re: |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,8 @@ impl EntityDef { | |
body: None, | ||
} | ||
} | ||
|
||
get_and_set!(pub span, set_span, unset_span => optional has_span, Span); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment above re: |
||
} | ||
|
||
// ------------------------------------------------------------------------------------------------ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,8 @@ impl EnumDef { | |
body: None, | ||
} | ||
} | ||
|
||
get_and_set!(pub span, set_span, unset_span => optional has_span, Span); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment above re: |
||
} | ||
|
||
// ------------------------------------------------------------------------------------------------ | ||
|
@@ -168,4 +170,6 @@ impl ValueVariant { | |
body: None, | ||
} | ||
} | ||
|
||
get_and_set!(pub span, set_span, unset_span => optional has_span, Span); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment above re: |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,4 +78,5 @@ impl EventDef { | |
// -------------------------------------------------------------------------------------------- | ||
|
||
get_and_set!(pub event_source, set_event_source => IdentifierReference); | ||
get_and_set!(pub span, set_span, unset_span => optional has_span, Span); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment above re: |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,4 +83,5 @@ impl PropertyDef { | |
// -------------------------------------------------------------------------------------------- | ||
|
||
get_and_set!(pub member, member_def, set_member_def => MemberDef); | ||
get_and_set!(pub span, set_span, unset_span => optional has_span, Span); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment above re: |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,4 +126,6 @@ impl RdfDef { | |
pub fn individual(name: Identifier) -> Self { | ||
Self::new(name) | ||
} | ||
|
||
get_and_set!(pub span, set_span, unset_span => optional has_span, Span); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment above re: |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,8 @@ impl UnionDef { | |
..self | ||
} | ||
} | ||
|
||
get_and_set!(pub span, set_span, unset_span => optional has_span, Span); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment above re: |
||
} | ||
|
||
// ------------------------------------------------------------------------------------------------ | ||
|
@@ -225,4 +227,6 @@ impl TypeVariant { | |
} | ||
} | ||
} | ||
|
||
get_and_set!(pub span, set_span, unset_span => optional has_span, Span); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment above re: |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,6 +239,8 @@ impl Member { | |
MemberKind::Definition(defn) => Some(defn.target_cardinality().clone()), | ||
} | ||
} | ||
|
||
get_and_set!(pub span, set_span, unset_span => optional has_span, Span); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment above re: |
||
} | ||
|
||
// ------------------------------------------------------------------------------------------------ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,6 +217,8 @@ impl Module { | |
|
||
get_and_set!(pub source_file, set_source_file, unset_source_file => optional has_source_file, PathBuf); | ||
|
||
get_and_set!(pub span, set_span, unset_span => optional has_span, Span); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment above re: |
||
|
||
get_and_set!(pub base_uri, set_base_uri, unset_base_uri => optional has_base_uri, HeaderValue<Url>); | ||
|
||
get_and_set!(pub version_info, set_version_info, unset_version_info => optional has_version_info, HeaderValue<String>); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually performed by the
impl_has_source_span_for
macro, which implements thecrate::model::HasSourceSpan
trait resulting in the methodswith_source_span
,has_source_span
,source_span
,set_source_span
andunset_source_span
.