aboutsummaryrefslogtreecommitdiff
path: root/spec/grammar/parser/lexspec.json
diff options
context:
space:
mode:
Diffstat (limited to 'spec/grammar/parser/lexspec.json')
-rw-r--r--spec/grammar/parser/lexspec.json123
1 files changed, 123 insertions, 0 deletions
diff --git a/spec/grammar/parser/lexspec.json b/spec/grammar/parser/lexspec.json
new file mode 100644
index 0000000..caf1f0e
--- /dev/null
+++ b/spec/grammar/parser/lexspec.json
@@ -0,0 +1,123 @@
+{
+ "name": "vartan",
+ "entries": [
+ {
+ "fragment": true,
+ "kind": "lf",
+ "pattern": "\\u{000A}"
+ },
+ {
+ "fragment": true,
+ "kind": "cr",
+ "pattern": "\\u{000D}"
+ },
+ {
+ "fragment": true,
+ "kind": "ht",
+ "pattern": "\\u{0009}"
+ },
+ {
+ "fragment": true,
+ "kind": "sp",
+ "pattern": "\\u{0020}"
+ },
+ {
+ "fragment": true,
+ "kind": "newline",
+ "pattern": "\\f{lf}|\\f{cr}|\\f{cr}\\f{lf}"
+ },
+ {
+ "kind": "white_space",
+ "pattern": "(\\f{ht}|\\f{sp})+"
+ },
+ {
+ "kind": "newline",
+ "pattern": "\\f{newline}"
+ },
+ {
+ "kind": "line_comment",
+ "pattern": "//[^\\u{000A}\\u{000D}]*"
+ },
+ {
+ "kind": "kw_fragment",
+ "pattern": "fragment"
+ },
+ {
+ "kind": "identifier",
+ "pattern": "[0-9A-Za-z_]+"
+ },
+ {
+ "kind": "terminal_open",
+ "pattern": "\"",
+ "push": "terminal"
+ },
+ {
+ "modes": ["terminal"],
+ "kind": "pattern",
+ "pattern": "([^\"\\\\]|\\\\.)+"
+ },
+ {
+ "modes": ["terminal"],
+ "kind": "escape_symbol",
+ "pattern": "\\\\"
+ },
+ {
+ "modes": ["terminal"],
+ "kind": "terminal_close",
+ "pattern": "\"",
+ "pop": true
+ },
+ {
+ "kind": "string_literal_open",
+ "pattern": "'",
+ "push": "string_literal"
+ },
+ {
+ "modes": ["string_literal"],
+ "kind": "char_seq",
+ "pattern": "[^']+"
+ },
+ {
+ "modes": ["string_literal"],
+ "kind": "string_literal_close",
+ "pattern": "'",
+ "pop": true
+ },
+ {
+ "kind": "colon",
+ "pattern": ":"
+ },
+ {
+ "kind": "or",
+ "pattern": "\\|"
+ },
+ {
+ "kind": "semicolon",
+ "pattern": ";"
+ },
+ {
+ "kind": "label_marker",
+ "pattern": "@"
+ },
+ {
+ "kind": "expansion",
+ "pattern": "\\.\\.\\."
+ },
+ {
+ "kind": "directive_marker",
+ "pattern": "#"
+ },
+ {
+ "kind": "ordered_symbol_marker",
+ "pattern": "$"
+ },
+ {
+ "kind": "l_paren",
+ "pattern": "\\("
+ },
+ {
+ "kind": "r_paren",
+ "pattern": "\\)"
+ }
+ ]
+}