diff --git a/src/grammer.pest b/src/grammer.pest index 515102d..46666c4 100644 --- a/src/grammer.pest +++ b/src/grammer.pest @@ -69,4 +69,4 @@ query = _{SOI ~ "$" ~ root? ~ EOI} simple_query = _{SOI ~ "$" ~ simple_root ~ EOI} -WHITESPACE = _{ " " } \ No newline at end of file +WHITESPACE = _{ " " | "\r\n" | "\n" | "\r" | "\t" } \ No newline at end of file diff --git a/tests/filter.rs b/tests/filter.rs index 7758d67..dc8598c 100644 --- a/tests/filter.rs +++ b/tests/filter.rs @@ -319,3 +319,12 @@ fn unimplemented_in_filter() { json!([]), ); } + +#[test] +fn whitespace() { + select_and_then_compare( + "$\n[\r?\t(\r\n@\r.a == 1)]", + json!({"a": 1}), + json!([{"a" : 1}]), + ); +}