aboutsummaryrefslogtreecommitdiff
path: root/spec/lexspec.json
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-07-22 20:30:23 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-07-22 20:30:23 +0900
commit0baa69676ca83dbb4fe7241478a6ecf6c85418a9 (patch)
treef337b96c1d2c4742647b9e4570d34788014333d3 /spec/lexspec.json
parentWrite a description file (diff)
downloadcotia-0baa69676ca83dbb4fe7241478a6ecf6c85418a9.tar.gz
cotia-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 'spec/lexspec.json')
-rw-r--r--spec/lexspec.json14
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/lexspec.json b/spec/lexspec.json
index 6d1dd93..d95d31a 100644
--- a/spec/lexspec.json
+++ b/spec/lexspec.json
@@ -67,6 +67,10 @@
"pop": true
},
{
+ "kind": "literal_pattern",
+ "pattern": "'[^']*'"
+ },
+ {
"kind": "colon",
"pattern": ":"
},
@@ -79,12 +83,8 @@
"pattern": ";"
},
{
- "kind": "directive_marker",
- "pattern": "#"
- },
- {
"kind": "tree_node_open",
- "pattern": "'\\("
+ "pattern": "#\\("
},
{
"kind": "tree_node_close",
@@ -97,6 +97,10 @@
{
"kind": "expansion",
"pattern": "\\.\\.\\."
+ },
+ {
+ "kind": "directive_marker",
+ "pattern": "#"
}
]
}