|
|
@ -329,6 +329,27 @@ mod grammar { |
|
|
|
unescape_characters(input, &UNESCAPE_CHARACTERS, &UNESCAPE_REPLACEMENT) |
|
|
|
unescape_characters(input, &UNESCAPE_CHARACTERS, &UNESCAPE_REPLACEMENT) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const UNESCAPE_PN_CHARACTERS: [u8; 20] = [ |
|
|
|
|
|
|
|
b'_', b'~', b'.', b'-', b'!', b'$', b'&', b'\'', b'(', b')', b'*', b'+', b',', b';', b'=', |
|
|
|
|
|
|
|
b'/', b'?', b'#', b'@', b'%', |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
lazy_static! { |
|
|
|
|
|
|
|
static ref UNESCAPE_PN_REPLACEMENT: StaticSliceMap<char, char> = StaticSliceMap::new( |
|
|
|
|
|
|
|
&[ |
|
|
|
|
|
|
|
'_', '~', '.', '-', '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=', '/', |
|
|
|
|
|
|
|
'?', '#', '@', '%' |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
&[ |
|
|
|
|
|
|
|
'_', '~', '.', '-', '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=', '/', |
|
|
|
|
|
|
|
'?', '#', '@', '%' |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn unescape_pn_local(input: &str) -> Cow<str> { |
|
|
|
|
|
|
|
unescape_characters(input, &UNESCAPE_PN_CHARACTERS, &UNESCAPE_PN_REPLACEMENT) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
include!(concat!(env!("OUT_DIR"), "/sparql_grammar.rs")); |
|
|
|
include!(concat!(env!("OUT_DIR"), "/sparql_grammar.rs")); |
|
|
|
|
|
|
|
|
|
|
|
pub fn read_sparql_query<'a, R: Read + 'a>( |
|
|
|
pub fn read_sparql_query<'a, R: Read + 'a>( |
|
|
|