Skip to content

Commit 6f2b334

Browse files
committed
fix bug in gtrig parser and fix #200
offset when encountering '<<' was wrong @o_o@
1 parent abc59ac commit 6f2b334

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

turtle/src/parser/gtrig.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ impl<I> GTriGSource<I> {
840840
if txt[2..].starts_with('(') {
841841
Ok((3, Some(GTriGState::TripleTerm)))
842842
} else {
843-
Ok((3, Some(GTriGState::ReifiedTriple(true))))
843+
Ok((2, Some(GTriGState::ReifiedTriple(true))))
844844
}
845845
} else {
846846
self.iriref(txt).map(|offset| (offset, None))

turtle/src/parser/gtrig/test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ fn nested_reified_triple() -> TestResult {
674674
#[test_case(r"<< :s :p :o ~ >> :a :b", 2; "1p1 triples with empty reified triple")]
675675
#[test_case(r"<< :s :p :o ~ :r >> :a :b", 2; "1p1 triples with explicitly reified triple")]
676676
#[test_case(r"{[ :p :o ] .}", 1; " trig-syntax-bnode-08")]
677+
#[test_case(r":G {<<:s :p :o>> :q :z .}", 2; " trig12-rt-01")]
677678
fn count_triples(input: &str, exp: usize) -> TestResult {
678679
for i in [input, &format!("{input}\n # this is a comment")] {
679680
let data = format!("PREFIX : <ex:> {i}");

0 commit comments

Comments
 (0)