Remove tabs from BNF comments

Minor cleanup on the BNF comments - get rid of tabs and align them
pull/752/head
Yuri Astrakhan 8 months ago committed by Thomas Tanon
parent 54489aacfb
commit 18bf383701
  1. 20
      lib/oxsdatatypes/src/duration.rs
  2. 43
      lib/oxttl/src/lexer.rs
  3. 60
      lib/oxttl/src/n3.rs
  4. 68
      lib/oxttl/src/terse.rs
  5. 8
      lib/oxttl/src/trig.rs
  6. 8
      lib/sparesults/src/csv.rs
  7. 290
      lib/sparql-smith/src/lib.rs

@ -713,16 +713,16 @@ impl PartialOrd<DayTimeDuration> for YearMonthDuration {
} }
} }
// [6] duYearFrag ::= unsignedNoDecimalPtNumeral 'Y' // [6] duYearFrag ::= unsignedNoDecimalPtNumeral 'Y'
// [7] duMonthFrag ::= unsignedNoDecimalPtNumeral 'M' // [7] duMonthFrag ::= unsignedNoDecimalPtNumeral 'M'
// [8] duDayFrag ::= unsignedNoDecimalPtNumeral 'D' // [8] duDayFrag ::= unsignedNoDecimalPtNumeral 'D'
// [9] duHourFrag ::= unsignedNoDecimalPtNumeral 'H' // [9] duHourFrag ::= unsignedNoDecimalPtNumeral 'H'
// [10] duMinuteFrag ::= unsignedNoDecimalPtNumeral 'M' // [10] duMinuteFrag ::= unsignedNoDecimalPtNumeral 'M'
// [11] duSecondFrag ::= (unsignedNoDecimalPtNumeral | unsignedDecimalPtNumeral) 'S' // [11] duSecondFrag ::= (unsignedNoDecimalPtNumeral | unsignedDecimalPtNumeral) 'S'
// [12] duYearMonthFrag ::= (duYearFrag duMonthFrag?) | duMonthFrag // [12] duYearMonthFrag ::= (duYearFrag duMonthFrag?) | duMonthFrag
// [13] duTimeFrag ::= 'T' ((duHourFrag duMinuteFrag? duSecondFrag?) | (duMinuteFrag duSecondFrag?) | duSecondFrag) // [13] duTimeFrag ::= 'T' ((duHourFrag duMinuteFrag? duSecondFrag?) | (duMinuteFrag duSecondFrag?) | duSecondFrag)
// [14] duDayTimeFrag ::= (duDayFrag duTimeFrag?) | duTimeFrag // [14] duDayTimeFrag ::= (duDayFrag duTimeFrag?) | duTimeFrag
// [15] durationLexicalRep ::= '-'? 'P' ((duYearMonthFrag duDayTimeFrag?) | duDayTimeFrag) // [15] durationLexicalRep ::= '-'? 'P' ((duYearMonthFrag duDayTimeFrag?) | duDayTimeFrag)
struct DurationParts { struct DurationParts {
year_month: Option<i64>, year_month: Option<i64>,
day_time: Option<Decimal>, day_time: Option<Decimal>,

@ -179,7 +179,7 @@ impl N3Lexer {
data: &[u8], data: &[u8],
options: &N3LexerOptions, options: &N3LexerOptions,
) -> Option<(usize, Result<N3Token<'static>, TokenRecognizerError>)> { ) -> Option<(usize, Result<N3Token<'static>, TokenRecognizerError>)> {
// [18] IRIREF ::= '<' ([^#x00-#x20<>"{}|^`\] | UCHAR)* '>' /* #x00=NULL #01-#x1F=control codes #x20=space */ // [18] IRIREF ::= '<' ([^#x00-#x20<>"{}|^`\] | UCHAR)* '>' /* #x00=NULL #01-#x1F=control codes #x20=space */
let mut string = Vec::new(); let mut string = Vec::new();
let mut i = 1; let mut i = 1;
loop { loop {
@ -238,10 +238,9 @@ impl N3Lexer {
data: &'a [u8], data: &'a [u8],
is_ending: bool, is_ending: bool,
) -> Option<(usize, Result<N3Token<'a>, TokenRecognizerError>)> { ) -> Option<(usize, Result<N3Token<'a>, TokenRecognizerError>)> {
// [139s] PNAME_NS ::= PN_PREFIX? ':' // [139s] PNAME_NS ::= PN_PREFIX? ':'
// [140s] PNAME_LN ::= PNAME_NS PN_LOCAL // [140s] PNAME_LN ::= PNAME_NS PN_LOCAL
// [167s] PN_PREFIX ::= PN_CHARS_BASE ((PN_CHARS | '.')* PN_CHARS)?
// [167s] PN_PREFIX ::= PN_CHARS_BASE ((PN_CHARS | '.')* PN_CHARS)?
let mut i = 0; let mut i = 0;
loop { loop {
if let Some(r) = Self::recognize_unicode_char(&data[i..], i) { if let Some(r) = Self::recognize_unicode_char(&data[i..], i) {
@ -330,7 +329,7 @@ impl N3Lexer {
data: &'a [u8], data: &'a [u8],
is_ending: bool, is_ending: bool,
) -> Option<(usize, Result<N3Token<'a>, TokenRecognizerError>)> { ) -> Option<(usize, Result<N3Token<'a>, TokenRecognizerError>)> {
// [36] QUICK_VAR_NAME ::= "?" PN_LOCAL // [36] QUICK_VAR_NAME ::= "?" PN_LOCAL
let (consumed, result) = self.recognize_optional_pn_local(&data[1..], is_ending)?; let (consumed, result) = self.recognize_optional_pn_local(&data[1..], is_ending)?;
Some(( Some((
consumed + 1, consumed + 1,
@ -349,7 +348,7 @@ impl N3Lexer {
data: &'a [u8], data: &'a [u8],
is_ending: bool, is_ending: bool,
) -> Option<(usize, Result<(Cow<'a, str>, bool), TokenRecognizerError>)> { ) -> Option<(usize, Result<(Cow<'a, str>, bool), TokenRecognizerError>)> {
// [168s] PN_LOCAL ::= (PN_CHARS_U | ':' | [0-9] | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))? // [168s] PN_LOCAL ::= (PN_CHARS_U | ':' | [0-9] | PLX) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX))?
let mut i = 0; let mut i = 0;
let mut buffer = None; // Buffer if there are some escaped characters let mut buffer = None; // Buffer if there are some escaped characters
let mut position_that_is_already_in_buffer = 0; let mut position_that_is_already_in_buffer = 0;
@ -503,7 +502,7 @@ impl N3Lexer {
fn recognize_blank_node_label( fn recognize_blank_node_label(
data: &[u8], data: &[u8],
) -> Option<(usize, Result<N3Token<'_>, TokenRecognizerError>)> { ) -> Option<(usize, Result<N3Token<'_>, TokenRecognizerError>)> {
// [141s] BLANK_NODE_LABEL ::= '_:' (PN_CHARS_U | [0-9]) ((PN_CHARS | '.')* PN_CHARS)? // [141s] BLANK_NODE_LABEL ::= '_:' (PN_CHARS_U | [0-9]) ((PN_CHARS | '.')* PN_CHARS)?
let mut i = 2; let mut i = 2;
loop { loop {
match Self::recognize_unicode_char(&data[i..], i)? { match Self::recognize_unicode_char(&data[i..], i)? {
@ -548,7 +547,7 @@ impl N3Lexer {
&self, &self,
data: &'a [u8], data: &'a [u8],
) -> Option<(usize, Result<N3Token<'a>, TokenRecognizerError>)> { ) -> Option<(usize, Result<N3Token<'a>, TokenRecognizerError>)> {
// [144s] LANGTAG ::= '@' [a-zA-Z]+ ('-' [a-zA-Z0-9]+)* // [144s] LANGTAG ::= '@' [a-zA-Z]+ ('-' [a-zA-Z0-9]+)*
let mut is_last_block_empty = true; let mut is_last_block_empty = true;
for (i, c) in data[1..].iter().enumerate() { for (i, c) in data[1..].iter().enumerate() {
if c.is_ascii_alphabetic() { if c.is_ascii_alphabetic() {
@ -588,8 +587,8 @@ impl N3Lexer {
data: &[u8], data: &[u8],
delimiter: u8, delimiter: u8,
) -> Option<(usize, Result<N3Token<'static>, TokenRecognizerError>)> { ) -> Option<(usize, Result<N3Token<'static>, TokenRecognizerError>)> {
// [22] STRING_LITERAL_QUOTE ::= '"' ([^#x22#x5C#xA#xD] | ECHAR | UCHAR)* '"' /* #x22=" #x5C=\ #xA=new line #xD=carriage return */ // [22] STRING_LITERAL_QUOTE ::= '"' ([^#x22#x5C#xA#xD] | ECHAR | UCHAR)* '"' /* #x22=" #x5C=\ #xA=new line #xD=carriage return */
// [23] STRING_LITERAL_SINGLE_QUOTE ::= "'" ([^#x27#x5C#xA#xD] | ECHAR | UCHAR)* "'" /* #x27=' #x5C=\ #xA=new line #xD=carriage return */ // [23] STRING_LITERAL_SINGLE_QUOTE ::= "'" ([^#x27#x5C#xA#xD] | ECHAR | UCHAR)* "'" /* #x27=' #x5C=\ #xA=new line #xD=carriage return */
let mut string = String::new(); let mut string = String::new();
let mut i = 1; let mut i = 1;
loop { loop {
@ -626,8 +625,8 @@ impl N3Lexer {
data: &[u8], data: &[u8],
delimiter: u8, delimiter: u8,
) -> Option<(usize, Result<N3Token<'static>, TokenRecognizerError>)> { ) -> Option<(usize, Result<N3Token<'static>, TokenRecognizerError>)> {
// [24] STRING_LITERAL_LONG_SINGLE_QUOTE ::= "'''" (("'" | "''")? ([^'\] | ECHAR | UCHAR))* "'''" // [24] STRING_LITERAL_LONG_SINGLE_QUOTE ::= "'''" (("'" | "''")? ([^'\] | ECHAR | UCHAR))* "'''"
// [25] STRING_LITERAL_LONG_QUOTE ::= '"""' (('"' | '""')? ([^"\] | ECHAR | UCHAR))* '"""' // [25] STRING_LITERAL_LONG_QUOTE ::= '"""' (('"' | '""')? ([^"\] | ECHAR | UCHAR))* '"""'
let mut string = String::new(); let mut string = String::new();
let mut i = 3; let mut i = 3;
loop { loop {
@ -661,10 +660,10 @@ impl N3Lexer {
} }
fn recognize_number(data: &[u8]) -> Option<(usize, Result<N3Token<'_>, TokenRecognizerError>)> { fn recognize_number(data: &[u8]) -> Option<(usize, Result<N3Token<'_>, TokenRecognizerError>)> {
// [19] INTEGER ::= [+-]? [0-9]+ // [19] INTEGER ::= [+-]? [0-9]+
// [20] DECIMAL ::= [+-]? [0-9]* '.' [0-9]+ // [20] DECIMAL ::= [+-]? [0-9]* '.' [0-9]+
// [21] DOUBLE ::= [+-]? ([0-9]+ '.' [0-9]* EXPONENT | '.' [0-9]+ EXPONENT | [0-9]+ EXPONENT) // [21] DOUBLE ::= [+-]? ([0-9]+ '.' [0-9]* EXPONENT | '.' [0-9]+ EXPONENT | [0-9]+ EXPONENT)
// [154s] EXPONENT ::= [eE] [+-]? [0-9]+ // [154s] EXPONENT ::= [eE] [+-]? [0-9]+
let mut i = 0; let mut i = 0;
let c = *data.first()?; let c = *data.first()?;
if matches!(c, b'+' | b'-') { if matches!(c, b'+' | b'-') {
@ -764,8 +763,8 @@ impl N3Lexer {
position: usize, position: usize,
with_echar: bool, with_echar: bool,
) -> Option<(usize, Result<char, TokenRecognizerError>)> { ) -> Option<(usize, Result<char, TokenRecognizerError>)> {
// [26] UCHAR ::= '\u' HEX HEX HEX HEX | '\U' HEX HEX HEX HEX HEX HEX HEX HEX // [26] UCHAR ::= '\u' HEX HEX HEX HEX | '\U' HEX HEX HEX HEX HEX HEX HEX HEX
// [159s] ECHAR ::= '\' [tbnrf"'\] // [159s] ECHAR ::= '\' [tbnrf"'\]
match *data.get(1)? { match *data.get(1)? {
b'u' => match Self::recognize_hex_char(&data[2..], 4, 'u', position) { b'u' => match Self::recognize_hex_char(&data[2..], 4, 'u', position) {
Ok(c) => Some((5, Ok(c?))), Ok(c) => Some((5, Ok(c?))),
@ -895,7 +894,7 @@ impl N3Lexer {
) )
} }
// [157s] PN_CHARS_BASE ::= [A-Z] | [a-z] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x02FF] | [#x0370-#x037D] | [#x037F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] // [157s] PN_CHARS_BASE ::= [A-Z] | [a-z] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x02FF] | [#x0370-#x037D] | [#x037F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
fn is_possible_pn_chars_base(c: char) -> bool { fn is_possible_pn_chars_base(c: char) -> bool {
matches!(c, matches!(c,
'A'..='Z' 'A'..='Z'
@ -914,12 +913,12 @@ impl N3Lexer {
| '\u{10000}'..='\u{EFFFF}') | '\u{10000}'..='\u{EFFFF}')
} }
// [158s] PN_CHARS_U ::= PN_CHARS_BASE | '_' | ':' // [158s] PN_CHARS_U ::= PN_CHARS_BASE | '_' | ':'
fn is_possible_pn_chars_u(c: char) -> bool { fn is_possible_pn_chars_u(c: char) -> bool {
Self::is_possible_pn_chars_base(c) || c == '_' Self::is_possible_pn_chars_base(c) || c == '_'
} }
// [160s] PN_CHARS ::= PN_CHARS_U | '-' | [0-9] | #x00B7 | [#x0300-#x036F] | [#x203F-#x2040] // [160s] PN_CHARS ::= PN_CHARS_U | '-' | [0-9] | #x00B7 | [#x0300-#x036F] | [#x203F-#x2040]
fn is_possible_pn_chars(c: char) -> bool { fn is_possible_pn_chars(c: char) -> bool {
Self::is_possible_pn_chars_u(c) Self::is_possible_pn_chars_u(c)
|| matches!(c, || matches!(c,

@ -744,14 +744,14 @@ impl RuleRecognizer for N3Recognizer {
) -> Self { ) -> Self {
while let Some(rule) = self.stack.pop() { while let Some(rule) = self.stack.pop() {
match rule { match rule {
// [1] n3Doc ::= ( ( n3Statement ".") | sparqlDirective) * // [1] n3Doc ::= ( ( n3Statement ".") | sparqlDirective) *
// [2] n3Statement ::= n3Directive | triples // [2] n3Statement ::= n3Directive | triples
// [3] n3Directive ::= prefixID | base // [3] n3Directive ::= prefixID | base
// [4] sparqlDirective ::= sparqlBase | sparqlPrefix // [4] sparqlDirective ::= sparqlBase | sparqlPrefix
// [5] sparqlBase ::= BASE IRIREF // [5] sparqlBase ::= BASE IRIREF
// [6] sparqlPrefix ::= PREFIX PNAME_NS IRIREF // [6] sparqlPrefix ::= PREFIX PNAME_NS IRIREF
// [7] prefixID ::= "@prefix" PNAME_NS IRIREF // [7] prefixID ::= "@prefix" PNAME_NS IRIREF
// [8] base ::= "@base" IRIREF // [8] base ::= "@base" IRIREF
N3State::N3Doc => { N3State::N3Doc => {
self.stack.push(N3State::N3Doc); self.stack.push(N3State::N3Doc);
match token { match token {
@ -818,7 +818,7 @@ impl RuleRecognizer for N3Recognizer {
} }
_ => self.error(errors, "The PREFIX declaration should be followed by a prefix and its value as an IRI"), _ => self.error(errors, "The PREFIX declaration should be followed by a prefix and its value as an IRI"),
}, },
// [9] triples ::= subject predicateObjectList? // [9] triples ::= subject predicateObjectList?
N3State::Triples => { N3State::Triples => {
self.stack.push(N3State::TriplesMiddle); self.stack.push(N3State::TriplesMiddle);
self.stack.push(N3State::Path); self.stack.push(N3State::Path);
@ -830,7 +830,7 @@ impl RuleRecognizer for N3Recognizer {
N3State::TriplesEnd => { N3State::TriplesEnd => {
self.terms.pop(); self.terms.pop();
} }
// [10] predicateObjectList ::= verb objectList ( ";" ( verb objectList) ? ) * // [10] predicateObjectList ::= verb objectList ( ";" ( verb objectList) ? ) *
N3State::PredicateObjectList => { N3State::PredicateObjectList => {
self.stack.push(N3State::PredicateObjectListEnd); self.stack.push(N3State::PredicateObjectListEnd);
self.stack.push(N3State::ObjectsList); self.stack.push(N3State::ObjectsList);
@ -851,7 +851,7 @@ impl RuleRecognizer for N3Recognizer {
self.stack.push(N3State::ObjectsList); self.stack.push(N3State::ObjectsList);
self.stack.push(N3State::Verb); self.stack.push(N3State::Verb);
}, },
// [11] objectList ::= object ( "," object) * // [11] objectList ::= object ( "," object) *
N3State::ObjectsList => { N3State::ObjectsList => {
self.stack.push(N3State::ObjectsListEnd); self.stack.push(N3State::ObjectsListEnd);
self.stack.push(N3State::Path); self.stack.push(N3State::Path);
@ -877,8 +877,8 @@ impl RuleRecognizer for N3Recognizer {
return self; return self;
} }
} }
// [12] verb ::= predicate | "a" | ( "has" expression) | ( "is" expression "of") | "=" | "<=" | "=>" // [12] verb ::= predicate | "a" | ( "has" expression) | ( "is" expression "of") | "=" | "<=" | "=>"
// [14] predicate ::= expression | ( "<-" expression) // [14] predicate ::= expression | ( "<-" expression)
N3State::Verb => match token { N3State::Verb => match token {
N3Token::PlainKeyword("a") => { N3Token::PlainKeyword("a") => {
self.predicates.push(Predicate::Regular(rdf::TYPE.into())); self.predicates.push(Predicate::Regular(rdf::TYPE.into()));
@ -931,10 +931,10 @@ impl RuleRecognizer for N3Recognizer {
self.error(errors, "The keyword 'is' should be followed by a predicate then by the keyword 'of'") self.error(errors, "The keyword 'is' should be followed by a predicate then by the keyword 'of'")
} }
}, },
// [13] subject ::= expression // [13] subject ::= expression
// [15] object ::= expression // [15] object ::= expression
// [16] expression ::= path // [16] expression ::= path
// [17] path ::= pathItem ( ( "!" path) | ( "^" path) ) ? // [17] path ::= pathItem ( ( "!" path) | ( "^" path) ) ?
N3State::Path => { N3State::Path => {
self.stack.push(N3State::PathFollowUp); self.stack.push(N3State::PathFollowUp);
self.stack.push(N3State::PathItem); self.stack.push(N3State::PathItem);
@ -960,18 +960,18 @@ impl RuleRecognizer for N3Recognizer {
self.terms.push(current.into()); self.terms.push(current.into());
self.stack.push(N3State::PathFollowUp); self.stack.push(N3State::PathFollowUp);
} }
// [18] pathItem ::= iri | blankNode | quickVar | collection | blankNodePropertyList | iriPropertyList | literal | formula // [18] pathItem ::= iri | blankNode | quickVar | collection | blankNodePropertyList | iriPropertyList | literal | formula
// [19] literal ::= rdfLiteral | numericLiteral | BOOLEAN_LITERAL // [19] literal ::= rdfLiteral | numericLiteral | BOOLEAN_LITERAL
// [20] blankNodePropertyList ::= "[" predicateObjectList "]" // [20] blankNodePropertyList ::= "[" predicateObjectList "]"
// [21] iriPropertyList ::= IPLSTART iri predicateObjectList "]" // [21] iriPropertyList ::= IPLSTART iri predicateObjectList "]"
// [22] collection ::= "(" object* ")" // [22] collection ::= "(" object* ")"
// [23] formula ::= "{" formulaContent? "}" // [23] formula ::= "{" formulaContent? "}"
// [25] numericLiteral ::= DOUBLE | DECIMAL | INTEGER // [25] numericLiteral ::= DOUBLE | DECIMAL | INTEGER
// [26] rdfLiteral ::= STRING ( LANGTAG | ( "^^" iri) ) ? // [26] rdfLiteral ::= STRING ( LANGTAG | ( "^^" iri) ) ?
// [27] iri ::= IRIREF | prefixedName // [27] iri ::= IRIREF | prefixedName
// [28] prefixedName ::= PNAME_LN | PNAME_NS // [28] prefixedName ::= PNAME_LN | PNAME_NS
// [29] blankNode ::= BLANK_NODE_LABEL | ANON // [29] blankNode ::= BLANK_NODE_LABEL | ANON
// [30] quickVar ::= QUICK_VAR_NAME // [30] quickVar ::= QUICK_VAR_NAME
N3State::PathItem => { N3State::PathItem => {
return match token { return match token {
N3Token::IriRef(iri) => { N3Token::IriRef(iri) => {
@ -1149,7 +1149,7 @@ impl RuleRecognizer for N3Recognizer {
} }
} }
} }
// [24] formulaContent ::= ( n3Statement ( "." formulaContent? ) ? ) | ( sparqlDirective formulaContent? ) // [24] formulaContent ::= ( n3Statement ( "." formulaContent? ) ? ) | ( sparqlDirective formulaContent? )
N3State::FormulaContent => { N3State::FormulaContent => {
match token { match token {
N3Token::Punctuation("}") => { N3Token::Punctuation("}") => {

@ -57,13 +57,13 @@ impl RuleRecognizer for TriGRecognizer {
) -> Self { ) -> Self {
if let Some(rule) = self.stack.pop() { if let Some(rule) = self.stack.pop() {
match rule { match rule {
// [1g] trigDoc ::= (directive | block)* // [1g] trigDoc ::= (directive | block)*
// [2g] block ::= triplesOrGraph | wrappedGraph | triples2 | "GRAPH" labelOrSubject wrappedGraph // [2g] block ::= triplesOrGraph | wrappedGraph | triples2 | "GRAPH" labelOrSubject wrappedGraph
// [3] directive ::= prefixID | base | sparqlPrefix | sparqlBase // [3] directive ::= prefixID | base | sparqlPrefix | sparqlBase
// [4] prefixID ::= '@prefix' PNAME_NS IRIREF '.' // [4] prefixID ::= '@prefix' PNAME_NS IRIREF '.'
// [5] base ::= '@base' IRIREF '.' // [5] base ::= '@base' IRIREF '.'
// [5s] sparqlPrefix ::= "PREFIX" PNAME_NS IRIREF // [5s] sparqlPrefix ::= "PREFIX" PNAME_NS IRIREF
// [6s] sparqlBase ::= "BASE" IRIREF // [6s] sparqlBase ::= "BASE" IRIREF
TriGState::TriGDoc => { TriGState::TriGDoc => {
self.cur_graph = GraphName::DefaultGraph; self.cur_graph = GraphName::DefaultGraph;
self.stack.push(TriGState::TriGDoc); self.stack.push(TriGState::TriGDoc);
@ -142,8 +142,8 @@ impl RuleRecognizer for TriGRecognizer {
} } } }
_ => self.error(errors, "The PREFIX declaration should be followed by a prefix and its value as an IRI"), _ => self.error(errors, "The PREFIX declaration should be followed by a prefix and its value as an IRI"),
}, },
// [3g] triplesOrGraph ::= labelOrSubject ( wrappedGraph | predicateObjectList '.' ) | quotedTriple predicateObjectList '.' // [3g] triplesOrGraph ::= labelOrSubject ( wrappedGraph | predicateObjectList '.' ) | quotedTriple predicateObjectList '.'
// [4g] triples2 ::= blankNodePropertyList predicateObjectList? '.' | collection predicateObjectList '.' // [4g] triples2 ::= blankNodePropertyList predicateObjectList? '.' | collection predicateObjectList '.'
TriGState::TriplesOrGraph => match token { TriGState::TriplesOrGraph => match token {
N3Token::IriRef(iri) => { N3Token::IriRef(iri) => {
self.stack.push(TriGState::WrappedGraphOrPredicateObjectList { self.stack.push(TriGState::WrappedGraphOrPredicateObjectList {
@ -267,8 +267,8 @@ impl RuleRecognizer for TriGRecognizer {
self.recognize_next(token, context,results, errors) self.recognize_next(token, context,results, errors)
} }
} }
// [5g] wrappedGraph ::= '{' triplesBlock? '}' // [5g] wrappedGraph ::= '{' triplesBlock? '}'
// [6g] triplesBlock ::= triples ('.' triplesBlock?)? // [6g] triplesBlock ::= triples ('.' triplesBlock?)?
TriGState::WrappedGraph => if token == N3Token::Punctuation("{") { TriGState::WrappedGraph => if token == N3Token::Punctuation("{") {
self.stack.push(TriGState::WrappedGraphPossibleEnd); self.stack.push(TriGState::WrappedGraphPossibleEnd);
self.stack.push(TriGState::Triples); self.stack.push(TriGState::Triples);
@ -293,8 +293,8 @@ impl RuleRecognizer for TriGRecognizer {
} }
} }
} }
// [6] triples ::= subject predicateObjectList | blankNodePropertyList predicateObjectList? // [6] triples ::= subject predicateObjectList | blankNodePropertyList predicateObjectList?
// [10] subject ::= iri | BlankNode | collection | quotedTriple // [10] subject ::= iri | BlankNode | collection | quotedTriple
TriGState::Triples => match token { TriGState::Triples => match token {
N3Token::Punctuation("}") => { N3Token::Punctuation("}") => {
self.recognize_next(token, context,results, errors) // Early end self.recognize_next(token, context,results, errors) // Early end
@ -348,7 +348,7 @@ impl RuleRecognizer for TriGRecognizer {
self.stack.push(TriGState::PredicateObjectList); self.stack.push(TriGState::PredicateObjectList);
self.recognize_next(token, context,results, errors) self.recognize_next(token, context,results, errors)
} }
// [7g] labelOrSubject ::= iri | BlankNode // [7g] labelOrSubject ::= iri | BlankNode
TriGState::GraphName => match token { TriGState::GraphName => match token {
N3Token::IriRef(iri) => { N3Token::IriRef(iri) => {
self.cur_graph = NamedNode::new_unchecked(iri).into(); self.cur_graph = NamedNode::new_unchecked(iri).into();
@ -379,7 +379,7 @@ impl RuleRecognizer for TriGRecognizer {
} else { } else {
self.error(errors, "Anonymous blank node with a property list are not allowed as graph name") self.error(errors, "Anonymous blank node with a property list are not allowed as graph name")
} }
// [7] predicateObjectList ::= verb objectList (';' (verb objectList)?)* // [7] predicateObjectList ::= verb objectList (';' (verb objectList)?)*
TriGState::PredicateObjectList => { TriGState::PredicateObjectList => {
self.stack.push(TriGState::PredicateObjectListEnd); self.stack.push(TriGState::PredicateObjectListEnd);
self.stack.push(TriGState::ObjectsList); self.stack.push(TriGState::ObjectsList);
@ -406,8 +406,8 @@ impl RuleRecognizer for TriGRecognizer {
self.stack.push(TriGState::Verb); self.stack.push(TriGState::Verb);
self.recognize_next(token, context,results, errors) self.recognize_next(token, context,results, errors)
}, },
// [8] objectList ::= object annotation? ( ',' object annotation? )* // [8] objectList ::= object annotation? ( ',' object annotation? )*
// [30t] annotation ::= '{|' predicateObjectList '|}' // [30t] annotation ::= '{|' predicateObjectList '|}'
TriGState::ObjectsList => { TriGState::ObjectsList => {
self.stack.push(TriGState::ObjectsListEnd); self.stack.push(TriGState::ObjectsListEnd);
self.stack.push(TriGState::Object); self.stack.push(TriGState::Object);
@ -457,8 +457,8 @@ impl RuleRecognizer for TriGRecognizer {
} else { } else {
self.recognize_next(token, context,results, errors) self.recognize_next(token, context,results, errors)
}, },
// [9] verb ::= predicate | 'a' // [9] verb ::= predicate | 'a'
// [11] predicate ::= iri // [11] predicate ::= iri
TriGState::Verb => match token { TriGState::Verb => match token {
N3Token::PlainKeyword("a") => { N3Token::PlainKeyword("a") => {
self.cur_predicate.push(rdf::TYPE.into()); self.cur_predicate.push(rdf::TYPE.into());
@ -479,18 +479,18 @@ impl RuleRecognizer for TriGRecognizer {
self.error(errors, "TOKEN is not a valid predicate") self.error(errors, "TOKEN is not a valid predicate")
} }
} }
// [12] object ::= iri | BlankNode | collection | blankNodePropertyList | literal | quotedTriple // [12] object ::= iri | BlankNode | collection | blankNodePropertyList | literal | quotedTriple
// [13] literal ::= RDFLiteral | NumericLiteral | BooleanLiteral // [13] literal ::= RDFLiteral | NumericLiteral | BooleanLiteral
// [14] blank ::= BlankNode | collection // [14] blank ::= BlankNode | collection
// [15] blankNodePropertyList ::= '[' predicateObjectList ']' // [15] blankNodePropertyList ::= '[' predicateObjectList ']'
// [16] collection ::= '(' object* ')' // [16] collection ::= '(' object* ')'
// [17] NumericLiteral ::= INTEGER | DECIMAL | DOUBLE // [17] NumericLiteral ::= INTEGER | DECIMAL | DOUBLE
// [128s] RDFLiteral ::= String (LANGTAG | '^^' iri)? // [128s] RDFLiteral ::= String (LANGTAG | '^^' iri)?
// [133s] BooleanLiteral ::= 'true' | 'false' // [133s] BooleanLiteral ::= 'true' | 'false'
// [18] String ::= STRING_LITERAL_QUOTE | STRING_LITERAL_SINGLE_QUOTE | STRING_LITERAL_LONG_SINGLE_QUOTE | STRING_LITERAL_LONG_QUOTE // [18] String ::= STRING_LITERAL_QUOTE | STRING_LITERAL_SINGLE_QUOTE | STRING_LITERAL_LONG_SINGLE_QUOTE | STRING_LITERAL_LONG_QUOTE
// [135s] iri ::= IRIREF | PrefixedName // [135s] iri ::= IRIREF | PrefixedName
// [136s] PrefixedName ::= PNAME_LN | PNAME_NS // [136s] PrefixedName ::= PNAME_LN | PNAME_NS
// [137s] BlankNode ::= BLANK_NODE_LABEL | ANON // [137s] BlankNode ::= BLANK_NODE_LABEL | ANON
TriGState::Object => match token { TriGState::Object => match token {
N3Token::IriRef(iri) => { N3Token::IriRef(iri) => {
self.cur_object.push(NamedNode::new_unchecked(iri).into()); self.cur_object.push(NamedNode::new_unchecked(iri).into());
@ -661,7 +661,7 @@ impl RuleRecognizer for TriGRecognizer {
} }
} }
} }
// [27t] quotedTriple ::= '<<' qtSubject verb qtObject '>>' // [27t] quotedTriple ::= '<<' qtSubject verb qtObject '>>'
#[cfg(feature = "rdf-star")] #[cfg(feature = "rdf-star")]
TriGState::SubjectQuotedTripleEnd => { TriGState::SubjectQuotedTripleEnd => {
let triple = Triple::new( let triple = Triple::new(
@ -693,7 +693,7 @@ impl RuleRecognizer for TriGRecognizer {
self.error(errors, "Expecting '>>' to close a quoted triple, found TOKEN") self.error(errors, "Expecting '>>' to close a quoted triple, found TOKEN")
} }
} }
// [28t] qtSubject ::= iri | BlankNode | quotedTriple // [28t] qtSubject ::= iri | BlankNode | quotedTriple
#[cfg(feature = "rdf-star")] #[cfg(feature = "rdf-star")]
TriGState::QuotedSubject => match token { TriGState::QuotedSubject => match token {
N3Token::Punctuation("[") => { N3Token::Punctuation("[") => {
@ -725,7 +725,7 @@ impl RuleRecognizer for TriGRecognizer {
} }
_ => self.error(errors, "TOKEN is not a valid RDF quoted triple subject: TOKEN") _ => self.error(errors, "TOKEN is not a valid RDF quoted triple subject: TOKEN")
} }
// [29t] qtObject ::= iri | BlankNode | literal | quotedTriple // [29t] qtObject ::= iri | BlankNode | literal | quotedTriple
#[cfg(feature = "rdf-star")] #[cfg(feature = "rdf-star")]
TriGState::QuotedObject => match token { TriGState::QuotedObject => match token {
N3Token::Punctuation("[") => { N3Token::Punctuation("[") => {

@ -940,7 +940,7 @@ fn is_turtle_boolean(value: &str) -> bool {
} }
fn is_turtle_integer(value: &str) -> bool { fn is_turtle_integer(value: &str) -> bool {
// [19] INTEGER ::= [+-]? [0-9]+ // [19] INTEGER ::= [+-]? [0-9]+
let mut value = value.as_bytes(); let mut value = value.as_bytes();
if let Some(v) = value.strip_prefix(b"+") { if let Some(v) = value.strip_prefix(b"+") {
value = v; value = v;
@ -951,7 +951,7 @@ fn is_turtle_integer(value: &str) -> bool {
} }
fn is_turtle_decimal(value: &str) -> bool { fn is_turtle_decimal(value: &str) -> bool {
// [20] DECIMAL ::= [+-]? [0-9]* '.' [0-9]+ // [20] DECIMAL ::= [+-]? [0-9]* '.' [0-9]+
let mut value = value.as_bytes(); let mut value = value.as_bytes();
if let Some(v) = value.strip_prefix(b"+") { if let Some(v) = value.strip_prefix(b"+") {
value = v; value = v;
@ -968,8 +968,8 @@ fn is_turtle_decimal(value: &str) -> bool {
} }
fn is_turtle_double(value: &str) -> bool { fn is_turtle_double(value: &str) -> bool {
// [21] DOUBLE ::= [+-]? ([0-9]+ '.' [0-9]* EXPONENT | '.' [0-9]+ EXPONENT | [0-9]+ EXPONENT) // [21] DOUBLE ::= [+-]? ([0-9]+ '.' [0-9]* EXPONENT | '.' [0-9]+ EXPONENT | [0-9]+ EXPONENT)
// [154s] EXPONENT ::= [eE] [+-]? [0-9]+ // [154s] EXPONENT ::= [eE] [+-]? [0-9]+
let mut value = value.as_bytes(); let mut value = value.as_bytes();
if let Some(v) = value.strip_prefix(b"+") { if let Some(v) = value.strip_prefix(b"+") {
value = v; value = v;

@ -359,7 +359,7 @@ fn is_turtle_boolean(value: &str) -> bool {
} }
fn is_turtle_integer(value: &str) -> bool { fn is_turtle_integer(value: &str) -> bool {
// [19] INTEGER ::= [+-]? [0-9]+ // [19] INTEGER ::= [+-]? [0-9]+
let mut value = value.as_bytes(); let mut value = value.as_bytes();
if let Some(v) = value.strip_prefix(b"+") { if let Some(v) = value.strip_prefix(b"+") {
value = v; value = v;
@ -370,7 +370,7 @@ fn is_turtle_integer(value: &str) -> bool {
} }
fn is_turtle_decimal(value: &str) -> bool { fn is_turtle_decimal(value: &str) -> bool {
// [20] DECIMAL ::= [+-]? [0-9]* '.' [0-9]+ // [20] DECIMAL ::= [+-]? [0-9]* '.' [0-9]+
let mut value = value.as_bytes(); let mut value = value.as_bytes();
if let Some(v) = value.strip_prefix(b"+") { if let Some(v) = value.strip_prefix(b"+") {
value = v; value = v;
@ -387,8 +387,8 @@ fn is_turtle_decimal(value: &str) -> bool {
} }
fn is_turtle_double(value: &str) -> bool { fn is_turtle_double(value: &str) -> bool {
// [21] DOUBLE ::= [+-]? ([0-9]+ '.' [0-9]* EXPONENT | '.' [0-9]+ EXPONENT | [0-9]+ EXPONENT) // [21] DOUBLE ::= [+-]? ([0-9]+ '.' [0-9]* EXPONENT | '.' [0-9]+ EXPONENT | [0-9]+ EXPONENT)
// [154s] EXPONENT ::= [eE] [+-]? [0-9]+ // [154s] EXPONENT ::= [eE] [+-]? [0-9]+
let mut value = value.as_bytes(); let mut value = value.as_bytes();
if let Some(v) = value.strip_prefix(b"+") { if let Some(v) = value.strip_prefix(b"+") {
value = v; value = v;

@ -35,8 +35,8 @@ pub struct Query {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct QueryContent { struct QueryContent {
// [1] QueryUnit ::= Query // [1] QueryUnit ::= Query
// [2] Query ::= Prologue ( SelectQuery | ConstructQuery | DescribeQuery | AskQuery ) ValuesClause // [2] Query ::= Prologue ( SelectQuery | ConstructQuery | DescribeQuery | AskQuery ) ValuesClause
variant: QueryVariant, variant: QueryVariant,
values_clause: ValuesClause, values_clause: ValuesClause,
} }
@ -82,7 +82,7 @@ impl fmt::Debug for Query {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct SelectQuery { struct SelectQuery {
// [7] SelectQuery ::= SelectClause DatasetClause* WhereClause SolutionModifier // [7] SelectQuery ::= SelectClause DatasetClause* WhereClause SolutionModifier
select_clause: SelectClause, select_clause: SelectClause,
where_clause: WhereClause, where_clause: WhereClause,
solution_modifier: SolutionModifier, solution_modifier: SolutionModifier,
@ -100,7 +100,7 @@ impl fmt::Display for SelectQuery {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct SubSelect { struct SubSelect {
// [8] SubSelect ::= SelectClause WhereClause SolutionModifier ValuesClause // [8] SubSelect ::= SelectClause WhereClause SolutionModifier ValuesClause
select_clause: SelectClause, select_clause: SelectClause,
where_clause: WhereClause, where_clause: WhereClause,
solution_modifier: SolutionModifier, solution_modifier: SolutionModifier,
@ -119,7 +119,7 @@ impl fmt::Display for SubSelect {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct SelectClause { struct SelectClause {
// [9] SelectClause ::= 'SELECT' ( 'DISTINCT' | 'REDUCED' )? ( ( Var | ( '(' Expression 'AS' Var ')' ) )+ | '*' ) // [9] SelectClause ::= 'SELECT' ( 'DISTINCT' | 'REDUCED' )? ( ( Var | ( '(' Expression 'AS' Var ')' ) )+ | '*' )
option: Option<SelectOption>, option: Option<SelectOption>,
values: SelectValues, values: SelectValues,
} }
@ -171,7 +171,7 @@ impl fmt::Display for SelectClause {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct WhereClause { struct WhereClause {
// [17] WhereClause ::= 'WHERE'? GroupGraphPattern // [17] WhereClause ::= 'WHERE'? GroupGraphPattern
with_where: bool, with_where: bool,
group_graph_pattern: GroupGraphPattern, group_graph_pattern: GroupGraphPattern,
} }
@ -187,7 +187,7 @@ impl fmt::Display for WhereClause {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct SolutionModifier { struct SolutionModifier {
// [18] SolutionModifier ::= GroupClause? HavingClause? OrderClause? LimitOffsetClauses? // [18] SolutionModifier ::= GroupClause? HavingClause? OrderClause? LimitOffsetClauses?
group: Option<GroupClause>, group: Option<GroupClause>,
having: Option<HavingClause>, having: Option<HavingClause>,
#[cfg(feature = "order")] #[cfg(feature = "order")]
@ -218,7 +218,7 @@ impl fmt::Display for SolutionModifier {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct GroupClause { struct GroupClause {
// [19] GroupClause ::= 'GROUP' 'BY' GroupCondition+ // [19] GroupClause ::= 'GROUP' 'BY' GroupCondition+
start: GroupCondition, start: GroupCondition,
others: Vec<GroupCondition>, others: Vec<GroupCondition>,
} }
@ -235,7 +235,7 @@ impl fmt::Display for GroupClause {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum GroupCondition { enum GroupCondition {
// [20] GroupCondition ::= BuiltInCall | FunctionCall | '(' Expression ( 'AS' Var )? ')' | Var // [20] GroupCondition ::= BuiltInCall | FunctionCall | '(' Expression ( 'AS' Var )? ')' | Var
BuiltInCall(BuiltInCall), BuiltInCall(BuiltInCall),
// TODO FunctionCall(FunctionCall) // TODO FunctionCall(FunctionCall)
Projection(Expression, Option<Var>), Projection(Expression, Option<Var>),
@ -261,7 +261,7 @@ impl fmt::Display for GroupCondition {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct HavingClause { struct HavingClause {
// [21] HavingClause ::= 'HAVING' HavingCondition+ // [21] HavingClause ::= 'HAVING' HavingCondition+
start: HavingCondition, start: HavingCondition,
others: Vec<HavingCondition>, others: Vec<HavingCondition>,
} }
@ -276,13 +276,13 @@ impl fmt::Display for HavingClause {
} }
} }
// [22] HavingCondition ::= Constraint // [22] HavingCondition ::= Constraint
type HavingCondition = Constraint; type HavingCondition = Constraint;
#[cfg(feature = "order")] #[cfg(feature = "order")]
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct OrderClause { struct OrderClause {
// [23] OrderClause ::= 'ORDER' 'BY' OrderCondition+ // [23] OrderClause ::= 'ORDER' 'BY' OrderCondition+
start: OrderCondition, start: OrderCondition,
others: Vec<OrderCondition>, others: Vec<OrderCondition>,
} }
@ -301,7 +301,7 @@ impl fmt::Display for OrderClause {
#[cfg(feature = "order")] #[cfg(feature = "order")]
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum OrderCondition { enum OrderCondition {
// [24] OrderCondition ::= ( ( 'ASC' | 'DESC' ) BrackettedExpression ) | ( Constraint | Var ) // [24] OrderCondition ::= ( ( 'ASC' | 'DESC' ) BrackettedExpression ) | ( Constraint | Var )
BrackettedExpression { BrackettedExpression {
is_asc: bool, is_asc: bool,
inner: BrackettedExpression, inner: BrackettedExpression,
@ -330,7 +330,7 @@ impl fmt::Display for OrderCondition {
#[cfg(feature = "limit-offset")] #[cfg(feature = "limit-offset")]
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum LimitOffsetClauses { enum LimitOffsetClauses {
// [25] LimitOffsetClauses ::= LimitClause OffsetClause? | OffsetClause LimitClause? // [25] LimitOffsetClauses ::= LimitClause OffsetClause? | OffsetClause LimitClause?
LimitOffset(LimitClause, Option<OffsetClause>), LimitOffset(LimitClause, Option<OffsetClause>),
OffsetLimit(OffsetClause, Option<LimitClause>), OffsetLimit(OffsetClause, Option<LimitClause>),
} }
@ -350,7 +350,7 @@ impl fmt::Display for LimitOffsetClauses {
#[cfg(feature = "limit-offset")] #[cfg(feature = "limit-offset")]
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct LimitClause { struct LimitClause {
// [26] LimitClause ::= 'LIMIT' INTEGER // [26] LimitClause ::= 'LIMIT' INTEGER
value: u8, value: u8,
} }
@ -364,7 +364,7 @@ impl fmt::Display for LimitClause {
#[cfg(feature = "limit-offset")] #[cfg(feature = "limit-offset")]
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct OffsetClause { struct OffsetClause {
// [27] OffsetClause ::= 'OFFSET' INTEGER // [27] OffsetClause ::= 'OFFSET' INTEGER
value: u8, value: u8,
} }
@ -377,7 +377,7 @@ impl fmt::Display for OffsetClause {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct ValuesClause { struct ValuesClause {
// [28] ValuesClause ::= ( 'VALUES' DataBlock )? // [28] ValuesClause ::= ( 'VALUES' DataBlock )?
value: Option<DataBlock>, value: Option<DataBlock>,
} }
@ -393,7 +393,7 @@ impl fmt::Display for ValuesClause {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum GroupGraphPattern { enum GroupGraphPattern {
// [53] GroupGraphPattern ::= '{' ( SubSelect | GroupGraphPatternSub ) '}' // [53] GroupGraphPattern ::= '{' ( SubSelect | GroupGraphPatternSub ) '}'
GroupGraphPatternSub(GroupGraphPatternSub), GroupGraphPatternSub(GroupGraphPatternSub),
SubSelect(Box<SubSelect>), SubSelect(Box<SubSelect>),
} }
@ -411,7 +411,7 @@ impl fmt::Display for GroupGraphPattern {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct GroupGraphPatternSub { struct GroupGraphPatternSub {
// [54] GroupGraphPatternSub ::= TriplesBlock? ( GraphPatternNotTriples '.'? TriplesBlock? )* // [54] GroupGraphPatternSub ::= TriplesBlock? ( GraphPatternNotTriples '.'? TriplesBlock? )*
start: Option<TriplesBlock>, start: Option<TriplesBlock>,
others: Vec<GroupGraphPatternSubOtherBlock>, others: Vec<GroupGraphPatternSubOtherBlock>,
} }
@ -443,7 +443,7 @@ impl fmt::Display for GroupGraphPatternSub {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct TriplesBlock { struct TriplesBlock {
// [55] TriplesBlock ::= TriplesSameSubjectPath ( '.' TriplesBlock? )? // [55] TriplesBlock ::= TriplesSameSubjectPath ( '.' TriplesBlock? )?
start: TriplesSameSubjectPath, start: TriplesSameSubjectPath,
end: Option<Option<Box<TriplesBlock>>>, end: Option<Option<Box<TriplesBlock>>>,
} }
@ -463,7 +463,7 @@ impl fmt::Display for TriplesBlock {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum GraphPatternNotTriples { enum GraphPatternNotTriples {
// [56] GraphPatternNotTriples ::= GroupOrUnionGraphPattern | OptionalGraphPattern | MinusGraphPattern | GraphGraphPattern | ServiceGraphPattern | Filter | Bind | InlineData // [56] GraphPatternNotTriples ::= GroupOrUnionGraphPattern | OptionalGraphPattern | MinusGraphPattern | GraphGraphPattern | ServiceGraphPattern | Filter | Bind | InlineData
GroupOrUnion(GroupOrUnionGraphPattern), GroupOrUnion(GroupOrUnionGraphPattern),
Optional(OptionalGraphPattern), Optional(OptionalGraphPattern),
Minus(MinusGraphPattern), Minus(MinusGraphPattern),
@ -493,7 +493,7 @@ impl fmt::Display for GraphPatternNotTriples {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct OptionalGraphPattern { struct OptionalGraphPattern {
// [57] OptionalGraphPattern ::= 'OPTIONAL' GroupGraphPattern // [57] OptionalGraphPattern ::= 'OPTIONAL' GroupGraphPattern
inner: GroupGraphPattern, inner: GroupGraphPattern,
} }
@ -505,7 +505,7 @@ impl fmt::Display for OptionalGraphPattern {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct LateralGraphPattern { struct LateralGraphPattern {
// [] LateralGraphPattern ::= 'LATERAL' GroupGraphPattern // [] LateralGraphPattern ::= 'LATERAL' GroupGraphPattern
inner: GroupGraphPattern, inner: GroupGraphPattern,
} }
@ -517,7 +517,7 @@ impl fmt::Display for LateralGraphPattern {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct GraphGraphPattern { struct GraphGraphPattern {
// [58] GraphGraphPattern ::= 'GRAPH' VarOrIri GroupGraphPattern // [58] GraphGraphPattern ::= 'GRAPH' VarOrIri GroupGraphPattern
graph: VarOrIri, graph: VarOrIri,
inner: GroupGraphPattern, inner: GroupGraphPattern,
} }
@ -530,7 +530,7 @@ impl fmt::Display for GraphGraphPattern {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct Bind { struct Bind {
// [60] Bind ::= 'BIND' '(' Expression 'AS' Var ')' // [60] Bind ::= 'BIND' '(' Expression 'AS' Var ')'
expression: Expression, expression: Expression,
var: Var, var: Var,
} }
@ -543,7 +543,7 @@ impl fmt::Display for Bind {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct InlineData { struct InlineData {
// [61] InlineData ::= 'VALUES' DataBlock // [61] InlineData ::= 'VALUES' DataBlock
inner: DataBlock, inner: DataBlock,
} }
@ -555,7 +555,7 @@ impl fmt::Display for InlineData {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum DataBlock { enum DataBlock {
// [62] DataBlock ::= InlineDataOneVar | InlineDataFull // [62] DataBlock ::= InlineDataOneVar | InlineDataFull
OneVar(InlineDataOneVar), OneVar(InlineDataOneVar),
Full(InlineDataFull), Full(InlineDataFull),
} }
@ -571,7 +571,7 @@ impl fmt::Display for DataBlock {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct InlineDataOneVar { struct InlineDataOneVar {
// [63] InlineDataOneVar ::= Var '{' DataBlockValue* '}' // [63] InlineDataOneVar ::= Var '{' DataBlockValue* '}'
var: Var, var: Var,
values: Vec<DataBlockValue>, values: Vec<DataBlockValue>,
} }
@ -587,7 +587,7 @@ impl fmt::Display for InlineDataOneVar {
} }
struct InlineDataFull { struct InlineDataFull {
// [64] InlineDataFull ::= ( NIL | '(' Var* ')' ) '{' ( '(' DataBlockValue* ')' | NIL )* '}' // [64] InlineDataFull ::= ( NIL | '(' Var* ')' ) '{' ( '(' DataBlockValue* ')' | NIL )* '}'
vars: Vec<Var>, vars: Vec<Var>,
values: Vec<Vec<DataBlockValue>>, values: Vec<Vec<DataBlockValue>>,
} }
@ -635,7 +635,7 @@ impl fmt::Display for InlineDataFull {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum DataBlockValue { enum DataBlockValue {
// [65] DataBlockValue ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | 'UNDEF' // [65] DataBlockValue ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | 'UNDEF'
Iri(Iri), Iri(Iri),
Literal(Literal), Literal(Literal),
Undef, Undef,
@ -653,7 +653,7 @@ impl fmt::Display for DataBlockValue {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct MinusGraphPattern { struct MinusGraphPattern {
// [66] MinusGraphPattern ::= 'MINUS' GroupGraphPattern // [66] MinusGraphPattern ::= 'MINUS' GroupGraphPattern
inner: GroupGraphPattern, inner: GroupGraphPattern,
} }
@ -665,7 +665,7 @@ impl fmt::Display for MinusGraphPattern {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct GroupOrUnionGraphPattern { struct GroupOrUnionGraphPattern {
// [67] GroupOrUnionGraphPattern ::= GroupGraphPattern ( 'UNION' GroupGraphPattern )* // [67] GroupOrUnionGraphPattern ::= GroupGraphPattern ( 'UNION' GroupGraphPattern )*
start: GroupGraphPattern, start: GroupGraphPattern,
others: Vec<GroupGraphPattern>, others: Vec<GroupGraphPattern>,
} }
@ -682,7 +682,7 @@ impl fmt::Display for GroupOrUnionGraphPattern {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct Filter { struct Filter {
// [68] Filter ::= 'FILTER' Constraint // [68] Filter ::= 'FILTER' Constraint
constraint: Constraint, constraint: Constraint,
} }
@ -694,7 +694,7 @@ impl fmt::Display for Filter {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum Constraint { enum Constraint {
// [69] Constraint ::= BrackettedExpression | BuiltInCall | FunctionCall // [69] Constraint ::= BrackettedExpression | BuiltInCall | FunctionCall
BrackettedExpression(BrackettedExpression), BrackettedExpression(BrackettedExpression),
BuiltInCall(BuiltInCall), BuiltInCall(BuiltInCall),
// TODO FunctionCall(FunctionCall), // TODO FunctionCall(FunctionCall),
@ -712,7 +712,7 @@ impl fmt::Display for Constraint {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct FunctionCall { struct FunctionCall {
// [70] FunctionCall ::= iri ArgList // [70] FunctionCall ::= iri ArgList
iri: Iri, iri: Iri,
args: ArgList, args: ArgList,
} }
@ -725,7 +725,7 @@ impl fmt::Display for FunctionCall {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum ArgList { enum ArgList {
// [71] ArgList ::= NIL | '(' 'DISTINCT'? Expression ( ',' Expression )* ')' // [71] ArgList ::= NIL | '(' 'DISTINCT'? Expression ( ',' Expression )* ')'
Nil, Nil,
NotNil { NotNil {
// TODO: DISTINCT // TODO: DISTINCT
@ -749,7 +749,7 @@ impl fmt::Display for ArgList {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct ExpressionList { struct ExpressionList {
// [72] ExpressionList ::= NIL | '(' Expression ( ',' Expression )* ')' // [72] ExpressionList ::= NIL | '(' Expression ( ',' Expression )* ')'
inner: Vec<Expression>, inner: Vec<Expression>,
} }
@ -768,7 +768,7 @@ impl fmt::Display for ExpressionList {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct PropertyListNotEmpty { struct PropertyListNotEmpty {
// [77] PropertyListNotEmpty ::= Verb ObjectList ( ';' ( Verb ObjectList )? )* // [77] PropertyListNotEmpty ::= Verb ObjectList ( ';' ( Verb ObjectList )? )*
start_predicate: Verb, start_predicate: Verb,
start_object: Box<ObjectList>, start_object: Box<ObjectList>,
others: Vec<Option<PropertyListElement>>, others: Vec<Option<PropertyListElement>>,
@ -795,7 +795,7 @@ impl fmt::Display for PropertyListNotEmpty {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum Verb { enum Verb {
// [78] Verb ::= VarOrIri | 'a' // [78] Verb ::= VarOrIri | 'a'
VarOrIri(VarOrIri), VarOrIri(VarOrIri),
A, A,
} }
@ -811,7 +811,7 @@ impl fmt::Display for Verb {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct ObjectList { struct ObjectList {
// [79] ObjectList ::= Object ( ',' Object )* // [79] ObjectList ::= Object ( ',' Object )*
start: Object, start: Object,
others: Vec<Object>, others: Vec<Object>,
} }
@ -827,12 +827,12 @@ impl fmt::Display for ObjectList {
} }
} }
// [80] Object ::= GraphNode // [80] Object ::= GraphNode
type Object = GraphNode; type Object = GraphNode;
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum TriplesSameSubjectPath { enum TriplesSameSubjectPath {
// [81] TriplesSameSubjectPath ::= VarOrTerm PropertyListPathNotEmpty | TriplesNodePath PropertyListPath // [81] TriplesSameSubjectPath ::= VarOrTerm PropertyListPathNotEmpty | TriplesNodePath PropertyListPath
Atomic { Atomic {
subject: VarOrTerm, subject: VarOrTerm,
predicate_object: PropertyListPathNotEmpty, predicate_object: PropertyListPathNotEmpty,
@ -864,7 +864,7 @@ impl fmt::Display for TriplesSameSubjectPath {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct PropertyListPath { struct PropertyListPath {
// [82] PropertyListPath ::= PropertyListPathNotEmpty? // [82] PropertyListPath ::= PropertyListPathNotEmpty?
inner: Option<PropertyListPathNotEmpty>, inner: Option<PropertyListPathNotEmpty>,
} }
@ -880,7 +880,7 @@ impl fmt::Display for PropertyListPath {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct PropertyListPathNotEmpty { struct PropertyListPathNotEmpty {
// [83] PropertyListPathNotEmpty ::= ( VerbPath | VerbSimple ) ObjectListPath ( ';' ( ( VerbPath | VerbSimple ) ObjectListPath )? )* // [83] PropertyListPathNotEmpty ::= ( VerbPath | VerbSimple ) ObjectListPath ( ';' ( ( VerbPath | VerbSimple ) ObjectListPath )? )*
start_predicate: PropertyListPathNotEmptyVerb, start_predicate: PropertyListPathNotEmptyVerb,
start_object: Box<ObjectListPath>, start_object: Box<ObjectListPath>,
others: Vec<Option<PropertyListPathElement>>, others: Vec<Option<PropertyListPathElement>>,
@ -919,15 +919,15 @@ impl fmt::Display for PropertyListPathNotEmpty {
} }
} }
// [84] VerbPath ::= Path // [84] VerbPath ::= Path
type VerbPath = Path; type VerbPath = Path;
// [85] VerbSimple ::= Var // [85] VerbSimple ::= Var
type VerbSimple = Var; type VerbSimple = Var;
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct ObjectListPath { struct ObjectListPath {
// [86] ObjectListPath ::= ObjectPath ( ',' ObjectPath )* // [86] ObjectListPath ::= ObjectPath ( ',' ObjectPath )*
start: ObjectPath, start: ObjectPath,
others: Vec<ObjectPath>, others: Vec<ObjectPath>,
} }
@ -942,15 +942,15 @@ impl fmt::Display for ObjectListPath {
} }
} }
// [87] ObjectPath ::= GraphNodePath // [87] ObjectPath ::= GraphNodePath
type ObjectPath = GraphNodePath; type ObjectPath = GraphNodePath;
// [88] Path ::= PathAlternative // [88] Path ::= PathAlternative
type Path = PathAlternative; type Path = PathAlternative;
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct PathAlternative { struct PathAlternative {
// [89] PathAlternative ::= PathSequence ( '|' PathSequence )* // [89] PathAlternative ::= PathSequence ( '|' PathSequence )*
start: PathSequence, start: PathSequence,
others: Vec<PathSequence>, others: Vec<PathSequence>,
} }
@ -967,7 +967,7 @@ impl fmt::Display for PathAlternative {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct PathSequence { struct PathSequence {
// [90] PathSequence ::= PathEltOrInverse ( '/' PathEltOrInverse )* // [90] PathSequence ::= PathEltOrInverse ( '/' PathEltOrInverse )*
start: PathEltOrInverse, start: PathEltOrInverse,
others: Vec<PathEltOrInverse>, others: Vec<PathEltOrInverse>,
} }
@ -984,7 +984,7 @@ impl fmt::Display for PathSequence {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct PathElt { struct PathElt {
// [91] PathElt ::= PathPrimary PathMod? // [91] PathElt ::= PathPrimary PathMod?
path: PathPrimary, path: PathPrimary,
mode: Option<PathMod>, mode: Option<PathMod>,
} }
@ -1001,7 +1001,7 @@ impl fmt::Display for PathElt {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum PathEltOrInverse { enum PathEltOrInverse {
// [92] PathEltOrInverse ::= PathElt | '^' PathElt // [92] PathEltOrInverse ::= PathElt | '^' PathElt
PathElt(PathElt), PathElt(PathElt),
Inverse(PathElt), Inverse(PathElt),
} }
@ -1017,7 +1017,7 @@ impl fmt::Display for PathEltOrInverse {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum PathMod { enum PathMod {
// [93] PathMod ::= '?' | '*' | '+' // [93] PathMod ::= '?' | '*' | '+'
ZeroOrOne, ZeroOrOne,
ZeroOrMore, ZeroOrMore,
OneOrMore, OneOrMore,
@ -1035,7 +1035,7 @@ impl fmt::Display for PathMod {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum PathPrimary { enum PathPrimary {
// [94] PathPrimary ::= iri | 'a' | '!' PathNegatedPropertySet | '(' Path ')' // [94] PathPrimary ::= iri | 'a' | '!' PathNegatedPropertySet | '(' Path ')'
Iri(Iri), Iri(Iri),
A, A,
Negated(PathNegatedPropertySet), Negated(PathNegatedPropertySet),
@ -1055,7 +1055,7 @@ impl fmt::Display for PathPrimary {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum PathNegatedPropertySet { enum PathNegatedPropertySet {
// [95] PathNegatedPropertySet ::= PathOneInPropertySet | '(' ( PathOneInPropertySet ( '|' PathOneInPropertySet )* )? ')' // [95] PathNegatedPropertySet ::= PathOneInPropertySet | '(' ( PathOneInPropertySet ( '|' PathOneInPropertySet )* )? ')'
Single(PathOneInPropertySet), Single(PathOneInPropertySet),
Multiple { Multiple {
start: PathOneInPropertySet, start: PathOneInPropertySet,
@ -1080,7 +1080,7 @@ impl fmt::Display for PathNegatedPropertySet {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum PathOneInPropertySet { enum PathOneInPropertySet {
// [96] PathOneInPropertySet ::= iri | 'a' | '^' ( iri | 'a' ) // [96] PathOneInPropertySet ::= iri | 'a' | '^' ( iri | 'a' )
Iri(Iri), Iri(Iri),
A, A,
NegatedIri(Iri), NegatedIri(Iri),
@ -1100,7 +1100,7 @@ impl fmt::Display for PathOneInPropertySet {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum TriplesNode { enum TriplesNode {
// [98] TriplesNode ::= Collection | BlankNodePropertyList // [98] TriplesNode ::= Collection | BlankNodePropertyList
Collection(Collection), Collection(Collection),
BlankNodePropertyList(BlankNodePropertyList), BlankNodePropertyList(BlankNodePropertyList),
} }
@ -1116,7 +1116,7 @@ impl fmt::Display for TriplesNode {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct BlankNodePropertyList { struct BlankNodePropertyList {
// [99] BlankNodePropertyList ::= '[' PropertyListNotEmpty ']' // [99] BlankNodePropertyList ::= '[' PropertyListNotEmpty ']'
inner: PropertyListNotEmpty, inner: PropertyListNotEmpty,
} }
@ -1128,7 +1128,7 @@ impl fmt::Display for BlankNodePropertyList {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum TriplesNodePath { enum TriplesNodePath {
// [100] TriplesNodePath ::= CollectionPath | BlankNodePropertyListPath // [100] TriplesNodePath ::= CollectionPath | BlankNodePropertyListPath
CollectionPath(CollectionPath), CollectionPath(CollectionPath),
BlankNodePropertyListPath(BlankNodePropertyListPath), BlankNodePropertyListPath(BlankNodePropertyListPath),
} }
@ -1144,7 +1144,7 @@ impl fmt::Display for TriplesNodePath {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct BlankNodePropertyListPath { struct BlankNodePropertyListPath {
// [101] BlankNodePropertyListPath ::= '[' PropertyListPathNotEmpty ']' // [101] BlankNodePropertyListPath ::= '[' PropertyListPathNotEmpty ']'
inner: PropertyListPathNotEmpty, inner: PropertyListPathNotEmpty,
} }
@ -1156,7 +1156,7 @@ impl fmt::Display for BlankNodePropertyListPath {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct Collection { struct Collection {
// [102] Collection ::= '(' GraphNode+ ')' // [102] Collection ::= '(' GraphNode+ ')'
start: Box<GraphNode>, start: Box<GraphNode>,
others: Vec<GraphNode>, others: Vec<GraphNode>,
} }
@ -1173,7 +1173,7 @@ impl fmt::Display for Collection {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct CollectionPath { struct CollectionPath {
// [103] CollectionPath ::= '(' GraphNodePath+ ')' // [103] CollectionPath ::= '(' GraphNodePath+ ')'
start: Box<GraphNodePath>, start: Box<GraphNodePath>,
others: Vec<GraphNodePath>, others: Vec<GraphNodePath>,
} }
@ -1190,7 +1190,7 @@ impl fmt::Display for CollectionPath {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum GraphNode { enum GraphNode {
// [104] GraphNode ::= VarOrTerm | TriplesNode // [104] GraphNode ::= VarOrTerm | TriplesNode
VarOrTerm(VarOrTerm), VarOrTerm(VarOrTerm),
TriplesNode(TriplesNode), TriplesNode(TriplesNode),
} }
@ -1206,7 +1206,7 @@ impl fmt::Display for GraphNode {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum GraphNodePath { enum GraphNodePath {
// [105] GraphNodePath ::= VarOrTerm | TriplesNodePath // [105] GraphNodePath ::= VarOrTerm | TriplesNodePath
VarOrTerm(VarOrTerm), VarOrTerm(VarOrTerm),
TriplesNodePath(TriplesNodePath), TriplesNodePath(TriplesNodePath),
} }
@ -1222,7 +1222,7 @@ impl fmt::Display for GraphNodePath {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum VarOrTerm { enum VarOrTerm {
// [106] VarOrTerm ::= Var | GraphTerm // [106] VarOrTerm ::= Var | GraphTerm
Var(Var), Var(Var),
GraphTerm(GraphTerm), GraphTerm(GraphTerm),
} }
@ -1238,7 +1238,7 @@ impl fmt::Display for VarOrTerm {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum VarOrIri { enum VarOrIri {
// [107] VarOrIri ::= Var | iri // [107] VarOrIri ::= Var | iri
Var(Var), Var(Var),
Iri(Iri), Iri(Iri),
} }
@ -1253,7 +1253,7 @@ impl fmt::Display for VarOrIri {
} }
struct Var { struct Var {
// [108] Var ::= VAR1 | VAR2 // [108] Var ::= VAR1 | VAR2
value: u8, value: u8,
} }
@ -1277,7 +1277,7 @@ impl fmt::Display for Var {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum GraphTerm { enum GraphTerm {
// [109] GraphTerm ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | NIL // [109] GraphTerm ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | NIL
Iri(Iri), Iri(Iri),
Literal(Literal), Literal(Literal),
Nil, Nil,
@ -1294,12 +1294,12 @@ impl fmt::Display for GraphTerm {
} }
} }
// [110] Expression ::= ConditionalOrExpression // [110] Expression ::= ConditionalOrExpression
type Expression = ConditionalOrExpression; type Expression = ConditionalOrExpression;
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct ConditionalOrExpression { struct ConditionalOrExpression {
// [111] ConditionalOrExpression ::= ConditionalAndExpression ( '||' ConditionalAndExpression )* // [111] ConditionalOrExpression ::= ConditionalAndExpression ( '||' ConditionalAndExpression )*
start: ConditionalAndExpression, start: ConditionalAndExpression,
others: Vec<ConditionalAndExpression>, others: Vec<ConditionalAndExpression>,
} }
@ -1316,7 +1316,7 @@ impl fmt::Display for ConditionalOrExpression {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct ConditionalAndExpression { struct ConditionalAndExpression {
// [112] ConditionalAndExpression ::= ValueLogical ( '&&' ValueLogical )* // [112] ConditionalAndExpression ::= ValueLogical ( '&&' ValueLogical )*
start: ValueLogical, start: ValueLogical,
others: Vec<ValueLogical>, others: Vec<ValueLogical>,
} }
@ -1331,12 +1331,12 @@ impl fmt::Display for ConditionalAndExpression {
} }
} }
// [113] ValueLogical ::= RelationalExpression // [113] ValueLogical ::= RelationalExpression
type ValueLogical = RelationalExpression; type ValueLogical = RelationalExpression;
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum RelationalExpression { enum RelationalExpression {
// [114] RelationalExpression ::= NumericExpression ( '=' NumericExpression | '!=' NumericExpression | '<' NumericExpression | '>' NumericExpression | '<=' NumericExpression | '>=' NumericExpression | 'IN' ExpressionList | 'NOT' 'IN' ExpressionList )? // [114] RelationalExpression ::= NumericExpression ( '=' NumericExpression | '!=' NumericExpression | '<' NumericExpression | '>' NumericExpression | '<=' NumericExpression | '>=' NumericExpression | 'IN' ExpressionList | 'NOT' 'IN' ExpressionList )?
Base(NumericExpression), Base(NumericExpression),
Equal(NumericExpression, NumericExpression), Equal(NumericExpression, NumericExpression),
NotEqual(NumericExpression, NumericExpression), NotEqual(NumericExpression, NumericExpression),
@ -1364,12 +1364,12 @@ impl fmt::Display for RelationalExpression {
} }
} }
// [115] NumericExpression ::= AdditiveExpression // [115] NumericExpression ::= AdditiveExpression
type NumericExpression = AdditiveExpression; type NumericExpression = AdditiveExpression;
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum AdditiveExpression { enum AdditiveExpression {
// [116] AdditiveExpression ::= MultiplicativeExpression ( '+' MultiplicativeExpression | '-' MultiplicativeExpression | ( NumericLiteralPositive | NumericLiteralNegative ) ( ( '*' UnaryExpression ) | ( '/' UnaryExpression ) )* )* // [116] AdditiveExpression ::= MultiplicativeExpression ( '+' MultiplicativeExpression | '-' MultiplicativeExpression | ( NumericLiteralPositive | NumericLiteralNegative ) ( ( '*' UnaryExpression ) | ( '/' UnaryExpression ) )* )*
Base(MultiplicativeExpression), Base(MultiplicativeExpression),
Plus(MultiplicativeExpression, MultiplicativeExpression), Plus(MultiplicativeExpression, MultiplicativeExpression),
Minus(MultiplicativeExpression, MultiplicativeExpression), // TODO: Prefix + and - Minus(MultiplicativeExpression, MultiplicativeExpression), // TODO: Prefix + and -
@ -1387,7 +1387,7 @@ impl fmt::Display for AdditiveExpression {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum MultiplicativeExpression { enum MultiplicativeExpression {
// [117] MultiplicativeExpression ::= UnaryExpression ( '*' UnaryExpression | '/' UnaryExpression )* // [117] MultiplicativeExpression ::= UnaryExpression ( '*' UnaryExpression | '/' UnaryExpression )*
Base(UnaryExpression), Base(UnaryExpression),
Mul(UnaryExpression, UnaryExpression), Mul(UnaryExpression, UnaryExpression),
Div(UnaryExpression, UnaryExpression), Div(UnaryExpression, UnaryExpression),
@ -1405,7 +1405,7 @@ impl fmt::Display for MultiplicativeExpression {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum UnaryExpression { enum UnaryExpression {
// [118] UnaryExpression ::= '!' PrimaryExpression | '+' PrimaryExpression | '-' PrimaryExpression | PrimaryExpression // [118] UnaryExpression ::= '!' PrimaryExpression | '+' PrimaryExpression | '-' PrimaryExpression | PrimaryExpression
Not(PrimaryExpression), Not(PrimaryExpression),
Plus(PrimaryExpression), Plus(PrimaryExpression),
Minus(PrimaryExpression), Minus(PrimaryExpression),
@ -1425,7 +1425,7 @@ impl fmt::Display for UnaryExpression {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum PrimaryExpression { enum PrimaryExpression {
// [119] PrimaryExpression ::= BrackettedExpression | BuiltInCall | iriOrFunction | RDFLiteral | NumericLiteral | BooleanLiteral | Var // [119] PrimaryExpression ::= BrackettedExpression | BuiltInCall | iriOrFunction | RDFLiteral | NumericLiteral | BooleanLiteral | Var
Bracketted(BrackettedExpression), Bracketted(BrackettedExpression),
BuiltInCall(BuiltInCall), BuiltInCall(BuiltInCall),
IriOrFunction(IriOrFunction), IriOrFunction(IriOrFunction),
@ -1447,7 +1447,7 @@ impl fmt::Display for PrimaryExpression {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct BrackettedExpression { struct BrackettedExpression {
// [120] BrackettedExpression ::= '(' Expression ')' // [120] BrackettedExpression ::= '(' Expression ')'
inner: Box<Expression>, inner: Box<Expression>,
} }
@ -1459,61 +1459,61 @@ impl fmt::Display for BrackettedExpression {
#[derive(Arbitrary)] #[derive(Arbitrary)]
enum BuiltInCall { enum BuiltInCall {
// [121] BuiltInCall ::= Aggregate // [121] BuiltInCall ::= Aggregate
// | 'STR' '(' Expression ')' // | 'STR' '(' Expression ')'
// | 'LANG' '(' Expression ')' // | 'LANG' '(' Expression ')'
// | 'LANGMATCHES' '(' Expression ',' Expression ')' // | 'LANGMATCHES' '(' Expression ',' Expression ')'
// | 'DATATYPE' '(' Expression ')' // | 'DATATYPE' '(' Expression ')'
// | 'BOUND' '(' Var ')' // | 'BOUND' '(' Var ')'
// | 'IRI' '(' Expression ')' // | 'IRI' '(' Expression ')'
// | 'URI' '(' Expression ')' // | 'URI' '(' Expression ')'
// | 'BNODE' ( '(' Expression ')' | NIL ) // | 'BNODE' ( '(' Expression ')' | NIL )
// | 'RAND' NIL // | 'RAND' NIL
// | 'ABS' '(' Expression ')' // | 'ABS' '(' Expression ')'
// | 'CEIL' '(' Expression ')' // | 'CEIL' '(' Expression ')'
// | 'FLOOR' '(' Expression ')' // | 'FLOOR' '(' Expression ')'
// | 'ROUND' '(' Expression ')' // | 'ROUND' '(' Expression ')'
// | 'CONCAT' ExpressionList // | 'CONCAT' ExpressionList
// | SubstringExpression // | SubstringExpression
// | 'STRLEN' '(' Expression ')' // | 'STRLEN' '(' Expression ')'
// | StrReplaceExpression // | StrReplaceExpression
// | 'UCASE' '(' Expression ')' // | 'UCASE' '(' Expression ')'
// | 'LCASE' '(' Expression ')' // | 'LCASE' '(' Expression ')'
// | 'ENCODE_FOR_URI' '(' Expression ')' // | 'ENCODE_FOR_URI' '(' Expression ')'
// | 'CONTAINS' '(' Expression ',' Expression ')' // | 'CONTAINS' '(' Expression ',' Expression ')'
// | 'STRSTARTS' '(' Expression ',' Expression ')' // | 'STRSTARTS' '(' Expression ',' Expression ')'
// | 'STRENDS' '(' Expression ',' Expression ')' // | 'STRENDS' '(' Expression ',' Expression ')'
// | 'STRBEFORE' '(' Expression ',' Expression ')' // | 'STRBEFORE' '(' Expression ',' Expression ')'
// | 'STRAFTER' '(' Expression ',' Expression ')' // | 'STRAFTER' '(' Expression ',' Expression ')'
// | 'YEAR' '(' Expression ')' // | 'YEAR' '(' Expression ')'
// | 'MONTH' '(' Expression ')' // | 'MONTH' '(' Expression ')'
// | 'DAY' '(' Expression ')' // | 'DAY' '(' Expression ')'
// | 'HOURS' '(' Expression ')' // | 'HOURS' '(' Expression ')'
// | 'MINUTES' '(' Expression ')' // | 'MINUTES' '(' Expression ')'
// | 'SECONDS' '(' Expression ')' // | 'SECONDS' '(' Expression ')'
// | 'TIMEZONE' '(' Expression ')' // | 'TIMEZONE' '(' Expression ')'
// | 'TZ' '(' Expression ')' // | 'TZ' '(' Expression ')'
// | 'NOW' NIL // | 'NOW' NIL
// | 'UUID' NIL // | 'UUID' NIL
// | 'STRUUID' NIL // | 'STRUUID' NIL
// | 'MD5' '(' Expression ')' // | 'MD5' '(' Expression ')'
// | 'SHA1' '(' Expression ')' // | 'SHA1' '(' Expression ')'
// | 'SHA256' '(' Expression ')' // | 'SHA256' '(' Expression ')'
// | 'SHA384' '(' Expression ')' // | 'SHA384' '(' Expression ')'
// | 'SHA512' '(' Expression ')' // | 'SHA512' '(' Expression ')'
// | 'COALESCE' ExpressionList // | 'COALESCE' ExpressionList
// | 'IF' '(' Expression ',' Expression ',' Expression ')' // | 'IF' '(' Expression ',' Expression ',' Expression ')'
// | 'STRLANG' '(' Expression ',' Expression ')' // | 'STRLANG' '(' Expression ',' Expression ')'
// | 'STRDT' '(' Expression ',' Expression ')' // | 'STRDT' '(' Expression ',' Expression ')'
// | 'sameTerm' '(' Expression ',' Expression ')' // | 'sameTerm' '(' Expression ',' Expression ')'
// | 'isIRI' '(' Expression ')' // | 'isIRI' '(' Expression ')'
// | 'isURI' '(' Expression ')' // | 'isURI' '(' Expression ')'
// | 'isBLANK' '(' Expression ')' // | 'isBLANK' '(' Expression ')'
// | 'isLITERAL' '(' Expression ')' // | 'isLITERAL' '(' Expression ')'
// | 'isNUMERIC' '(' Expression ')' // | 'isNUMERIC' '(' Expression ')'
// | RegexExpression // | RegexExpression
// | ExistsFunc // | ExistsFunc
// | NotExistsFunc // | NotExistsFunc
Str(Box<Expression>), Str(Box<Expression>),
Lang(Box<Expression>), Lang(Box<Expression>),
Datatype(Box<Expression>), Datatype(Box<Expression>),
@ -1559,7 +1559,7 @@ impl fmt::Display for BuiltInCall {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct ExistsFunc { struct ExistsFunc {
// [125] ExistsFunc ::= 'EXISTS' GroupGraphPattern // [125] ExistsFunc ::= 'EXISTS' GroupGraphPattern
pattern: GroupGraphPattern, pattern: GroupGraphPattern,
} }
@ -1571,7 +1571,7 @@ impl fmt::Display for ExistsFunc {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct NotExistsFunc { struct NotExistsFunc {
// [126] NotExistsFunc ::= 'NOT' 'EXISTS' GroupGraphPattern // [126] NotExistsFunc ::= 'NOT' 'EXISTS' GroupGraphPattern
pattern: GroupGraphPattern, pattern: GroupGraphPattern,
} }
@ -1583,7 +1583,7 @@ impl fmt::Display for NotExistsFunc {
#[derive(Arbitrary)] #[derive(Arbitrary)]
struct IriOrFunction { struct IriOrFunction {
// [128] iriOrFunction ::= iri ArgList? // [128] iriOrFunction ::= iri ArgList?
iri: Iri, iri: Iri,
// TODO args: Option<ArgList>, // TODO args: Option<ArgList>,
} }
@ -1599,12 +1599,12 @@ impl fmt::Display for IriOrFunction {
} }
struct Literal { struct Literal {
// [129] RDFLiteral ::= String ( LANGTAG | ( '^^' iri ) )? // [129] RDFLiteral ::= String ( LANGTAG | ( '^^' iri ) )?
// [130] NumericLiteral ::= NumericLiteralUnsigned | NumericLiteralPositive | NumericLiteralNegative // [130] NumericLiteral ::= NumericLiteralUnsigned | NumericLiteralPositive | NumericLiteralNegative
// [131] NumericLiteralUnsigned ::= INTEGER | DECIMAL | DOUBLE // [131] NumericLiteralUnsigned ::= INTEGER | DECIMAL | DOUBLE
// [132] NumericLiteralPositive ::= INTEGER_POSITIVE | DECIMAL_POSITIVE | DOUBLE_POSITIVE // [132] NumericLiteralPositive ::= INTEGER_POSITIVE | DECIMAL_POSITIVE | DOUBLE_POSITIVE
// [133] NumericLiteralNegative ::= INTEGER_NEGATIVE | DECIMAL_NEGATIVE | DOUBLE_NEGATIVE // [133] NumericLiteralNegative ::= INTEGER_NEGATIVE | DECIMAL_NEGATIVE | DOUBLE_NEGATIVE
// [134] BooleanLiteral ::= 'true' | 'false' // [134] BooleanLiteral ::= 'true' | 'false'
value: &'static str, value: &'static str,
} }
@ -1627,7 +1627,7 @@ impl fmt::Display for Literal {
} }
struct Iri { struct Iri {
// [136] iri ::= IRIREF | PrefixedName // [136] iri ::= IRIREF | PrefixedName
value: u8, value: u8,
} }

Loading…
Cancel
Save