diff --git a/src/rio/turtle/mod.rs b/src/rio/turtle/mod.rs index fe1fd4eb..742b6809 100644 --- a/src/rio/turtle/mod.rs +++ b/src/rio/turtle/mod.rs @@ -44,10 +44,8 @@ mod grammar { let mut string_buffer = String::default(); BufReader::new(source).read_to_string(&mut string_buffer)?; - match turtleDoc(&string_buffer, &mut state, &mut triple_buffer) { - Ok(_) => Ok(triple_buffer.into_iter()), - Err(error) => Err(error.into()), - } + turtleDoc(&string_buffer, &mut state, &mut triple_buffer)?; + Ok(triple_buffer.into_iter()) } } diff --git a/src/sparql/parser.rs b/src/sparql/parser.rs index b3bdb922..79ebd972 100644 --- a/src/sparql/parser.rs +++ b/src/sparql/parser.rs @@ -298,13 +298,10 @@ mod grammar { let mut string_buffer = String::default(); BufReader::new(source).read_to_string(&mut string_buffer)?; - match QueryUnit( + Ok(QueryUnit( &unescape_unicode_codepoints(Cow::from(string_buffer)), &mut state, - ) { - Ok(query) => Ok(query), - Err(error) => Err(error.into()), - } + )?) } } diff --git a/src/sparql/sparql_grammar.rustpeg b/src/sparql/sparql_grammar.rustpeg index 29c939b1..1c6091b6 100644 --- a/src/sparql/sparql_grammar.rustpeg +++ b/src/sparql/sparql_grammar.rustpeg @@ -1074,7 +1074,7 @@ PERCENT -> () = "%" HEX HEX HEX -> () = ([0-9A-Fa-f]) //[173] -PN_LOCAL_ESC -> char = "\\" c:$([_~\.\-!$&'()*+,;=/?#@%:]) { c.chars().next().unwrap() } //TODO: added '/' to make tests pass but is it valid? +PN_LOCAL_ESC -> char = "\\" c:$([_~\.\-!$&'()*+,;=/?#@%]) { c.chars().next().unwrap() } //TODO: added '/' to make tests pass but is it valid? //space _ = #quiet<([ \t\n\r] / comment)*> diff --git a/tests/rdf_test_cases.rs b/tests/rdf_test_cases.rs index bc402bf0..a2c88062 100644 --- a/tests/rdf_test_cases.rs +++ b/tests/rdf_test_cases.rs @@ -157,11 +157,9 @@ fn sparql_w3c_syntax_testsuite() { } } else if test.kind == "NegativeSyntaxTest11" { //TODO - /*assert!( - client.load_sparql_query(test.action.clone()).is_err(), - "Failure on {}", - test - );*/ + if let Ok(result) = client.load_sparql_query(test.action.clone()) { + eprintln!("Failure on {}. The output tree is: {}", test, result); + } } else { assert!(false, "Not supported test: {}", test); }