diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2021-07-22 20:30:23 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2021-07-22 20:30:23 +0900 |
commit | 0baa69676ca83dbb4fe7241478a6ecf6c85418a9 (patch) | |
tree | f337b96c1d2c4742647b9e4570d34788014333d3 /driver/parser_test.go | |
parent | Write a description file (diff) | |
download | urubu-0baa69676ca83dbb4fe7241478a6ecf6c85418a9.tar.gz urubu-0baa69676ca83dbb4fe7241478a6ecf6c85418a9.tar.xz |
Add literal pattern syntax and change tree structure syntax
- Literal patterns don't interpret the special characters of regular expressions.
In other words, 'abc|def' matches only `abc|def`, not `abc` or `def`.
- Change tree structure syntax from '(...) to #(...).
Diffstat (limited to 'driver/parser_test.go')
-rw-r--r-- | driver/parser_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/driver/parser_test.go b/driver/parser_test.go index 0bf8175..272a14d 100644 --- a/driver/parser_test.go +++ b/driver/parser_test.go @@ -210,10 +210,10 @@ fragment words: "[A-Za-z\u{0020}]+"; { specSrc: ` list - : "\[" elems "]" #ast '(list $2...) + : "\[" elems "]" #ast #(list $2...) ; elems - : elems "," id #ast '(elems $1... $3) + : elems "," id #ast #(elems $1... $3) | id ; whitespace: "\u{0020}+" #skip; @@ -245,7 +245,7 @@ id: "[A-Za-z]+"; { specSrc: ` s - : foo #ast '(start $1) + : foo #ast #(start $1) ; foo : bar @@ -258,7 +258,7 @@ bar: "bar"; { specSrc: ` s - : "foo" #ast '(s $1...) + : "foo" #ast #(s $1...) ; `, specErr: true, @@ -267,7 +267,7 @@ s { specSrc: ` s - : foo #ast '(s $1...) + : foo #ast #(s $1...) ; foo: "foo"; `, |