diff --git a/CHANGELOG.md b/CHANGELOG.md index 245436a94..3d3033d20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ syntactic changes". Fixed an issue in C and C++ where blank lines were highlighted after novel preprocessor lines. +Added support for Janet. Added support for Lua. ## 0.24 (release 26th March 2022) diff --git a/Cargo.lock b/Cargo.lock index 1073c64d8..0bfec900f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,9 +435,9 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "rpds" -version = "0.11.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ef5140bcb576bfd6d56cd2de709a7d17851ac1f3805e67fe9d99e42a11821f" +checksum = "054e417ded02a19ae192c8c89412eaec7d1c2cdd826aa412565761d86ca6315e" dependencies = [ "archery", ] diff --git a/Cargo.toml b/Cargo.toml index 1dc650e6a..2f56954ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ walkdir = "2.3.2" term_size = "0.3.2" const_format = "0.2.22" owo-colors = "3.2.0" -rpds = "0.11.0" +rpds = "0.10.0" wu-diff = "0.1.2" [dev-dependencies] diff --git a/README.md b/README.md index 6b7d30fc2..29f1fa5ca 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ Difftastic supports the following languages: * Emacs Lisp * Go * Haskell +* Janet * Java * JavaScript (and JSX) * JSON diff --git a/build.rs b/build.rs index b7c092d51..35d58b311 100644 --- a/build.rs +++ b/build.rs @@ -114,6 +114,11 @@ fn main() { src_dir: "vendor/tree-sitter-haskell-src", extra_files: vec!["scanner.cc"], }, + TreeSitterParser { + name: "tree-sitter-janet-simple", + src_dir: "vendor/tree-sitter-janet-simple-src", + extra_files: vec!["scanner.c"], + }, TreeSitterParser { name: "tree-sitter-java", src_dir: "vendor/tree-sitter-java-src", diff --git a/manual/src/introduction.md b/manual/src/introduction.md index be1141b27..c80610084 100644 --- a/manual/src/introduction.md +++ b/manual/src/introduction.md @@ -16,6 +16,7 @@ tool that understands syntax. It supports the following languages: * Go * Hack * Haskell +* Janet * Java * JavaScript (and JSX) * JSON diff --git a/manual/src/tricky_cases.md b/manual/src/tricky_cases.md index 93ffb4a6b..fe3a8a13c 100644 --- a/manual/src/tricky_cases.md +++ b/manual/src/tricky_cases.md @@ -256,7 +256,7 @@ with lots of NOVEL words about lots of stuff.""" ``` -It would be correct to higlight the entire string literal as being +It would be correct to highlight the entire string literal as being removed and replaced with a new string literal. However, this makes it hard to see what's actually changed. diff --git a/manual/src/upstream_parsers.md b/manual/src/upstream_parsers.md index 2ee466dbf..2be5592b5 100644 --- a/manual/src/upstream_parsers.md +++ b/manual/src/upstream_parsers.md @@ -16,6 +16,7 @@ Difftastic uses the following tree-sitter parsers: | Emacs Lisp | [wilfred/tree-sitter-elisp](https://github.com/Wilfred/tree-sitter-elisp) | | Go | [tree-sitter/tree-sitter-go](https://github.com/tree-sitter/tree-sitter-go) | | Haskell | [tree-sitter/tree-sitter-haskell](https://github.com/tree-sitter/tree-sitter-haskell) | +| Janet | [sogaiu/tree-sitter-janet-simple](https://github.com/sogaiu/tree-sitter-janet-simple) | | Java | [tree-sitter/tree-sitter-java](https://github.com/tree-sitter/tree-sitter-java) | | JavaScript, JSX | [tree-sitter/tree-sitter-javascript](https://github.com/tree-sitter/tree-sitter-javascript) | | JSON | [tree-sitter/tree-sitter-json](https://github.com/tree-sitter/tree-sitter-json) | diff --git a/sample_files/compare.expected b/sample_files/compare.expected index bd4411b7d..f7a7262a6 100644 --- a/sample_files/compare.expected +++ b/sample_files/compare.expected @@ -46,6 +46,9 @@ sample_files/identical_before.scala sample_files/identical_after.scala sample_files/if_before.py sample_files/if_after.py e633761742973b2ef3b2ed078cedbdf2 - +sample_files/janet_before.janet sample_files/janet_after.janet +677604a16ef62f6b6252d76d76e86265 - + sample_files/java_before.java sample_files/java_after.java 7fda19b66481b0658fc476b2a0e2657b - diff --git a/sample_files/janet_after.janet b/sample_files/janet_after.janet new file mode 100644 index 000000000..6a4ad2f8d --- /dev/null +++ b/sample_files/janet_after.janet @@ -0,0 +1,314 @@ +# the "GNU Emacs Lisp Reference Manual" has very useful info +# in the code below section names will be mentioned, like: +# see "Special Read Syntax" + +# bl - begin line +# bc - begin column +# el - end line +# ec - end column +(defn make-attrs + [& items] + (zipcoll [:bl :bc :el :ec] + items)) + +(defn atom-node + [node-type peg-form] + ~(cmt (capture (sequence (line) (column) + ,peg-form + (line) (column))) + ,|[node-type (make-attrs ;(slice $& 0 -2)) (last $&)])) + +(defn reader-macro-node + [node-type sigil] + ~(cmt (capture (sequence (line) (column) + ,sigil + (any :non-form) + :form + (line) (column))) + ,|[node-type (make-attrs ;(slice $& 0 2) ;(slice $& -4 -2)) + ;(slice $& 2 -4)])) + +(defn collection-node + [node-type open-delim close-delim] + ~(cmt + (capture + (sequence + (line) (column) + ,open-delim + (any :input) + (choice ,close-delim + (error + (replace (sequence (line) (column)) + ,|(string/format + "line: %p column: %p missing %p for %p" + $0 $1 close-delim node-type)))) + (line) (column))) + ,|[node-type (make-attrs ;(slice $& 0 2) ;(slice $& -4 -2)) + ;(slice $& 2 -4)])) + +(def loc-grammar + ~{:main (sequence (line) (column) + (some :input) + (line) (column)) + # + :input (choice :non-form + :form) + # + :non-form (choice :whitespace + :comment) + # + :whitespace ,(atom-node :whitespace + '(choice (some (set " \f\t\v")) + (choice "\r\n" + "\r" + "\n"))) + # + :comment ,(atom-node :comment + '(sequence ";" + (any (if-not (set "\r\n") 1)))) + # + :form (choice # reader macros + :backquote + :function + :quote + :unquote-splice + :unquote + # collections + :list + :vector + :char-table + :sub-char-table + :hash-table + :record + :bytecode + :string-text-props + # atoms + # XXX: might need assertions at end of things before + # symbols. see the partial job in :integer-10 below + :float + :integer + :char + :string + :symbol) + # see "Backquote" + :backquote ,(reader-macro-node :backquote "`") + # see "Anonymous Functions" + :function ,(reader-macro-node :function "#'") + # see "Quoting" + :quote ,(reader-macro-node :quote "'") + # see "Backquote" + :unquote-splice ,(reader-macro-node :unquote-splice ",@") + # see "Backquote" + :unquote ,(reader-macro-node :unquote ",") + # + # see "Cons Cell Type" + :list ,(collection-node :list "(" ")") + # see "Vectors" + :vector ,(collection-node :vector "[" "]") + # see "Char-Table Type" + :char-table ,(collection-node :char-table "#^[" "]") + # see "Char-Table Type" + :sub-char-table ,(collection-node :sub-char-table "#^^[" "]") + # see "Byte-Code Objects" + :bytecode ,(collection-node :bytecode "#[" "]") + # see "Hash Tables" + :hash-table ,(collection-node :hash-table "#s(hash-table" ")") + # see "Records" + :record ,(collection-node :record "#s(" ")") + # see "Text Props and Strings" + :string-text-props + ,(collection-node :string-text-props "#(" ")") + # + # see "Float Basics" + :float ,(atom-node :float + '(choice :float-dec + :float-exp + :float-both + :float-inf + :float-nan)) + # + :float-dec (sequence (opt (choice "+" "-")) + :d* + "." + :d+) + # + :float-exp (sequence (opt (choice "+" "-")) + :d* + (choice "e" "E") + :d+) + # + :float-both (sequence (opt (choice "+" "-")) + :d* + "." + :d+ + (choice "e" "E") + :d+) + # + :float-inf (sequence (opt "-") + "1.0" + (choice "e" "E") + "+INF") + # + :float-nan (sequence (opt "-") + "0.0" + (choice "e" "E") + "+NaN") + # see "Integer Basics" + :integer ,(atom-node :integer + '(choice :integer-10 + :integer-base)) + # + :integer-10 (sequence (opt (choice "+" "-")) + :d+ + (opt ".") + # XXX: hack? + (not (set "+-"))) + # + :integer-base (sequence "#" + (choice "b" + "o" + "x" + # XXX: found in xml.el, but docs...(?) + "X" + (sequence :d+ "r")) + # XXX: docs contradict this(?), but works... + (opt (choice "+" "-")) + (some (choice :a :d))) + # see "Basic Char Syntax" + :char ,(atom-node :char + '(sequence "?" + (choice :char-octal + :char-hex + :char-uni-name + #:char-uni-val + :char-uni-val-low + :char-uni-val-up + :char-meta-octal + :char-key + :char-basic))) + # see "General Escape Syntax" + :char-octal (sequence "\\" (3 (range "07"))) + :char-hex (sequence "\\x" :h+) + :char-uni-name (sequence "\\N{" (thru "}")) + #:char-uni-val (sequence "\\N{U+" :h+ "}") + :char-uni-val-low (sequence "\\u" (4 :h)) + :char-uni-val-up (sequence "\\U" (8 :h)) + # see "Meta-Char Syntax" + :char-meta-octal (sequence "\\M-" :char-octal) + # see "Ctl-Char Syntax" + # see "Other Char Bits" + :char-key + (sequence (some (sequence "\\" + (choice (sequence (set "ACHMSs") "-") + "^"))) + # XXX: not strictly correct? + (choice :char-octal + :char-hex + :char-uni-name + #:char-uni-val + :char-uni-val-low + :char-uni-val-up + :char-meta-octal + :char-basic)) + # XXX: not strictly correct, but perhaps it's ok? + :char-basic (choice (sequence "\\" 1) + 1) + # see "Syntax for Strings" + # XXX: escaped newline and escaped space in "Syntax for Strings"? + :string + ,(atom-node :string + '(sequence "\"" + (any (choice :escape + (if-not "\"" 1))) + "\"")) + # XXX: is this complete? + :escape (sequence "\\" (set "0abdefnrstvx\"\\")) + # see "Symbol Type" + # XXX: review about whitespace in symbol names + :symbol + ,(atom-node :symbol + '(choice (sequence :sym-char-head + (any :sym-char-rest)) + # XXX: some below not really symbols + # see "Circular Objects" + (sequence "#" :d+ "=") + (sequence "#" :d+ "#") + # see "Special Read Syntax" + #(sequence "#" :d+) + # see "Documentation Strings and Compilation" + "#$" + # see "Symbol Type" + "##")) + # + :sym-char-head (choice :sym-char-esc + # don't start with + #(if-not (set " \"#'(),.;?[]`") 1)) # allow . + (if-not (set " \"#'(),;?[]`") 1)) + # + :sym-char-rest (choice :sym-char-esc + # . and ? are allowed "inside" + (if-not (set " \"#'(),;[]`\n") 1)) + # need to be escaped + :sym-char-esc (sequence "\\" (set " \"#'(),;?[]`")) + }) + +(comment + + (get (peg/match loc-grammar " ") 2) + # => + '(:whitespace @{:bc 1 :bl 1 :ec 2 :el 1} " ") + + (get (peg/match loc-grammar "; hi there") 2) + # => + '(:comment @{:bc 1 :bl 1 :ec 11 :el 1} "; hi there") + + (get (peg/match loc-grammar "8.3") 2) + # => + '(:float @{:bc 1 :bl 1 :ec 4 :el 1} "8.3") + + (get (peg/match loc-grammar "printf") 2) + # => + '(:symbol @{:bc 1 :bl 1 :ec 7 :el 1} "printf") + + (get (peg/match loc-grammar ":smile") 2) + # => + '(:symbol @{:bc 1 :bl 1 :ec 7 :el 1} ":smile") + + (get (peg/match loc-grammar `"fun"`) 2) + # => + '(:string @{:bc 1 :bl 1 :ec 6 :el 1} "\"fun\"") + + (get (peg/match loc-grammar "[8]") 2) + # => + '(:vector @{:bc 1 :bl 1 + :ec 4 :el 1} + (:integer @{:bc 2 :bl 1 + :ec 3 :el 1} "8")) + + (get (peg/match loc-grammar "(1+ 1)") 2) + # => + '(:list @{:bc 1 :bl 1 + :ec 7 :el 1} + (:symbol @{:bc 2 :bl 1 + :ec 4 :el 1} "1+") + (:whitespace @{:bc 4 :bl 1 + :ec 5 :el 1} " ") + (:integer @{:bc 5 :bl 1 + :ec 6 :el 1} "1")) + + (get (peg/match loc-grammar "`x") 2) + # => + '(:backquote @{:bc 1 :bl 1 + :ec 3 :el 1} + (:symbol @{:bc 2 :bl 1 + :ec 3 :el 1} "x")) + + (try + (peg/match loc-grammar "(+ 1") + ([e] + e)) + # => + `line: 1 column: 5 missing ")" for :list` + + ) + diff --git a/sample_files/janet_before.janet b/sample_files/janet_before.janet new file mode 100644 index 000000000..6ae47698a --- /dev/null +++ b/sample_files/janet_before.janet @@ -0,0 +1,320 @@ +# the "GNU Emacs Lisp Reference Manual" has very useful info +# in the code below section names will be mentioned, like: +# see "Special Read Syntax" + +# bl - begin line +# bc - begin column +# el - end line +# ec - end column +(defn make-attrs + [& items] + (zipcoll [:bl :bc :el :ec] + items)) + +(defn atom-node + [node-type peg-form] + ~(cmt (capture (sequence (line) (column) + ,peg-form + (line) (column))) + ,|[node-type (make-attrs ;(slice $& 0 -2)) (last $&)])) + +(defn reader-macro-node + [node-type sigil] + ~(cmt (capture (sequence (line) (column) + ,sigil + (any :non-form) + :form + (line) (column))) + ,|[node-type (make-attrs ;(slice $& 0 2) ;(slice $& -4 -2)) + ;(slice $& 2 -4)])) + +(defn collection-node + [node-type open-delim close-delim] + ~(cmt + (capture + (sequence + (line) (column) + ,open-delim + (any :input) + (choice ,close-delim + (error + (replace (sequence (line) (column)) + ,|(string/format + "line: %p column: %p missing %p for %p" + $0 $1 close-delim node-type)))) + (line) (column))) + ,|[node-type (make-attrs ;(slice $& 0 2) ;(slice $& -4 -2)) + ;(slice $& 2 -4)])) + +(def loc-grammar + ~{:main (sequence (line) (column) + (some :input) + (line) (column)) + # + :input (choice :non-form + :form) + # + :non-form (choice :whitespace + :comment) + # + :whitespace ,(atom-node :whitespace + '(choice (some (set " \f\t\v")) + (choice "\r\n" + "\r" + "\n"))) + # :whitespace + # (cmt (capture (sequence (line) (column) + # (choice (some (set " \f\t\v")) + # (choice "\r\n" + # "\r" + # "\n")) + # (line) (column))) + # ,|[:whitespace (make-attrs ;(slice $& 0 -2)) (last $&)]) + # + :comment ,(atom-node :comment + '(sequence ";" + (any (if-not (set "\r\n") 1)))) + # + :form (choice # reader macros + :backquote + :function + :quote + :unquote-splice + :unquote + # collections + :list + :vector + :char-table + :sub-char-table + :hash-table + :record + :bytecode + :string-text-props + # atoms + # XXX: might need assertions at end of things before + # symbols. see the partial job in :integer-10 below + :float + :integer + :char + :string + :symbol) + # see "Backquote" + :backquote ,(reader-macro-node :backquote "`") + # :backquote + # (cmt (capture (sequence (line) (column) + # "`" + # (any :non-form) + # :form + # (line) (column))) + # ,|[:backquote (make-attrs ;(slice $& 0 2) ;(slice $& -4 -2)) + # ;(slice $& 2 -4)]) + # see "Anonymous Functions" + :function ,(reader-macro-node :function "#'") + # see "Quoting" + :quote ,(reader-macro-node :quote "'") + # see "Backquote" + :unquote-splice ,(reader-macro-node :unquote-splice ",@") + # see "Backquote" + :unquote ,(reader-macro-node :unquote ",") + # + # see "Cons Cell Type" + :list ,(collection-node :list "(" ")") + # :list + # (cmt + # (capture + # (sequence + # (line) (column) + # "(" + # (any :input) + # (choice ")" + # (error + # (replace (sequence (line) (column)) + # ,|(string/format + # "line: %p column: %p missing %p for %p" + # $0 $1 ")" :list)))) + # (line) (column))) + # ,|[:list (make-attrs ;(slice $& 0 2) ;(slice $& -4 -2)) + # ;(slice $& 2 -4)]) + # see "Vectors" + :vector ,(collection-node :vector "[" "]") + # see "Char-Table Type" + :char-table ,(collection-node :char-table "#^[" "]") + # see "Char-Table Type" + :sub-char-table ,(collection-node :sub-char-table "#^^[" "]") + # see "Byte-Code Objects" + :bytecode ,(collection-node :bytecode "#[" "]") + # see "Hash Tables" + :hash-table ,(collection-node :hash-table "#s(hash-table" ")") + # see "Records" + :record ,(collection-node :record "#s(" ")") + # see "Text Props and Strings" + :string-text-props + ,(collection-node :string-text-props "#(" ")") + # + # see "Float Basics" + :float ,(atom-node :float + '(choice :float-dec + :float-exp + :float-both + :float-inf + :float-nan)) + # + :float-dec (sequence (opt (choice "+" "-")) + :d* + "." + :d+) + # + :float-exp (sequence (opt (choice "+" "-")) + :d* + (choice "e" "E") + :d+) + # + :float-both (sequence (opt (choice "+" "-")) + :d* + "." + :d+ + (choice "e" "E") + :d+) + # + :float-inf (sequence (opt "-") + "1.0" + (choice "e" "E") + "+INF") + # + :float-nan (sequence (opt "-") + "0.0" + (choice "e" "E") + "+NaN") + # see "Integer Basics" + :integer ,(atom-node :integer + '(choice :integer-10 + :integer-base)) + # + :integer-10 (sequence (opt (choice "+" "-")) + :d+ + (opt ".") + # XXX: hack? + (not (set "+-"))) + # + :integer-base (sequence "#" + (choice "b" + "o" + "x" + # XXX: found in xml.el, but docs...(?) + "X" + (sequence :d+ "r")) + # XXX: docs contradict this(?), but works... + (opt (choice "+" "-")) + (some (choice :a :d))) + # see "Basic Char Syntax" + :char ,(atom-node :char + '(sequence "?" + (choice :char-octal + :char-hex + :char-uni-name + #:char-uni-val + :char-uni-val-low + :char-uni-val-up + :char-meta-octal + :char-key + :char-basic))) + # see "General Escape Syntax" + :char-octal (sequence "\\" (3 (range "07"))) + :char-hex (sequence "\\x" :h+) + :char-uni-name (sequence "\\N{" (thru "}")) + #:char-uni-val (sequence "\\N{U+" :h+ "}") + :char-uni-val-low (sequence "\\u" (4 :h)) + :char-uni-val-up (sequence "\\U" (8 :h)) + # see "Meta-Char Syntax" + :char-meta-octal (sequence "\\M-" :char-octal) + # see "Ctl-Char Syntax" + # see "Other Char Bits" + :char-key + (sequence (some (sequence "\\" + (choice (sequence (set "ACHMSs") "-") + "^"))) + # XXX: not strictly correct? + (choice :char-octal + :char-hex + :char-uni-name + #:char-uni-val + :char-uni-val-low + :char-uni-val-up + :char-meta-octal + :char-basic)) + # XXX: not strictly correct, but perhaps it's ok? + :char-basic (choice (sequence "\\" 1) + 1) + # see "Syntax for Strings" + # XXX: escaped newline and escaped space in "Syntax for Strings"? + :string + ,(atom-node :string + '(sequence "\"" + (any (choice :escape + (if-not "\"" 1))) + "\"")) + # XXX: is this complete? + :escape (sequence "\\" (set "0abdefnrstvx\"\\")) + # see "Symbol Type" + # XXX: review about whitespace in symbol names + :symbol + ,(atom-node :symbol + '(choice (sequence :sym-char-head + (any :sym-char-rest)) + # XXX: some below not really symbols + # see "Circular Objects" + (sequence "#" :d+ "=") + (sequence "#" :d+ "#") + # see "Special Read Syntax" + #(sequence "#" :d+) + # see "Documentation Strings and Compilation" + "#$" + # see "Symbol Type" + "##")) + # + :sym-char-head (choice :sym-char-esc + # don't start with + #(if-not (set " \"#'(),.;?[]`") 1)) # allow . + (if-not (set " \"#'(),;?[]`") 1)) + # + :sym-char-rest (choice :sym-char-esc + # . and ? are allowed "inside" + (if-not (set " \"#'(),;[]`\n") 1)) + # need to be escaped + :sym-char-esc (sequence "\\" (set " \"#'(),;?[]`")) + }) + +(comment + + (get (peg/match loc-grammar " ") 2) + # => + '(:whitespace @{:bc 1 :bl 1 :ec 2 :el 1} " ") + + (get (peg/match loc-grammar "8.3") 2) + # => + '(:float @{:bc 1 :bl 1 :ec 4 :el 1} "8.3") + + (get (peg/match loc-grammar "printf") 2) + # => + '(:symbol @{:bc 1 :bl 1 :ec 7 :el 1} "printf") + + (get (peg/match loc-grammar ":smile") 2) + # => + '(:symbol @{:bc 1 :bl 1 :ec 7 :el 1} ":smile") + + (get (peg/match loc-grammar "[8]") 2) + # => + '(:vector @{:bc 1 :bl 1 + :ec 4 :el 1} + (:integer @{:bc 2 :bl 1 + :ec 3 :el 1} "8")) + + (get (peg/match loc-grammar "`x") 2) + # => + '(:backquote @{:bc 1 :bl 1 + :ec 3 :el 1} + (:symbol @{:bc 2 :bl 1 + :ec 3 :el 1} "x")) + + ) + diff --git a/src/guess_language.rs b/src/guess_language.rs index f3de34bd3..8d82ba3f6 100644 --- a/src/guess_language.rs +++ b/src/guess_language.rs @@ -30,6 +30,7 @@ pub enum Language { EmacsLisp, Go, Haskell, + JanetSimple, Java, JavaScript, Json, @@ -95,6 +96,7 @@ fn from_emacs_mode_header(src: &str) -> Option { "emacs-lisp" => Some(EmacsLisp), "go" => Some(Go), "haskell" => Some(Haskell), + "janet" => Some(JanetSimple), "java" => Some(Java), "js" | "js2" => Some(JavaScript), "lisp" => Some(CommonLisp), @@ -189,6 +191,7 @@ fn from_extension(extension: &OsStr, src: &str) -> Option { "ex" | "exs" => Some(Elixir), "go" => Some(Go), "hs" => Some(Haskell), + "janet" | "jdn" => Some(JanetSimple), "java" => Some(Java), "cjs" | "js" | "mjs" => Some(JavaScript), "jsx" => Some(Jsx), diff --git a/src/tree_sitter_parser.rs b/src/tree_sitter_parser.rs index 77ac1c8f7..c6156703d 100644 --- a/src/tree_sitter_parser.rs +++ b/src/tree_sitter_parser.rs @@ -55,6 +55,7 @@ extern "C" { fn tree_sitter_elixir() -> ts::Language; fn tree_sitter_go() -> ts::Language; fn tree_sitter_haskell() -> ts::Language; + fn tree_sitter_janet_simple() -> ts::Language; fn tree_sitter_java() -> ts::Language; fn tree_sitter_javascript() -> ts::Language; fn tree_sitter_json() -> ts::Language; @@ -274,6 +275,29 @@ pub fn from_language(language: guess::Language) -> TreeSitterConfig { .unwrap(), } } + JanetSimple => { + let language = unsafe { tree_sitter_janet_simple() }; + TreeSitterConfig { + name: "Janet", + language, + atom_nodes: (vec![]).into_iter().collect(), + delimiter_tokens: (vec![ + ("@{", "}"), + ("@(", ")"), + ("@[", "]"), + ("{", "}"), + ("(", ")"), + ("[", "]"), + ]) + .into_iter() + .collect(), + highlight_query: ts::Query::new( + language, + include_str!("../vendor/highlights/janet_simple.scm"), + ) + .unwrap(), + } + } Java => { let language = unsafe { tree_sitter_java() }; TreeSitterConfig { diff --git a/vendor/highlights/janet_simple.scm b/vendor/highlights/janet_simple.scm new file mode 120000 index 000000000..8709326ff --- /dev/null +++ b/vendor/highlights/janet_simple.scm @@ -0,0 +1 @@ +../tree-sitter-janet-simple/queries/highlights.scm \ No newline at end of file diff --git a/vendor/tree-sitter-janet-simple-src b/vendor/tree-sitter-janet-simple-src new file mode 120000 index 000000000..a4fde20f2 --- /dev/null +++ b/vendor/tree-sitter-janet-simple-src @@ -0,0 +1 @@ +tree-sitter-janet-simple/src \ No newline at end of file diff --git a/vendor/tree-sitter-janet-simple/.gitignore b/vendor/tree-sitter-janet-simple/.gitignore new file mode 100644 index 000000000..3244d5a88 --- /dev/null +++ b/vendor/tree-sitter-janet-simple/.gitignore @@ -0,0 +1,4 @@ +node_modules +bin +build +*.log diff --git a/vendor/tree-sitter-janet-simple/Cargo.toml b/vendor/tree-sitter-janet-simple/Cargo.toml new file mode 100644 index 000000000..7ed04956f --- /dev/null +++ b/vendor/tree-sitter-janet-simple/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "tree-sitter-janet-simple" +description = "janet grammar for the tree-sitter parsing library" +version = "0.0.3" +keywords = ["incremental", "parsing", "janet"] +categories = ["parsing", "text-editors"] +repository = "https://github.com/sogaiu/tree-sitter-janet-simple" +edition = "2018" + +build = "bindings/rust/build.rs" +include = [ + "bindings/rust/*", + "grammar.js", + "queries/*", + "src/*", +] + +[lib] +path = "bindings/rust/lib.rs" + +[dependencies] +tree-sitter = "0.19.3" + +[build-dependencies] +cc = "1.0" diff --git a/vendor/tree-sitter-janet-simple/README.md b/vendor/tree-sitter-janet-simple/README.md new file mode 100644 index 000000000..58a564725 --- /dev/null +++ b/vendor/tree-sitter-janet-simple/README.md @@ -0,0 +1,114 @@ +# tree-sitter-janet-simple + +## Status + +Subject to change, grammar still evolving. + +Coincidentally, it appears [another effort by GrayJack](https://github.com/GrayJack/tree-sitter-janet/) was started at about the same time. + +The main difference between these two are that GrayJack's grammar supports higher level constructs (e.g. `def` is recognized by the grammar). + +There might end up being different trade-offs in either approach and my belief is that there is room in the world for multiple attempts (especially for lisp-like languages). + +## Prerequisites + +* [emsdk](https://emscripten.org/docs/getting_started/downloads.html#installation-instructions) -- emscripten via homebrew seems to work for macos +* node >= 12 (nvm recommended) -- recently tested 12.9.1, 12,16,1 + +## Fine Print + +* The instructions below assume emsdk has been installed, but `emcc` (tool that can be used to compile to wasm) is not necessarily on one's `PATH`. If an appropriate `emcc` is on one's `PATH` (e.g. emscripten installed via homebrew), the emsdk steps (e.g. `source ~/src/emsdk/emsdk_env.sh`) below may be ignored. + +* `node-gyp` (tool for compiling native addon modules for Node.js) may fail on machines upgraded to macos Catalina. [This document](https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md) may help cope with such a situation. + +## Initial Setup + +Suppose typical development sources are stored under `~/src`. + +``` +# clone repository +cd ~/src +git clone https://github.com/sogaiu/tree-sitter-janet-simple +cd tree-sitter-janet-simple + +# create / populate +# `node_modules` with dependencies +# `src` with tree-sitter .c goodness +# `build` +# `build/Release` and build `tree_sitter_janet_simple_binding.node` +npm install + +# included in previous command +#npx tree-sitter generate +#npx node-gyp configure +#npx node-gyp rebuild +``` + +## Grammar Development + +Hack on grammar and interactively test. + +``` +# prepare emsdk (specifically emcc) for building .wasm +source ~/src/emsdk/emsdk_env.sh + +# edit grammar.js using some editor + +# rebuild tree-sitter stuff and invoke web-ui for interactive testing +npx tree-sitter generate && \ +npx node-gyp rebuild && \ +npx tree-sitter build-wasm && \ +npx tree-sitter web-ui + +# in appropriate browser window, paste code in left pane + +# examine results in right pane -- can even click on nodes + +# find errors and loop back to edit step above... +``` + +Parse individual files. + +``` +# create and populate sample code file for parsing named `sample.janet` + +# parse sample file +npx tree-sitter parse sample.janet + +# examine output similar to web-ui, but less convenient +``` + +## Measure Performance + +``` +# single measurement +npx tree-sitter parse --time sample.janet + +# mutliple measurements with `multitime` +multitime -n10 -s1 npx tree-sitter parse --time --quiet sample.janet +``` + +## Build .wasm + +Assuming emsdk is installed appropriately under `~/src/emsdk`. + +``` +# prepare emsdk (specifically emcc) for use +source ~/src/emsdk/emsdk_env.sh + +# create `tree-sitter-janet-simple.wasm` +npx tree-sitter build-wasm +``` + +## Resources + +* [Guide to your first Tree-sitter grammar](https://gist.github.com/Aerijo/df27228d70c633e088b0591b8857eeef) +* [tree-sitter](http://tree-sitter.github.io/tree-sitter/) + +## Acknowledgments + +* 314eter - handling null characters +* Aerijo - Guide to your first Tree-sitter grammar +* bakpakin - janet +* GrayJack - tree-sitter-janet +* maxbrunsfeld - tree-sitter and related diff --git a/vendor/tree-sitter-janet-simple/binding.gyp b/vendor/tree-sitter-janet-simple/binding.gyp new file mode 100644 index 000000000..ea369d001 --- /dev/null +++ b/vendor/tree-sitter-janet-simple/binding.gyp @@ -0,0 +1,19 @@ +{ + "targets": [ + { + "target_name": "tree_sitter_janet_simple_binding", + "include_dirs": [ + " +#include "nan.h" + +using namespace v8; + +extern "C" TSLanguage * tree_sitter_janet_simple(); + +namespace { + +NAN_METHOD(New) {} + +void Init(Local exports, Local module) { + Local tpl = Nan::New(New); + tpl->SetClassName(Nan::New("Language").ToLocalChecked()); + tpl->InstanceTemplate()->SetInternalFieldCount(1); + + Local constructor = Nan::GetFunction(tpl).ToLocalChecked(); + Local instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked(); + Nan::SetInternalFieldPointer(instance, 0, tree_sitter_janet_simple()); + + Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("janet_simple").ToLocalChecked()); + Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance); +} + +NODE_MODULE(tree_sitter_janet_simple_binding, Init) + +} // namespace diff --git a/vendor/tree-sitter-janet-simple/bindings/node/index.js b/vendor/tree-sitter-janet-simple/bindings/node/index.js new file mode 100644 index 000000000..90eb22761 --- /dev/null +++ b/vendor/tree-sitter-janet-simple/bindings/node/index.js @@ -0,0 +1,19 @@ +try { + module.exports = require("../../build/Release/tree_sitter_janet_simple_binding"); +} catch (error1) { + if (error1.code !== 'MODULE_NOT_FOUND') { + throw error1; + } + try { + module.exports = require("../../build/Debug/tree_sitter_janet_simple_binding"); + } catch (error2) { + if (error2.code !== 'MODULE_NOT_FOUND') { + throw error2; + } + throw error1 + } +} + +try { + module.exports.nodeTypeInfo = require("../../src/node-types.json"); +} catch (_) {} diff --git a/vendor/tree-sitter-janet-simple/bindings/rust/build.rs b/vendor/tree-sitter-janet-simple/bindings/rust/build.rs new file mode 100644 index 000000000..f7aaf1661 --- /dev/null +++ b/vendor/tree-sitter-janet-simple/bindings/rust/build.rs @@ -0,0 +1,38 @@ +fn main() { + let src_dir = std::path::Path::new("src"); + + let mut c_config = cc::Build::new(); + c_config.include(&src_dir); + c_config + .flag_if_supported("-Wno-unused-parameter") + .flag_if_supported("-Wno-unused-but-set-variable") + .flag_if_supported("-Wno-trigraphs"); + let parser_path = src_dir.join("parser.c"); + c_config.file(&parser_path); + + // If your language uses an external scanner written in C, + // then include this block of code: + + let scanner_path = src_dir.join("scanner.c"); + c_config.file(&scanner_path); + println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap()); + + c_config.compile("parser"); + println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap()); + + // If your language uses an external scanner written in C++, + // then include this block of code: + + /* + let mut cpp_config = cc::Build::new(); + cpp_config.cpp(true); + cpp_config.include(&src_dir); + cpp_config + .flag_if_supported("-Wno-unused-parameter") + .flag_if_supported("-Wno-unused-but-set-variable"); + let scanner_path = src_dir.join("scanner.cc"); + cpp_config.file(&scanner_path); + cpp_config.compile("scanner"); + println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap()); + */ +} diff --git a/vendor/tree-sitter-janet-simple/bindings/rust/lib.rs b/vendor/tree-sitter-janet-simple/bindings/rust/lib.rs new file mode 100644 index 000000000..44911fc39 --- /dev/null +++ b/vendor/tree-sitter-janet-simple/bindings/rust/lib.rs @@ -0,0 +1,52 @@ +//! This crate provides janet_simple language support for the [tree-sitter][] parsing library. +//! +//! Typically, you will use the [language][language func] function to add this language to a +//! tree-sitter [Parser][], and then use the parser to parse some code: +//! +//! ``` +//! let code = ""; +//! let mut parser = tree_sitter::Parser::new(); +//! parser.set_language(tree_sitter_janet_simple::language()).expect("Error loading janet_simple grammar"); +//! let tree = parser.parse(code, None).unwrap(); +//! ``` +//! +//! [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html +//! [language func]: fn.language.html +//! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html +//! [tree-sitter]: https://tree-sitter.github.io/ + +use tree_sitter::Language; + +extern "C" { + fn tree_sitter_janet_simple() -> Language; +} + +/// Get the tree-sitter [Language][] for this grammar. +/// +/// [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html +pub fn language() -> Language { + unsafe { tree_sitter_janet_simple() } +} + +/// The content of the [`node-types.json`][] file for this grammar. +/// +/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types +pub const NODE_TYPES: &'static str = include_str!("../../src/node-types.json"); + +// Uncomment these to include any queries that this grammar contains + +// pub const HIGHLIGHTS_QUERY: &'static str = include_str!("../../queries/highlights.scm"); +// pub const INJECTIONS_QUERY: &'static str = include_str!("../../queries/injections.scm"); +// pub const LOCALS_QUERY: &'static str = include_str!("../../queries/locals.scm"); +// pub const TAGS_QUERY: &'static str = include_str!("../../queries/tags.scm"); + +#[cfg(test)] +mod tests { + #[test] + fn test_can_load_grammar() { + let mut parser = tree_sitter::Parser::new(); + parser + .set_language(super::language()) + .expect("Error loading janet_simple language"); + } +} diff --git a/vendor/tree-sitter-janet-simple/grammar.js b/vendor/tree-sitter-janet-simple/grammar.js new file mode 100644 index 000000000..b8cfdfc9c --- /dev/null +++ b/vendor/tree-sitter-janet-simple/grammar.js @@ -0,0 +1,228 @@ +// numbers +const SIGN = + choice('-', '+'); +const DIGIT = + /[0-9]/; +const HEX_DIGIT = + /[0-9A-Fa-f]/; +const RADIX = + choice('2', '3', '4', '5', '6', '7', '8', '9', '10', + '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', + '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', + '31', '32', '33', '34', '35', '36'); +const ALPHA_NUM = + /[a-zA-Z0-9]/; + +// symbols and keywords +// janet/tools/symcharsgen.c +const SYM_CHAR_NO_DIGIT_NO_COLON = + /[a-zA-Z!$%&*+\-./@^_]/; +const SYM_CHAR = + /[0-9:a-zA-Z!$%&*+\-./@^_]/; + +// strings +const STRING_DOUBLE_QUOTE_CONTENT = + repeat(choice(/[^\\"]/, + /\\(.|\n)/)); // thanks to tree-sitter-haskell + +module.exports = grammar({ + name: 'janet_simple', + + // mdn says \s is: + // + // [ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff] + // + // but that doesn't seem to match what tree-sitter thinks as it appears that + // for example, leaving out \x0b, \x0c, or \x00 from the following yields + // different behavior (other stuff may also differ) + extras: $ => [ + /\s|\x0b|\x0c|\x00/, + $.comment + ], + + externals: $ => [ + $.long_buf_lit, + $.long_str_lit + ], + + rules: { + // THIS MUST BE FIRST -- even though this doesn't look like it matters + source: $ => + repeat($._lit), + + comment: $ => + /#.*/, + + _lit: $ => + choice($.bool_lit, + $.buf_lit, + $.kwd_lit, + $.long_buf_lit, + $.long_str_lit, + $.nil_lit, + $.num_lit, + $.str_lit, + $.sym_lit, + // + $.par_arr_lit, + $.sqr_arr_lit, + $.struct_lit, + $.tbl_lit, + $.par_tup_lit, + $.sqr_tup_lit, + // + $.qq_lit, + $.quote_lit, + $.short_fn_lit, + $.splice_lit, + $.unquote_lit), + + // simplest things + + bool_lit: $ => + // XXX: without the token here, false and true are exposed as + // anonymous nodes it seems... + // yet, the same does not happen for nil...strange + token(choice('false', + 'true')), + + kwd_lit: $ => + prec(2, token(seq(':', + repeat(SYM_CHAR)))), + + nil_lit: $ => + 'nil', + + num_lit: $ => + prec(5, choice($._dec, + $._hex, + $._radix)), + + _dec: $ => + token(seq(optional(SIGN), + choice(seq(repeat1(DIGIT), + repeat('_'), + optional('.'), + repeat('_'), + repeat(DIGIT), + repeat('_')), + seq(repeat(DIGIT), + repeat('_'), + optional('.'), + repeat('_'), + repeat1(DIGIT), + repeat('_'))), + optional(seq(choice('e', 'E'), + optional(SIGN), + repeat1(DIGIT))))), + + _hex: $ => + token(seq(optional(SIGN), + '0', + 'x', + choice(seq(repeat1(HEX_DIGIT), + repeat('_'), + optional('.'), + repeat('_'), + repeat(HEX_DIGIT), + repeat('_')), + seq(repeat(HEX_DIGIT), + repeat('_'), + optional('.'), + repeat('_'), + repeat1(HEX_DIGIT), + repeat('_'))))), + + _radix: $ => + token(seq(optional(SIGN), + seq(RADIX, + choice('r', 'R'), + ALPHA_NUM, + repeat(choice(repeat(ALPHA_NUM), + repeat('_'))), + optional(seq('&', + optional(SIGN), + repeat1(DIGIT)))))), + + str_lit: $ => + token(seq('"', + STRING_DOUBLE_QUOTE_CONTENT, + '"')), + + buf_lit: $ => + token(seq('@"', + STRING_DOUBLE_QUOTE_CONTENT, + '"')), + + sym_lit: $ => + token(seq(SYM_CHAR_NO_DIGIT_NO_COLON, + repeat(SYM_CHAR))), + + // collection-ish things + + par_arr_lit: $ => + seq('@(', + repeat($._lit), + ')'), + + sqr_arr_lit: $ => + seq('@[', + repeat($._lit), + ']'), + + struct_lit: $ => + seq('{', + repeat($._lit), + '}'), + + tbl_lit: $ => + seq('@{', + repeat($._lit), + '}'), + + par_tup_lit: $ => + seq('(', + repeat($._lit), + ')'), + + sqr_tup_lit: $ => + seq('[', + repeat($._lit), + ']'), + + // macro-related + + qq_lit: $ => + seq('~', + $._lit), + + quote_lit: $ => + seq("'", + $._lit), + + // following all work at the repl.. + // |8, ||8, |||8, etc. + // |~(:x) + // |{:a 1} + // |[1 2] + // |"a" + // |:w + // |a-sym + // |@[8 9] + // |(= $ 1) + // XXX: |() doesn't work...but don't bother disallowing + short_fn_lit: $ => + seq('|', + $._lit), + + // XXX: ? + splice_lit: $ => + seq(';', + $._lit), + + unquote_lit: $ => + seq(',', + $._lit), + + } +}); diff --git a/vendor/tree-sitter-janet-simple/package-lock.json b/vendor/tree-sitter-janet-simple/package-lock.json new file mode 100644 index 000000000..1027fb333 --- /dev/null +++ b/vendor/tree-sitter-janet-simple/package-lock.json @@ -0,0 +1,19 @@ +{ + "name": "tree-sitter-janet-simple", + "version": "0.0.3", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" + }, + "tree-sitter-cli": { + "version": "0.19.3", + "resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.19.3.tgz", + "integrity": "sha512-UlntGxLrlkQCKVrhm7guzfi+ovM4wDLVCCu3z5jmfDgFNoUoKa/23ddaQON5afD5jB9a02xv4N5MXJfCx+/mpw==", + "dev": true + } + } +} diff --git a/vendor/tree-sitter-janet-simple/package.json b/vendor/tree-sitter-janet-simple/package.json new file mode 100644 index 000000000..d07e223a9 --- /dev/null +++ b/vendor/tree-sitter-janet-simple/package.json @@ -0,0 +1,27 @@ +{ + "name": "tree-sitter-janet-simple", + "version": "0.0.3", + "description": "Janet grammar for tree-sitter", + "main": "bindings/node", + "scripts": { + "build": "npx tree-sitter generate && npx node-gyp build", + "fresh-build": "npx tree-sitter generate && npx node-gyp configure && npx node-gyp rebuild", + "install": "npx tree-sitter generate && npx node-gyp configure && npx node-gyp rebuild" + }, + "author": "", + "license": "", + "dependencies": { + "nan": "2.14.2" + }, + "devDependencies": { + "tree-sitter-cli": "0.19.3" + }, + "tree-sitter": [ + { + "scope": "source.janet", + "file-types": [ + "janet" + ] + } + ] +} diff --git a/vendor/tree-sitter-janet-simple/queries/highlights.scm b/vendor/tree-sitter-janet-simple/queries/highlights.scm new file mode 100644 index 000000000..c96c1c20b --- /dev/null +++ b/vendor/tree-sitter-janet-simple/queries/highlights.scm @@ -0,0 +1,25 @@ +(num_lit) @number + +[ + (buf_lit) + (long_buf_lit) + (long_str_lit) + (str_lit) +] @string + +[ + (bool_lit) + (nil_lit) +] @constant.builtin + +(kwd_lit) @constant + +(comment) @comment + +;; Treat quasiquotation as operators for the purpose of highlighting. + +[ + "'" + "~" + "," +] @operator diff --git a/vendor/tree-sitter-janet-simple/src/grammar.json b/vendor/tree-sitter-janet-simple/src/grammar.json new file mode 100644 index 000000000..16e3b04d6 --- /dev/null +++ b/vendor/tree-sitter-janet-simple/src/grammar.json @@ -0,0 +1,1059 @@ +{ + "name": "janet_simple", + "rules": { + "source": { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_lit" + } + }, + "comment": { + "type": "PATTERN", + "value": "#.*" + }, + "_lit": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "bool_lit" + }, + { + "type": "SYMBOL", + "name": "buf_lit" + }, + { + "type": "SYMBOL", + "name": "kwd_lit" + }, + { + "type": "SYMBOL", + "name": "long_buf_lit" + }, + { + "type": "SYMBOL", + "name": "long_str_lit" + }, + { + "type": "SYMBOL", + "name": "nil_lit" + }, + { + "type": "SYMBOL", + "name": "num_lit" + }, + { + "type": "SYMBOL", + "name": "str_lit" + }, + { + "type": "SYMBOL", + "name": "sym_lit" + }, + { + "type": "SYMBOL", + "name": "par_arr_lit" + }, + { + "type": "SYMBOL", + "name": "sqr_arr_lit" + }, + { + "type": "SYMBOL", + "name": "struct_lit" + }, + { + "type": "SYMBOL", + "name": "tbl_lit" + }, + { + "type": "SYMBOL", + "name": "par_tup_lit" + }, + { + "type": "SYMBOL", + "name": "sqr_tup_lit" + }, + { + "type": "SYMBOL", + "name": "qq_lit" + }, + { + "type": "SYMBOL", + "name": "quote_lit" + }, + { + "type": "SYMBOL", + "name": "short_fn_lit" + }, + { + "type": "SYMBOL", + "name": "splice_lit" + }, + { + "type": "SYMBOL", + "name": "unquote_lit" + } + ] + }, + "bool_lit": { + "type": "TOKEN", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "false" + }, + { + "type": "STRING", + "value": "true" + } + ] + } + }, + "kwd_lit": { + "type": "PREC", + "value": 2, + "content": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": ":" + }, + { + "type": "REPEAT", + "content": { + "type": "PATTERN", + "value": "[0-9:a-zA-Z!$%&*+\\-./@^_]" + } + } + ] + } + } + }, + "nil_lit": { + "type": "STRING", + "value": "nil" + }, + "num_lit": { + "type": "PREC", + "value": 5, + "content": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "_dec" + }, + { + "type": "SYMBOL", + "name": "_hex" + }, + { + "type": "SYMBOL", + "name": "_radix" + } + ] + } + }, + "_dec": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "-" + }, + { + "type": "STRING", + "value": "+" + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "REPEAT1", + "content": { + "type": "PATTERN", + "value": "[0-9]" + } + }, + { + "type": "REPEAT", + "content": { + "type": "STRING", + "value": "_" + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "." + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "REPEAT", + "content": { + "type": "STRING", + "value": "_" + } + }, + { + "type": "REPEAT", + "content": { + "type": "PATTERN", + "value": "[0-9]" + } + }, + { + "type": "REPEAT", + "content": { + "type": "STRING", + "value": "_" + } + } + ] + }, + { + "type": "SEQ", + "members": [ + { + "type": "REPEAT", + "content": { + "type": "PATTERN", + "value": "[0-9]" + } + }, + { + "type": "REPEAT", + "content": { + "type": "STRING", + "value": "_" + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "." + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "REPEAT", + "content": { + "type": "STRING", + "value": "_" + } + }, + { + "type": "REPEAT1", + "content": { + "type": "PATTERN", + "value": "[0-9]" + } + }, + { + "type": "REPEAT", + "content": { + "type": "STRING", + "value": "_" + } + } + ] + } + ] + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "e" + }, + { + "type": "STRING", + "value": "E" + } + ] + }, + { + "type": "CHOICE", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "-" + }, + { + "type": "STRING", + "value": "+" + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "REPEAT1", + "content": { + "type": "PATTERN", + "value": "[0-9]" + } + } + ] + }, + { + "type": "BLANK" + } + ] + } + ] + } + }, + "_hex": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "-" + }, + { + "type": "STRING", + "value": "+" + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "0" + }, + { + "type": "STRING", + "value": "x" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "REPEAT1", + "content": { + "type": "PATTERN", + "value": "[0-9A-Fa-f]" + } + }, + { + "type": "REPEAT", + "content": { + "type": "STRING", + "value": "_" + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "." + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "REPEAT", + "content": { + "type": "STRING", + "value": "_" + } + }, + { + "type": "REPEAT", + "content": { + "type": "PATTERN", + "value": "[0-9A-Fa-f]" + } + }, + { + "type": "REPEAT", + "content": { + "type": "STRING", + "value": "_" + } + } + ] + }, + { + "type": "SEQ", + "members": [ + { + "type": "REPEAT", + "content": { + "type": "PATTERN", + "value": "[0-9A-Fa-f]" + } + }, + { + "type": "REPEAT", + "content": { + "type": "STRING", + "value": "_" + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "." + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "REPEAT", + "content": { + "type": "STRING", + "value": "_" + } + }, + { + "type": "REPEAT1", + "content": { + "type": "PATTERN", + "value": "[0-9A-Fa-f]" + } + }, + { + "type": "REPEAT", + "content": { + "type": "STRING", + "value": "_" + } + } + ] + } + ] + } + ] + } + }, + "_radix": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "-" + }, + { + "type": "STRING", + "value": "+" + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "SEQ", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "2" + }, + { + "type": "STRING", + "value": "3" + }, + { + "type": "STRING", + "value": "4" + }, + { + "type": "STRING", + "value": "5" + }, + { + "type": "STRING", + "value": "6" + }, + { + "type": "STRING", + "value": "7" + }, + { + "type": "STRING", + "value": "8" + }, + { + "type": "STRING", + "value": "9" + }, + { + "type": "STRING", + "value": "10" + }, + { + "type": "STRING", + "value": "11" + }, + { + "type": "STRING", + "value": "12" + }, + { + "type": "STRING", + "value": "13" + }, + { + "type": "STRING", + "value": "14" + }, + { + "type": "STRING", + "value": "15" + }, + { + "type": "STRING", + "value": "16" + }, + { + "type": "STRING", + "value": "17" + }, + { + "type": "STRING", + "value": "18" + }, + { + "type": "STRING", + "value": "19" + }, + { + "type": "STRING", + "value": "20" + }, + { + "type": "STRING", + "value": "21" + }, + { + "type": "STRING", + "value": "22" + }, + { + "type": "STRING", + "value": "23" + }, + { + "type": "STRING", + "value": "24" + }, + { + "type": "STRING", + "value": "25" + }, + { + "type": "STRING", + "value": "26" + }, + { + "type": "STRING", + "value": "27" + }, + { + "type": "STRING", + "value": "28" + }, + { + "type": "STRING", + "value": "29" + }, + { + "type": "STRING", + "value": "30" + }, + { + "type": "STRING", + "value": "31" + }, + { + "type": "STRING", + "value": "32" + }, + { + "type": "STRING", + "value": "33" + }, + { + "type": "STRING", + "value": "34" + }, + { + "type": "STRING", + "value": "35" + }, + { + "type": "STRING", + "value": "36" + } + ] + }, + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "r" + }, + { + "type": "STRING", + "value": "R" + } + ] + }, + { + "type": "PATTERN", + "value": "[a-zA-Z0-9]" + }, + { + "type": "REPEAT", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "REPEAT", + "content": { + "type": "PATTERN", + "value": "[a-zA-Z0-9]" + } + }, + { + "type": "REPEAT", + "content": { + "type": "STRING", + "value": "_" + } + } + ] + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "&" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "-" + }, + { + "type": "STRING", + "value": "+" + } + ] + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "REPEAT1", + "content": { + "type": "PATTERN", + "value": "[0-9]" + } + } + ] + }, + { + "type": "BLANK" + } + ] + } + ] + } + ] + } + }, + "str_lit": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "\"" + }, + { + "type": "REPEAT", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "PATTERN", + "value": "[^\\\\\"]" + }, + { + "type": "PATTERN", + "value": "\\\\(.|\\n)" + } + ] + } + }, + { + "type": "STRING", + "value": "\"" + } + ] + } + }, + "buf_lit": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "@\"" + }, + { + "type": "REPEAT", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "PATTERN", + "value": "[^\\\\\"]" + }, + { + "type": "PATTERN", + "value": "\\\\(.|\\n)" + } + ] + } + }, + { + "type": "STRING", + "value": "\"" + } + ] + } + }, + "sym_lit": { + "type": "TOKEN", + "content": { + "type": "SEQ", + "members": [ + { + "type": "PATTERN", + "value": "[a-zA-Z!$%&*+\\-./@^_]" + }, + { + "type": "REPEAT", + "content": { + "type": "PATTERN", + "value": "[0-9:a-zA-Z!$%&*+\\-./@^_]" + } + } + ] + } + }, + "par_arr_lit": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "@(" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_lit" + } + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + "sqr_arr_lit": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "@[" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_lit" + } + }, + { + "type": "STRING", + "value": "]" + } + ] + }, + "struct_lit": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_lit" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "tbl_lit": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "@{" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_lit" + } + }, + { + "type": "STRING", + "value": "}" + } + ] + }, + "par_tup_lit": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "(" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_lit" + } + }, + { + "type": "STRING", + "value": ")" + } + ] + }, + "sqr_tup_lit": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "[" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_lit" + } + }, + { + "type": "STRING", + "value": "]" + } + ] + }, + "qq_lit": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "~" + }, + { + "type": "SYMBOL", + "name": "_lit" + } + ] + }, + "quote_lit": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "'" + }, + { + "type": "SYMBOL", + "name": "_lit" + } + ] + }, + "short_fn_lit": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "|" + }, + { + "type": "SYMBOL", + "name": "_lit" + } + ] + }, + "splice_lit": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": ";" + }, + { + "type": "SYMBOL", + "name": "_lit" + } + ] + }, + "unquote_lit": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "_lit" + } + ] + } + }, + "extras": [ + { + "type": "PATTERN", + "value": "\\s|\\x0b|\\x0c|\\x00" + }, + { + "type": "SYMBOL", + "name": "comment" + } + ], + "conflicts": [], + "precedences": [], + "externals": [ + { + "type": "SYMBOL", + "name": "long_buf_lit" + }, + { + "type": "SYMBOL", + "name": "long_str_lit" + } + ], + "inline": [], + "supertypes": [] +} + diff --git a/vendor/tree-sitter-janet-simple/src/node-types.json b/vendor/tree-sitter-janet-simple/src/node-types.json new file mode 100644 index 000000000..4bd1d4020 --- /dev/null +++ b/vendor/tree-sitter-janet-simple/src/node-types.json @@ -0,0 +1,1192 @@ +[ + { + "type": "kwd_lit", + "named": true, + "fields": {} + }, + { + "type": "num_lit", + "named": true, + "fields": {} + }, + { + "type": "par_arr_lit", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "bool_lit", + "named": true + }, + { + "type": "buf_lit", + "named": true + }, + { + "type": "kwd_lit", + "named": true + }, + { + "type": "long_buf_lit", + "named": true + }, + { + "type": "long_str_lit", + "named": true + }, + { + "type": "nil_lit", + "named": true + }, + { + "type": "num_lit", + "named": true + }, + { + "type": "par_arr_lit", + "named": true + }, + { + "type": "par_tup_lit", + "named": true + }, + { + "type": "qq_lit", + "named": true + }, + { + "type": "quote_lit", + "named": true + }, + { + "type": "short_fn_lit", + "named": true + }, + { + "type": "splice_lit", + "named": true + }, + { + "type": "sqr_arr_lit", + "named": true + }, + { + "type": "sqr_tup_lit", + "named": true + }, + { + "type": "str_lit", + "named": true + }, + { + "type": "struct_lit", + "named": true + }, + { + "type": "sym_lit", + "named": true + }, + { + "type": "tbl_lit", + "named": true + }, + { + "type": "unquote_lit", + "named": true + } + ] + } + }, + { + "type": "par_tup_lit", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "bool_lit", + "named": true + }, + { + "type": "buf_lit", + "named": true + }, + { + "type": "kwd_lit", + "named": true + }, + { + "type": "long_buf_lit", + "named": true + }, + { + "type": "long_str_lit", + "named": true + }, + { + "type": "nil_lit", + "named": true + }, + { + "type": "num_lit", + "named": true + }, + { + "type": "par_arr_lit", + "named": true + }, + { + "type": "par_tup_lit", + "named": true + }, + { + "type": "qq_lit", + "named": true + }, + { + "type": "quote_lit", + "named": true + }, + { + "type": "short_fn_lit", + "named": true + }, + { + "type": "splice_lit", + "named": true + }, + { + "type": "sqr_arr_lit", + "named": true + }, + { + "type": "sqr_tup_lit", + "named": true + }, + { + "type": "str_lit", + "named": true + }, + { + "type": "struct_lit", + "named": true + }, + { + "type": "sym_lit", + "named": true + }, + { + "type": "tbl_lit", + "named": true + }, + { + "type": "unquote_lit", + "named": true + } + ] + } + }, + { + "type": "qq_lit", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "bool_lit", + "named": true + }, + { + "type": "buf_lit", + "named": true + }, + { + "type": "kwd_lit", + "named": true + }, + { + "type": "long_buf_lit", + "named": true + }, + { + "type": "long_str_lit", + "named": true + }, + { + "type": "nil_lit", + "named": true + }, + { + "type": "num_lit", + "named": true + }, + { + "type": "par_arr_lit", + "named": true + }, + { + "type": "par_tup_lit", + "named": true + }, + { + "type": "qq_lit", + "named": true + }, + { + "type": "quote_lit", + "named": true + }, + { + "type": "short_fn_lit", + "named": true + }, + { + "type": "splice_lit", + "named": true + }, + { + "type": "sqr_arr_lit", + "named": true + }, + { + "type": "sqr_tup_lit", + "named": true + }, + { + "type": "str_lit", + "named": true + }, + { + "type": "struct_lit", + "named": true + }, + { + "type": "sym_lit", + "named": true + }, + { + "type": "tbl_lit", + "named": true + }, + { + "type": "unquote_lit", + "named": true + } + ] + } + }, + { + "type": "quote_lit", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "bool_lit", + "named": true + }, + { + "type": "buf_lit", + "named": true + }, + { + "type": "kwd_lit", + "named": true + }, + { + "type": "long_buf_lit", + "named": true + }, + { + "type": "long_str_lit", + "named": true + }, + { + "type": "nil_lit", + "named": true + }, + { + "type": "num_lit", + "named": true + }, + { + "type": "par_arr_lit", + "named": true + }, + { + "type": "par_tup_lit", + "named": true + }, + { + "type": "qq_lit", + "named": true + }, + { + "type": "quote_lit", + "named": true + }, + { + "type": "short_fn_lit", + "named": true + }, + { + "type": "splice_lit", + "named": true + }, + { + "type": "sqr_arr_lit", + "named": true + }, + { + "type": "sqr_tup_lit", + "named": true + }, + { + "type": "str_lit", + "named": true + }, + { + "type": "struct_lit", + "named": true + }, + { + "type": "sym_lit", + "named": true + }, + { + "type": "tbl_lit", + "named": true + }, + { + "type": "unquote_lit", + "named": true + } + ] + } + }, + { + "type": "short_fn_lit", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "bool_lit", + "named": true + }, + { + "type": "buf_lit", + "named": true + }, + { + "type": "kwd_lit", + "named": true + }, + { + "type": "long_buf_lit", + "named": true + }, + { + "type": "long_str_lit", + "named": true + }, + { + "type": "nil_lit", + "named": true + }, + { + "type": "num_lit", + "named": true + }, + { + "type": "par_arr_lit", + "named": true + }, + { + "type": "par_tup_lit", + "named": true + }, + { + "type": "qq_lit", + "named": true + }, + { + "type": "quote_lit", + "named": true + }, + { + "type": "short_fn_lit", + "named": true + }, + { + "type": "splice_lit", + "named": true + }, + { + "type": "sqr_arr_lit", + "named": true + }, + { + "type": "sqr_tup_lit", + "named": true + }, + { + "type": "str_lit", + "named": true + }, + { + "type": "struct_lit", + "named": true + }, + { + "type": "sym_lit", + "named": true + }, + { + "type": "tbl_lit", + "named": true + }, + { + "type": "unquote_lit", + "named": true + } + ] + } + }, + { + "type": "source", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "bool_lit", + "named": true + }, + { + "type": "buf_lit", + "named": true + }, + { + "type": "kwd_lit", + "named": true + }, + { + "type": "long_buf_lit", + "named": true + }, + { + "type": "long_str_lit", + "named": true + }, + { + "type": "nil_lit", + "named": true + }, + { + "type": "num_lit", + "named": true + }, + { + "type": "par_arr_lit", + "named": true + }, + { + "type": "par_tup_lit", + "named": true + }, + { + "type": "qq_lit", + "named": true + }, + { + "type": "quote_lit", + "named": true + }, + { + "type": "short_fn_lit", + "named": true + }, + { + "type": "splice_lit", + "named": true + }, + { + "type": "sqr_arr_lit", + "named": true + }, + { + "type": "sqr_tup_lit", + "named": true + }, + { + "type": "str_lit", + "named": true + }, + { + "type": "struct_lit", + "named": true + }, + { + "type": "sym_lit", + "named": true + }, + { + "type": "tbl_lit", + "named": true + }, + { + "type": "unquote_lit", + "named": true + } + ] + } + }, + { + "type": "splice_lit", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "bool_lit", + "named": true + }, + { + "type": "buf_lit", + "named": true + }, + { + "type": "kwd_lit", + "named": true + }, + { + "type": "long_buf_lit", + "named": true + }, + { + "type": "long_str_lit", + "named": true + }, + { + "type": "nil_lit", + "named": true + }, + { + "type": "num_lit", + "named": true + }, + { + "type": "par_arr_lit", + "named": true + }, + { + "type": "par_tup_lit", + "named": true + }, + { + "type": "qq_lit", + "named": true + }, + { + "type": "quote_lit", + "named": true + }, + { + "type": "short_fn_lit", + "named": true + }, + { + "type": "splice_lit", + "named": true + }, + { + "type": "sqr_arr_lit", + "named": true + }, + { + "type": "sqr_tup_lit", + "named": true + }, + { + "type": "str_lit", + "named": true + }, + { + "type": "struct_lit", + "named": true + }, + { + "type": "sym_lit", + "named": true + }, + { + "type": "tbl_lit", + "named": true + }, + { + "type": "unquote_lit", + "named": true + } + ] + } + }, + { + "type": "sqr_arr_lit", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "bool_lit", + "named": true + }, + { + "type": "buf_lit", + "named": true + }, + { + "type": "kwd_lit", + "named": true + }, + { + "type": "long_buf_lit", + "named": true + }, + { + "type": "long_str_lit", + "named": true + }, + { + "type": "nil_lit", + "named": true + }, + { + "type": "num_lit", + "named": true + }, + { + "type": "par_arr_lit", + "named": true + }, + { + "type": "par_tup_lit", + "named": true + }, + { + "type": "qq_lit", + "named": true + }, + { + "type": "quote_lit", + "named": true + }, + { + "type": "short_fn_lit", + "named": true + }, + { + "type": "splice_lit", + "named": true + }, + { + "type": "sqr_arr_lit", + "named": true + }, + { + "type": "sqr_tup_lit", + "named": true + }, + { + "type": "str_lit", + "named": true + }, + { + "type": "struct_lit", + "named": true + }, + { + "type": "sym_lit", + "named": true + }, + { + "type": "tbl_lit", + "named": true + }, + { + "type": "unquote_lit", + "named": true + } + ] + } + }, + { + "type": "sqr_tup_lit", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "bool_lit", + "named": true + }, + { + "type": "buf_lit", + "named": true + }, + { + "type": "kwd_lit", + "named": true + }, + { + "type": "long_buf_lit", + "named": true + }, + { + "type": "long_str_lit", + "named": true + }, + { + "type": "nil_lit", + "named": true + }, + { + "type": "num_lit", + "named": true + }, + { + "type": "par_arr_lit", + "named": true + }, + { + "type": "par_tup_lit", + "named": true + }, + { + "type": "qq_lit", + "named": true + }, + { + "type": "quote_lit", + "named": true + }, + { + "type": "short_fn_lit", + "named": true + }, + { + "type": "splice_lit", + "named": true + }, + { + "type": "sqr_arr_lit", + "named": true + }, + { + "type": "sqr_tup_lit", + "named": true + }, + { + "type": "str_lit", + "named": true + }, + { + "type": "struct_lit", + "named": true + }, + { + "type": "sym_lit", + "named": true + }, + { + "type": "tbl_lit", + "named": true + }, + { + "type": "unquote_lit", + "named": true + } + ] + } + }, + { + "type": "struct_lit", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "bool_lit", + "named": true + }, + { + "type": "buf_lit", + "named": true + }, + { + "type": "kwd_lit", + "named": true + }, + { + "type": "long_buf_lit", + "named": true + }, + { + "type": "long_str_lit", + "named": true + }, + { + "type": "nil_lit", + "named": true + }, + { + "type": "num_lit", + "named": true + }, + { + "type": "par_arr_lit", + "named": true + }, + { + "type": "par_tup_lit", + "named": true + }, + { + "type": "qq_lit", + "named": true + }, + { + "type": "quote_lit", + "named": true + }, + { + "type": "short_fn_lit", + "named": true + }, + { + "type": "splice_lit", + "named": true + }, + { + "type": "sqr_arr_lit", + "named": true + }, + { + "type": "sqr_tup_lit", + "named": true + }, + { + "type": "str_lit", + "named": true + }, + { + "type": "struct_lit", + "named": true + }, + { + "type": "sym_lit", + "named": true + }, + { + "type": "tbl_lit", + "named": true + }, + { + "type": "unquote_lit", + "named": true + } + ] + } + }, + { + "type": "tbl_lit", + "named": true, + "fields": {}, + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "bool_lit", + "named": true + }, + { + "type": "buf_lit", + "named": true + }, + { + "type": "kwd_lit", + "named": true + }, + { + "type": "long_buf_lit", + "named": true + }, + { + "type": "long_str_lit", + "named": true + }, + { + "type": "nil_lit", + "named": true + }, + { + "type": "num_lit", + "named": true + }, + { + "type": "par_arr_lit", + "named": true + }, + { + "type": "par_tup_lit", + "named": true + }, + { + "type": "qq_lit", + "named": true + }, + { + "type": "quote_lit", + "named": true + }, + { + "type": "short_fn_lit", + "named": true + }, + { + "type": "splice_lit", + "named": true + }, + { + "type": "sqr_arr_lit", + "named": true + }, + { + "type": "sqr_tup_lit", + "named": true + }, + { + "type": "str_lit", + "named": true + }, + { + "type": "struct_lit", + "named": true + }, + { + "type": "sym_lit", + "named": true + }, + { + "type": "tbl_lit", + "named": true + }, + { + "type": "unquote_lit", + "named": true + } + ] + } + }, + { + "type": "unquote_lit", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": true, + "types": [ + { + "type": "bool_lit", + "named": true + }, + { + "type": "buf_lit", + "named": true + }, + { + "type": "kwd_lit", + "named": true + }, + { + "type": "long_buf_lit", + "named": true + }, + { + "type": "long_str_lit", + "named": true + }, + { + "type": "nil_lit", + "named": true + }, + { + "type": "num_lit", + "named": true + }, + { + "type": "par_arr_lit", + "named": true + }, + { + "type": "par_tup_lit", + "named": true + }, + { + "type": "qq_lit", + "named": true + }, + { + "type": "quote_lit", + "named": true + }, + { + "type": "short_fn_lit", + "named": true + }, + { + "type": "splice_lit", + "named": true + }, + { + "type": "sqr_arr_lit", + "named": true + }, + { + "type": "sqr_tup_lit", + "named": true + }, + { + "type": "str_lit", + "named": true + }, + { + "type": "struct_lit", + "named": true + }, + { + "type": "sym_lit", + "named": true + }, + { + "type": "tbl_lit", + "named": true + }, + { + "type": "unquote_lit", + "named": true + } + ] + } + }, + { + "type": "'", + "named": false + }, + { + "type": "(", + "named": false + }, + { + "type": ")", + "named": false + }, + { + "type": ",", + "named": false + }, + { + "type": ";", + "named": false + }, + { + "type": "@(", + "named": false + }, + { + "type": "@[", + "named": false + }, + { + "type": "@{", + "named": false + }, + { + "type": "[", + "named": false + }, + { + "type": "]", + "named": false + }, + { + "type": "bool_lit", + "named": true + }, + { + "type": "buf_lit", + "named": true + }, + { + "type": "comment", + "named": true + }, + { + "type": "long_buf_lit", + "named": true + }, + { + "type": "long_str_lit", + "named": true + }, + { + "type": "nil_lit", + "named": true + }, + { + "type": "str_lit", + "named": true + }, + { + "type": "sym_lit", + "named": true + }, + { + "type": "{", + "named": false + }, + { + "type": "|", + "named": false + }, + { + "type": "}", + "named": false + }, + { + "type": "~", + "named": false + } +] \ No newline at end of file diff --git a/vendor/tree-sitter-janet-simple/src/parser.c b/vendor/tree-sitter-janet-simple/src/parser.c new file mode 100644 index 000000000..e4c981990 --- /dev/null +++ b/vendor/tree-sitter-janet-simple/src/parser.c @@ -0,0 +1,2875 @@ +#include + +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif + +#define LANGUAGE_VERSION 13 +#define STATE_COUNT 41 +#define LARGE_STATE_COUNT 40 +#define SYMBOL_COUNT 43 +#define ALIAS_COUNT 0 +#define TOKEN_COUNT 27 +#define EXTERNAL_TOKEN_COUNT 2 +#define FIELD_COUNT 0 +#define MAX_ALIAS_SEQUENCE_LENGTH 3 +#define PRODUCTION_ID_COUNT 1 + +enum { + sym_comment = 1, + sym_bool_lit = 2, + aux_sym_kwd_lit_token1 = 3, + sym_nil_lit = 4, + sym__dec = 5, + sym__hex = 6, + sym__radix = 7, + sym_str_lit = 8, + sym_buf_lit = 9, + sym_sym_lit = 10, + anon_sym_AT_LPAREN = 11, + anon_sym_RPAREN = 12, + anon_sym_AT_LBRACK = 13, + anon_sym_RBRACK = 14, + anon_sym_LBRACE = 15, + anon_sym_RBRACE = 16, + anon_sym_AT_LBRACE = 17, + anon_sym_LPAREN = 18, + anon_sym_LBRACK = 19, + anon_sym_TILDE = 20, + anon_sym_SQUOTE = 21, + anon_sym_PIPE = 22, + anon_sym_SEMI = 23, + anon_sym_COMMA = 24, + sym_long_buf_lit = 25, + sym_long_str_lit = 26, + sym_source = 27, + sym__lit = 28, + sym_kwd_lit = 29, + sym_num_lit = 30, + sym_par_arr_lit = 31, + sym_sqr_arr_lit = 32, + sym_struct_lit = 33, + sym_tbl_lit = 34, + sym_par_tup_lit = 35, + sym_sqr_tup_lit = 36, + sym_qq_lit = 37, + sym_quote_lit = 38, + sym_short_fn_lit = 39, + sym_splice_lit = 40, + sym_unquote_lit = 41, + aux_sym_source_repeat1 = 42, +}; + +static const char *ts_symbol_names[] = { + [ts_builtin_sym_end] = "end", + [sym_comment] = "comment", + [sym_bool_lit] = "bool_lit", + [aux_sym_kwd_lit_token1] = "kwd_lit_token1", + [sym_nil_lit] = "nil_lit", + [sym__dec] = "_dec", + [sym__hex] = "_hex", + [sym__radix] = "_radix", + [sym_str_lit] = "str_lit", + [sym_buf_lit] = "buf_lit", + [sym_sym_lit] = "sym_lit", + [anon_sym_AT_LPAREN] = "@(", + [anon_sym_RPAREN] = ")", + [anon_sym_AT_LBRACK] = "@[", + [anon_sym_RBRACK] = "]", + [anon_sym_LBRACE] = "{", + [anon_sym_RBRACE] = "}", + [anon_sym_AT_LBRACE] = "@{", + [anon_sym_LPAREN] = "(", + [anon_sym_LBRACK] = "[", + [anon_sym_TILDE] = "~", + [anon_sym_SQUOTE] = "'", + [anon_sym_PIPE] = "|", + [anon_sym_SEMI] = ";", + [anon_sym_COMMA] = ",", + [sym_long_buf_lit] = "long_buf_lit", + [sym_long_str_lit] = "long_str_lit", + [sym_source] = "source", + [sym__lit] = "_lit", + [sym_kwd_lit] = "kwd_lit", + [sym_num_lit] = "num_lit", + [sym_par_arr_lit] = "par_arr_lit", + [sym_sqr_arr_lit] = "sqr_arr_lit", + [sym_struct_lit] = "struct_lit", + [sym_tbl_lit] = "tbl_lit", + [sym_par_tup_lit] = "par_tup_lit", + [sym_sqr_tup_lit] = "sqr_tup_lit", + [sym_qq_lit] = "qq_lit", + [sym_quote_lit] = "quote_lit", + [sym_short_fn_lit] = "short_fn_lit", + [sym_splice_lit] = "splice_lit", + [sym_unquote_lit] = "unquote_lit", + [aux_sym_source_repeat1] = "source_repeat1", +}; + +static TSSymbol ts_symbol_map[] = { + [ts_builtin_sym_end] = ts_builtin_sym_end, + [sym_comment] = sym_comment, + [sym_bool_lit] = sym_bool_lit, + [aux_sym_kwd_lit_token1] = aux_sym_kwd_lit_token1, + [sym_nil_lit] = sym_nil_lit, + [sym__dec] = sym__dec, + [sym__hex] = sym__hex, + [sym__radix] = sym__radix, + [sym_str_lit] = sym_str_lit, + [sym_buf_lit] = sym_buf_lit, + [sym_sym_lit] = sym_sym_lit, + [anon_sym_AT_LPAREN] = anon_sym_AT_LPAREN, + [anon_sym_RPAREN] = anon_sym_RPAREN, + [anon_sym_AT_LBRACK] = anon_sym_AT_LBRACK, + [anon_sym_RBRACK] = anon_sym_RBRACK, + [anon_sym_LBRACE] = anon_sym_LBRACE, + [anon_sym_RBRACE] = anon_sym_RBRACE, + [anon_sym_AT_LBRACE] = anon_sym_AT_LBRACE, + [anon_sym_LPAREN] = anon_sym_LPAREN, + [anon_sym_LBRACK] = anon_sym_LBRACK, + [anon_sym_TILDE] = anon_sym_TILDE, + [anon_sym_SQUOTE] = anon_sym_SQUOTE, + [anon_sym_PIPE] = anon_sym_PIPE, + [anon_sym_SEMI] = anon_sym_SEMI, + [anon_sym_COMMA] = anon_sym_COMMA, + [sym_long_buf_lit] = sym_long_buf_lit, + [sym_long_str_lit] = sym_long_str_lit, + [sym_source] = sym_source, + [sym__lit] = sym__lit, + [sym_kwd_lit] = sym_kwd_lit, + [sym_num_lit] = sym_num_lit, + [sym_par_arr_lit] = sym_par_arr_lit, + [sym_sqr_arr_lit] = sym_sqr_arr_lit, + [sym_struct_lit] = sym_struct_lit, + [sym_tbl_lit] = sym_tbl_lit, + [sym_par_tup_lit] = sym_par_tup_lit, + [sym_sqr_tup_lit] = sym_sqr_tup_lit, + [sym_qq_lit] = sym_qq_lit, + [sym_quote_lit] = sym_quote_lit, + [sym_short_fn_lit] = sym_short_fn_lit, + [sym_splice_lit] = sym_splice_lit, + [sym_unquote_lit] = sym_unquote_lit, + [aux_sym_source_repeat1] = aux_sym_source_repeat1, +}; + +static const TSSymbolMetadata ts_symbol_metadata[] = { + [ts_builtin_sym_end] = { + .visible = false, + .named = true, + }, + [sym_comment] = { + .visible = true, + .named = true, + }, + [sym_bool_lit] = { + .visible = true, + .named = true, + }, + [aux_sym_kwd_lit_token1] = { + .visible = false, + .named = false, + }, + [sym_nil_lit] = { + .visible = true, + .named = true, + }, + [sym__dec] = { + .visible = false, + .named = true, + }, + [sym__hex] = { + .visible = false, + .named = true, + }, + [sym__radix] = { + .visible = false, + .named = true, + }, + [sym_str_lit] = { + .visible = true, + .named = true, + }, + [sym_buf_lit] = { + .visible = true, + .named = true, + }, + [sym_sym_lit] = { + .visible = true, + .named = true, + }, + [anon_sym_AT_LPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_RPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_AT_LBRACK] = { + .visible = true, + .named = false, + }, + [anon_sym_RBRACK] = { + .visible = true, + .named = false, + }, + [anon_sym_LBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_RBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_AT_LBRACE] = { + .visible = true, + .named = false, + }, + [anon_sym_LPAREN] = { + .visible = true, + .named = false, + }, + [anon_sym_LBRACK] = { + .visible = true, + .named = false, + }, + [anon_sym_TILDE] = { + .visible = true, + .named = false, + }, + [anon_sym_SQUOTE] = { + .visible = true, + .named = false, + }, + [anon_sym_PIPE] = { + .visible = true, + .named = false, + }, + [anon_sym_SEMI] = { + .visible = true, + .named = false, + }, + [anon_sym_COMMA] = { + .visible = true, + .named = false, + }, + [sym_long_buf_lit] = { + .visible = true, + .named = true, + }, + [sym_long_str_lit] = { + .visible = true, + .named = true, + }, + [sym_source] = { + .visible = true, + .named = true, + }, + [sym__lit] = { + .visible = false, + .named = true, + }, + [sym_kwd_lit] = { + .visible = true, + .named = true, + }, + [sym_num_lit] = { + .visible = true, + .named = true, + }, + [sym_par_arr_lit] = { + .visible = true, + .named = true, + }, + [sym_sqr_arr_lit] = { + .visible = true, + .named = true, + }, + [sym_struct_lit] = { + .visible = true, + .named = true, + }, + [sym_tbl_lit] = { + .visible = true, + .named = true, + }, + [sym_par_tup_lit] = { + .visible = true, + .named = true, + }, + [sym_sqr_tup_lit] = { + .visible = true, + .named = true, + }, + [sym_qq_lit] = { + .visible = true, + .named = true, + }, + [sym_quote_lit] = { + .visible = true, + .named = true, + }, + [sym_short_fn_lit] = { + .visible = true, + .named = true, + }, + [sym_splice_lit] = { + .visible = true, + .named = true, + }, + [sym_unquote_lit] = { + .visible = true, + .named = true, + }, + [aux_sym_source_repeat1] = { + .visible = false, + .named = false, + }, +}; + +static TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { + [0] = {0}, +}; + +static uint16_t ts_non_terminal_alias_map[] = { + 0, +}; + +static bool ts_lex(TSLexer *lexer, TSStateId state) { + START_LEXER(); + eof = lexer->eof(lexer); + switch (state) { + case 0: + if (eof) ADVANCE(13); + if (lookahead == 0 || + ('\t' <= lookahead && lookahead <= '\r') || + lookahead == ' ') SKIP(0) + if (lookahead == '"') ADVANCE(1); + if (lookahead == '#') ADVANCE(14); + if (lookahead == '\'') ADVANCE(87); + if (lookahead == '(') ADVANCE(84); + if (lookahead == ')') ADVANCE(78); + if (lookahead == '+' || + lookahead == '-') ADVANCE(57); + if (lookahead == ',') ADVANCE(90); + if (lookahead == '.') ADVANCE(61); + if (lookahead == '0') ADVANCE(18); + if (lookahead == '1') ADVANCE(23); + if (lookahead == '2') ADVANCE(24); + if (lookahead == '3') ADVANCE(22); + if (('4' <= lookahead && lookahead <= '9')) ADVANCE(21); + if (lookahead == ':') ADVANCE(16); + if (lookahead == ';') ADVANCE(89); + if (lookahead == '@') ADVANCE(56); + if (lookahead == '[') ADVANCE(85); + if (lookahead == ']') ADVANCE(80); + if (lookahead == '_') ADVANCE(58); + if (lookahead == 'f') ADVANCE(63); + if (lookahead == 'n') ADVANCE(65); + if (lookahead == 't') ADVANCE(68); + if (lookahead == '{') ADVANCE(81); + if (lookahead == '|') ADVANCE(88); + if (lookahead == '}') ADVANCE(82); + if (lookahead == '~') ADVANCE(86); + if (('!' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 1: + if (lookahead == '"') ADVANCE(54); + if (lookahead == '\\') ADVANCE(11); + if (lookahead != 0) ADVANCE(1); + END_STATE(); + case 2: + if (lookahead == '"') ADVANCE(55); + if (lookahead == '\\') ADVANCE(12); + if (lookahead != 0) ADVANCE(2); + END_STATE(); + case 3: + if (lookahead == '.') ADVANCE(5); + if (lookahead == '_') ADVANCE(4); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(40); + END_STATE(); + case 4: + if (lookahead == '.') ADVANCE(5); + if (lookahead == '_') ADVANCE(4); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(45); + END_STATE(); + case 5: + if (lookahead == '_') ADVANCE(5); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(45); + END_STATE(); + case 6: + if (lookahead == '+' || + lookahead == '-') ADVANCE(8); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(38); + END_STATE(); + case 7: + if (lookahead == '+' || + lookahead == '-') ADVANCE(9); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(52); + END_STATE(); + case 8: + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(38); + END_STATE(); + case 9: + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(52); + END_STATE(); + case 10: + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(50); + END_STATE(); + case 11: + if (lookahead != 0) ADVANCE(1); + END_STATE(); + case 12: + if (lookahead != 0) ADVANCE(2); + END_STATE(); + case 13: + ACCEPT_TOKEN(ts_builtin_sym_end); + END_STATE(); + case 14: + ACCEPT_TOKEN(sym_comment); + if (lookahead != 0 && + lookahead != '\n') ADVANCE(14); + END_STATE(); + case 15: + ACCEPT_TOKEN(sym_bool_lit); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 16: + ACCEPT_TOKEN(aux_sym_kwd_lit_token1); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(16); + END_STATE(); + case 17: + ACCEPT_TOKEN(sym_nil_lit); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 18: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(32); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(6); + if (lookahead == '_') ADVANCE(19); + if (lookahead == 'x') ADVANCE(3); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(20); + END_STATE(); + case 19: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(32); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(6); + if (lookahead == '_') ADVANCE(19); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(34); + END_STATE(); + case 20: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(32); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(6); + if (lookahead == '_') ADVANCE(19); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(20); + END_STATE(); + case 21: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(32); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(6); + if (lookahead == 'R' || + lookahead == 'r') ADVANCE(10); + if (lookahead == '_') ADVANCE(19); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(20); + END_STATE(); + case 22: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(32); + if (('0' <= lookahead && lookahead <= '6')) ADVANCE(21); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(6); + if (lookahead == 'R' || + lookahead == 'r') ADVANCE(10); + if (lookahead == '_') ADVANCE(19); + if (('7' <= lookahead && lookahead <= '9')) ADVANCE(20); + END_STATE(); + case 23: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(32); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(21); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(6); + if (lookahead == '_') ADVANCE(19); + END_STATE(); + case 24: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(32); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(21); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(6); + if (lookahead == 'R' || + lookahead == 'r') ADVANCE(10); + if (lookahead == '_') ADVANCE(19); + END_STATE(); + case 25: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(37); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(71); + if (lookahead == '_') ADVANCE(26); + if (lookahead == 'x') ADVANCE(59); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(27); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 26: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(37); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(71); + if (lookahead == '_') ADVANCE(26); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 27: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(37); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(71); + if (lookahead == '_') ADVANCE(26); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(27); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 28: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(37); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(71); + if (lookahead == 'R' || + lookahead == 'r') ADVANCE(75); + if (lookahead == '_') ADVANCE(26); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(27); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 29: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(37); + if (('0' <= lookahead && lookahead <= '6')) ADVANCE(28); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(71); + if (lookahead == 'R' || + lookahead == 'r') ADVANCE(75); + if (lookahead == '_') ADVANCE(26); + if (('7' <= lookahead && lookahead <= '9')) ADVANCE(27); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 30: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(37); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(28); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(71); + if (lookahead == '_') ADVANCE(26); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 31: + ACCEPT_TOKEN(sym__dec); + if (lookahead == '.') ADVANCE(37); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(28); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(71); + if (lookahead == 'R' || + lookahead == 'r') ADVANCE(75); + if (lookahead == '_') ADVANCE(26); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 32: + ACCEPT_TOKEN(sym__dec); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(6); + if (lookahead == '_') ADVANCE(32); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(34); + END_STATE(); + case 33: + ACCEPT_TOKEN(sym__dec); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(6); + if (lookahead == '_') ADVANCE(33); + END_STATE(); + case 34: + ACCEPT_TOKEN(sym__dec); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(6); + if (lookahead == '_') ADVANCE(33); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(34); + END_STATE(); + case 35: + ACCEPT_TOKEN(sym__dec); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(71); + if (lookahead == '_') ADVANCE(36); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 36: + ACCEPT_TOKEN(sym__dec); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(71); + if (lookahead == '_') ADVANCE(36); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 37: + ACCEPT_TOKEN(sym__dec); + if (lookahead == 'E' || + lookahead == 'e') ADVANCE(71); + if (lookahead == '_') ADVANCE(37); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 38: + ACCEPT_TOKEN(sym__dec); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(38); + END_STATE(); + case 39: + ACCEPT_TOKEN(sym__dec); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(39); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 40: + ACCEPT_TOKEN(sym__hex); + if (lookahead == '.') ADVANCE(48); + if (lookahead == '_') ADVANCE(41); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(40); + END_STATE(); + case 41: + ACCEPT_TOKEN(sym__hex); + if (lookahead == '.') ADVANCE(48); + if (lookahead == '_') ADVANCE(41); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(45); + END_STATE(); + case 42: + ACCEPT_TOKEN(sym__hex); + if (lookahead == '.') ADVANCE(49); + if (lookahead == '_') ADVANCE(43); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(42); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('g' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 43: + ACCEPT_TOKEN(sym__hex); + if (lookahead == '.') ADVANCE(49); + if (lookahead == '_') ADVANCE(43); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(46); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('g' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 44: + ACCEPT_TOKEN(sym__hex); + if (lookahead == '_') ADVANCE(44); + END_STATE(); + case 45: + ACCEPT_TOKEN(sym__hex); + if (lookahead == '_') ADVANCE(44); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(45); + END_STATE(); + case 46: + ACCEPT_TOKEN(sym__hex); + if (lookahead == '_') ADVANCE(47); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(46); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('g' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 47: + ACCEPT_TOKEN(sym__hex); + if (lookahead == '_') ADVANCE(47); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 48: + ACCEPT_TOKEN(sym__hex); + if (lookahead == '_') ADVANCE(48); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(45); + END_STATE(); + case 49: + ACCEPT_TOKEN(sym__hex); + if (lookahead == '_') ADVANCE(49); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(46); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('g' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 50: + ACCEPT_TOKEN(sym__radix); + if (lookahead == '&') ADVANCE(7); + if (lookahead == '_') ADVANCE(50); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(50); + END_STATE(); + case 51: + ACCEPT_TOKEN(sym__radix); + if (lookahead == '&') ADVANCE(72); + if (lookahead == '_') ADVANCE(51); + if (lookahead == '!' || + lookahead == '$' || + lookahead == '%' || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= '/') || + lookahead == ':' || + ('<' <= lookahead && lookahead <= '@') || + lookahead == '^') ADVANCE(76); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(51); + END_STATE(); + case 52: + ACCEPT_TOKEN(sym__radix); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(52); + END_STATE(); + case 53: + ACCEPT_TOKEN(sym__radix); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(53); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 54: + ACCEPT_TOKEN(sym_str_lit); + END_STATE(); + case 55: + ACCEPT_TOKEN(sym_buf_lit); + END_STATE(); + case 56: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == '"') ADVANCE(2); + if (lookahead == '(') ADVANCE(77); + if (lookahead == '[') ADVANCE(79); + if (lookahead == '{') ADVANCE(83); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 57: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == '.') ADVANCE(61); + if (lookahead == '0') ADVANCE(25); + if (lookahead == '1') ADVANCE(30); + if (lookahead == '2') ADVANCE(31); + if (lookahead == '3') ADVANCE(29); + if (('4' <= lookahead && lookahead <= '9')) ADVANCE(28); + if (lookahead == '_') ADVANCE(58); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 58: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == '.') ADVANCE(61); + if (lookahead == '_') ADVANCE(58); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 59: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == '.') ADVANCE(62); + if (lookahead == '_') ADVANCE(60); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(42); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('g' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 60: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == '.') ADVANCE(62); + if (lookahead == '_') ADVANCE(60); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(46); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('g' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 61: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == '_') ADVANCE(61); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(35); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 62: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == '_') ADVANCE(62); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'F') || + ('a' <= lookahead && lookahead <= 'f')) ADVANCE(46); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + ('g' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 63: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == 'a') ADVANCE(66); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('b' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 64: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == 'e') ADVANCE(15); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 65: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == 'i') ADVANCE(67); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 66: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == 'l') ADVANCE(69); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 67: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == 'l') ADVANCE(17); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 68: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == 'r') ADVANCE(70); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 69: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == 's') ADVANCE(64); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 70: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == 'u') ADVANCE(64); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 71: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == '+' || + lookahead == '-') ADVANCE(73); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(39); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + ('.' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 72: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == '+' || + lookahead == '-') ADVANCE(74); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(53); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + ('.' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 73: + ACCEPT_TOKEN(sym_sym_lit); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(39); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 74: + ACCEPT_TOKEN(sym_sym_lit); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(53); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 75: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= '/') || + lookahead == ':' || + ('<' <= lookahead && lookahead <= '@') || + lookahead == '^' || + lookahead == '_') ADVANCE(76); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(51); + END_STATE(); + case 76: + ACCEPT_TOKEN(sym_sym_lit); + if (lookahead == '!' || + ('$' <= lookahead && lookahead <= '&') || + lookahead == '*' || + lookahead == '+' || + ('-' <= lookahead && lookahead <= ':') || + ('<' <= lookahead && lookahead <= 'Z') || + lookahead == '^' || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(76); + END_STATE(); + case 77: + ACCEPT_TOKEN(anon_sym_AT_LPAREN); + END_STATE(); + case 78: + ACCEPT_TOKEN(anon_sym_RPAREN); + END_STATE(); + case 79: + ACCEPT_TOKEN(anon_sym_AT_LBRACK); + END_STATE(); + case 80: + ACCEPT_TOKEN(anon_sym_RBRACK); + END_STATE(); + case 81: + ACCEPT_TOKEN(anon_sym_LBRACE); + END_STATE(); + case 82: + ACCEPT_TOKEN(anon_sym_RBRACE); + END_STATE(); + case 83: + ACCEPT_TOKEN(anon_sym_AT_LBRACE); + END_STATE(); + case 84: + ACCEPT_TOKEN(anon_sym_LPAREN); + END_STATE(); + case 85: + ACCEPT_TOKEN(anon_sym_LBRACK); + END_STATE(); + case 86: + ACCEPT_TOKEN(anon_sym_TILDE); + END_STATE(); + case 87: + ACCEPT_TOKEN(anon_sym_SQUOTE); + END_STATE(); + case 88: + ACCEPT_TOKEN(anon_sym_PIPE); + END_STATE(); + case 89: + ACCEPT_TOKEN(anon_sym_SEMI); + END_STATE(); + case 90: + ACCEPT_TOKEN(anon_sym_COMMA); + END_STATE(); + default: + return false; + } +} + +static TSLexMode ts_lex_modes[STATE_COUNT] = { + [0] = {.lex_state = 0, .external_lex_state = 1}, + [1] = {.lex_state = 0, .external_lex_state = 1}, + [2] = {.lex_state = 0, .external_lex_state = 1}, + [3] = {.lex_state = 0, .external_lex_state = 1}, + [4] = {.lex_state = 0, .external_lex_state = 1}, + [5] = {.lex_state = 0, .external_lex_state = 1}, + [6] = {.lex_state = 0, .external_lex_state = 1}, + [7] = {.lex_state = 0, .external_lex_state = 1}, + [8] = {.lex_state = 0, .external_lex_state = 1}, + [9] = {.lex_state = 0, .external_lex_state = 1}, + [10] = {.lex_state = 0, .external_lex_state = 1}, + [11] = {.lex_state = 0, .external_lex_state = 1}, + [12] = {.lex_state = 0, .external_lex_state = 1}, + [13] = {.lex_state = 0, .external_lex_state = 1}, + [14] = {.lex_state = 0, .external_lex_state = 1}, + [15] = {.lex_state = 0, .external_lex_state = 1}, + [16] = {.lex_state = 0, .external_lex_state = 1}, + [17] = {.lex_state = 0, .external_lex_state = 1}, + [18] = {.lex_state = 0, .external_lex_state = 1}, + [19] = {.lex_state = 0, .external_lex_state = 1}, + [20] = {.lex_state = 0, .external_lex_state = 1}, + [21] = {.lex_state = 0, .external_lex_state = 1}, + [22] = {.lex_state = 0, .external_lex_state = 1}, + [23] = {.lex_state = 0, .external_lex_state = 1}, + [24] = {.lex_state = 0, .external_lex_state = 1}, + [25] = {.lex_state = 0, .external_lex_state = 1}, + [26] = {.lex_state = 0, .external_lex_state = 1}, + [27] = {.lex_state = 0, .external_lex_state = 1}, + [28] = {.lex_state = 0, .external_lex_state = 1}, + [29] = {.lex_state = 0, .external_lex_state = 1}, + [30] = {.lex_state = 0, .external_lex_state = 1}, + [31] = {.lex_state = 0, .external_lex_state = 1}, + [32] = {.lex_state = 0, .external_lex_state = 1}, + [33] = {.lex_state = 0, .external_lex_state = 1}, + [34] = {.lex_state = 0, .external_lex_state = 1}, + [35] = {.lex_state = 0, .external_lex_state = 1}, + [36] = {.lex_state = 0, .external_lex_state = 1}, + [37] = {.lex_state = 0, .external_lex_state = 1}, + [38] = {.lex_state = 0, .external_lex_state = 1}, + [39] = {.lex_state = 0, .external_lex_state = 1}, + [40] = {.lex_state = 0}, +}; + +enum { + ts_external_token_long_buf_lit = 0, + ts_external_token_long_str_lit = 1, +}; + +static TSSymbol ts_external_scanner_symbol_map[EXTERNAL_TOKEN_COUNT] = { + [ts_external_token_long_buf_lit] = sym_long_buf_lit, + [ts_external_token_long_str_lit] = sym_long_str_lit, +}; + +static bool ts_external_scanner_states[2][EXTERNAL_TOKEN_COUNT] = { + [1] = { + [ts_external_token_long_buf_lit] = true, + [ts_external_token_long_str_lit] = true, + }, +}; + +static uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { + [0] = { + [ts_builtin_sym_end] = ACTIONS(1), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(1), + [aux_sym_kwd_lit_token1] = ACTIONS(1), + [sym_nil_lit] = ACTIONS(1), + [sym__dec] = ACTIONS(1), + [sym__hex] = ACTIONS(1), + [sym__radix] = ACTIONS(1), + [sym_str_lit] = ACTIONS(1), + [sym_buf_lit] = ACTIONS(1), + [sym_sym_lit] = ACTIONS(1), + [anon_sym_AT_LPAREN] = ACTIONS(1), + [anon_sym_RPAREN] = ACTIONS(1), + [anon_sym_AT_LBRACK] = ACTIONS(1), + [anon_sym_RBRACK] = ACTIONS(1), + [anon_sym_LBRACE] = ACTIONS(1), + [anon_sym_RBRACE] = ACTIONS(1), + [anon_sym_AT_LBRACE] = ACTIONS(1), + [anon_sym_LPAREN] = ACTIONS(1), + [anon_sym_LBRACK] = ACTIONS(1), + [anon_sym_TILDE] = ACTIONS(1), + [anon_sym_SQUOTE] = ACTIONS(1), + [anon_sym_PIPE] = ACTIONS(1), + [anon_sym_SEMI] = ACTIONS(1), + [anon_sym_COMMA] = ACTIONS(1), + [sym_long_buf_lit] = ACTIONS(1), + [sym_long_str_lit] = ACTIONS(1), + }, + [1] = { + [sym_source] = STATE(40), + [sym__lit] = STATE(3), + [sym_kwd_lit] = STATE(3), + [sym_num_lit] = STATE(3), + [sym_par_arr_lit] = STATE(3), + [sym_sqr_arr_lit] = STATE(3), + [sym_struct_lit] = STATE(3), + [sym_tbl_lit] = STATE(3), + [sym_par_tup_lit] = STATE(3), + [sym_sqr_tup_lit] = STATE(3), + [sym_qq_lit] = STATE(3), + [sym_quote_lit] = STATE(3), + [sym_short_fn_lit] = STATE(3), + [sym_splice_lit] = STATE(3), + [sym_unquote_lit] = STATE(3), + [aux_sym_source_repeat1] = STATE(3), + [ts_builtin_sym_end] = ACTIONS(5), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(7), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(7), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(13), + [sym_buf_lit] = ACTIONS(13), + [sym_sym_lit] = ACTIONS(7), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(13), + [sym_long_str_lit] = ACTIONS(13), + }, + [2] = { + [sym__lit] = STATE(2), + [sym_kwd_lit] = STATE(2), + [sym_num_lit] = STATE(2), + [sym_par_arr_lit] = STATE(2), + [sym_sqr_arr_lit] = STATE(2), + [sym_struct_lit] = STATE(2), + [sym_tbl_lit] = STATE(2), + [sym_par_tup_lit] = STATE(2), + [sym_sqr_tup_lit] = STATE(2), + [sym_qq_lit] = STATE(2), + [sym_quote_lit] = STATE(2), + [sym_short_fn_lit] = STATE(2), + [sym_splice_lit] = STATE(2), + [sym_unquote_lit] = STATE(2), + [aux_sym_source_repeat1] = STATE(2), + [ts_builtin_sym_end] = ACTIONS(37), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(39), + [aux_sym_kwd_lit_token1] = ACTIONS(42), + [sym_nil_lit] = ACTIONS(39), + [sym__dec] = ACTIONS(45), + [sym__hex] = ACTIONS(45), + [sym__radix] = ACTIONS(45), + [sym_str_lit] = ACTIONS(48), + [sym_buf_lit] = ACTIONS(48), + [sym_sym_lit] = ACTIONS(39), + [anon_sym_AT_LPAREN] = ACTIONS(51), + [anon_sym_RPAREN] = ACTIONS(37), + [anon_sym_AT_LBRACK] = ACTIONS(54), + [anon_sym_RBRACK] = ACTIONS(37), + [anon_sym_LBRACE] = ACTIONS(57), + [anon_sym_RBRACE] = ACTIONS(37), + [anon_sym_AT_LBRACE] = ACTIONS(60), + [anon_sym_LPAREN] = ACTIONS(63), + [anon_sym_LBRACK] = ACTIONS(66), + [anon_sym_TILDE] = ACTIONS(69), + [anon_sym_SQUOTE] = ACTIONS(72), + [anon_sym_PIPE] = ACTIONS(75), + [anon_sym_SEMI] = ACTIONS(78), + [anon_sym_COMMA] = ACTIONS(81), + [sym_long_buf_lit] = ACTIONS(48), + [sym_long_str_lit] = ACTIONS(48), + }, + [3] = { + [sym__lit] = STATE(2), + [sym_kwd_lit] = STATE(2), + [sym_num_lit] = STATE(2), + [sym_par_arr_lit] = STATE(2), + [sym_sqr_arr_lit] = STATE(2), + [sym_struct_lit] = STATE(2), + [sym_tbl_lit] = STATE(2), + [sym_par_tup_lit] = STATE(2), + [sym_sqr_tup_lit] = STATE(2), + [sym_qq_lit] = STATE(2), + [sym_quote_lit] = STATE(2), + [sym_short_fn_lit] = STATE(2), + [sym_splice_lit] = STATE(2), + [sym_unquote_lit] = STATE(2), + [aux_sym_source_repeat1] = STATE(2), + [ts_builtin_sym_end] = ACTIONS(84), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(86), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(86), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(88), + [sym_buf_lit] = ACTIONS(88), + [sym_sym_lit] = ACTIONS(86), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(88), + [sym_long_str_lit] = ACTIONS(88), + }, + [4] = { + [sym__lit] = STATE(2), + [sym_kwd_lit] = STATE(2), + [sym_num_lit] = STATE(2), + [sym_par_arr_lit] = STATE(2), + [sym_sqr_arr_lit] = STATE(2), + [sym_struct_lit] = STATE(2), + [sym_tbl_lit] = STATE(2), + [sym_par_tup_lit] = STATE(2), + [sym_sqr_tup_lit] = STATE(2), + [sym_qq_lit] = STATE(2), + [sym_quote_lit] = STATE(2), + [sym_short_fn_lit] = STATE(2), + [sym_splice_lit] = STATE(2), + [sym_unquote_lit] = STATE(2), + [aux_sym_source_repeat1] = STATE(2), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(86), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(86), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(88), + [sym_buf_lit] = ACTIONS(88), + [sym_sym_lit] = ACTIONS(86), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_RBRACK] = ACTIONS(90), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(88), + [sym_long_str_lit] = ACTIONS(88), + }, + [5] = { + [sym__lit] = STATE(15), + [sym_kwd_lit] = STATE(15), + [sym_num_lit] = STATE(15), + [sym_par_arr_lit] = STATE(15), + [sym_sqr_arr_lit] = STATE(15), + [sym_struct_lit] = STATE(15), + [sym_tbl_lit] = STATE(15), + [sym_par_tup_lit] = STATE(15), + [sym_sqr_tup_lit] = STATE(15), + [sym_qq_lit] = STATE(15), + [sym_quote_lit] = STATE(15), + [sym_short_fn_lit] = STATE(15), + [sym_splice_lit] = STATE(15), + [sym_unquote_lit] = STATE(15), + [aux_sym_source_repeat1] = STATE(15), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(92), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(92), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(94), + [sym_buf_lit] = ACTIONS(94), + [sym_sym_lit] = ACTIONS(92), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_RPAREN] = ACTIONS(96), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(94), + [sym_long_str_lit] = ACTIONS(94), + }, + [6] = { + [sym__lit] = STATE(14), + [sym_kwd_lit] = STATE(14), + [sym_num_lit] = STATE(14), + [sym_par_arr_lit] = STATE(14), + [sym_sqr_arr_lit] = STATE(14), + [sym_struct_lit] = STATE(14), + [sym_tbl_lit] = STATE(14), + [sym_par_tup_lit] = STATE(14), + [sym_sqr_tup_lit] = STATE(14), + [sym_qq_lit] = STATE(14), + [sym_quote_lit] = STATE(14), + [sym_short_fn_lit] = STATE(14), + [sym_splice_lit] = STATE(14), + [sym_unquote_lit] = STATE(14), + [aux_sym_source_repeat1] = STATE(14), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(98), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(98), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(100), + [sym_buf_lit] = ACTIONS(100), + [sym_sym_lit] = ACTIONS(98), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_RBRACK] = ACTIONS(102), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(100), + [sym_long_str_lit] = ACTIONS(100), + }, + [7] = { + [sym__lit] = STATE(13), + [sym_kwd_lit] = STATE(13), + [sym_num_lit] = STATE(13), + [sym_par_arr_lit] = STATE(13), + [sym_sqr_arr_lit] = STATE(13), + [sym_struct_lit] = STATE(13), + [sym_tbl_lit] = STATE(13), + [sym_par_tup_lit] = STATE(13), + [sym_sqr_tup_lit] = STATE(13), + [sym_qq_lit] = STATE(13), + [sym_quote_lit] = STATE(13), + [sym_short_fn_lit] = STATE(13), + [sym_splice_lit] = STATE(13), + [sym_unquote_lit] = STATE(13), + [aux_sym_source_repeat1] = STATE(13), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(104), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(104), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(106), + [sym_buf_lit] = ACTIONS(106), + [sym_sym_lit] = ACTIONS(104), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_RBRACE] = ACTIONS(108), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(106), + [sym_long_str_lit] = ACTIONS(106), + }, + [8] = { + [sym__lit] = STATE(12), + [sym_kwd_lit] = STATE(12), + [sym_num_lit] = STATE(12), + [sym_par_arr_lit] = STATE(12), + [sym_sqr_arr_lit] = STATE(12), + [sym_struct_lit] = STATE(12), + [sym_tbl_lit] = STATE(12), + [sym_par_tup_lit] = STATE(12), + [sym_sqr_tup_lit] = STATE(12), + [sym_qq_lit] = STATE(12), + [sym_quote_lit] = STATE(12), + [sym_short_fn_lit] = STATE(12), + [sym_splice_lit] = STATE(12), + [sym_unquote_lit] = STATE(12), + [aux_sym_source_repeat1] = STATE(12), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(110), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(110), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(112), + [sym_buf_lit] = ACTIONS(112), + [sym_sym_lit] = ACTIONS(110), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_RBRACE] = ACTIONS(114), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(112), + [sym_long_str_lit] = ACTIONS(112), + }, + [9] = { + [sym__lit] = STATE(11), + [sym_kwd_lit] = STATE(11), + [sym_num_lit] = STATE(11), + [sym_par_arr_lit] = STATE(11), + [sym_sqr_arr_lit] = STATE(11), + [sym_struct_lit] = STATE(11), + [sym_tbl_lit] = STATE(11), + [sym_par_tup_lit] = STATE(11), + [sym_sqr_tup_lit] = STATE(11), + [sym_qq_lit] = STATE(11), + [sym_quote_lit] = STATE(11), + [sym_short_fn_lit] = STATE(11), + [sym_splice_lit] = STATE(11), + [sym_unquote_lit] = STATE(11), + [aux_sym_source_repeat1] = STATE(11), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(116), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(116), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(118), + [sym_buf_lit] = ACTIONS(118), + [sym_sym_lit] = ACTIONS(116), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_RPAREN] = ACTIONS(120), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(118), + [sym_long_str_lit] = ACTIONS(118), + }, + [10] = { + [sym__lit] = STATE(4), + [sym_kwd_lit] = STATE(4), + [sym_num_lit] = STATE(4), + [sym_par_arr_lit] = STATE(4), + [sym_sqr_arr_lit] = STATE(4), + [sym_struct_lit] = STATE(4), + [sym_tbl_lit] = STATE(4), + [sym_par_tup_lit] = STATE(4), + [sym_sqr_tup_lit] = STATE(4), + [sym_qq_lit] = STATE(4), + [sym_quote_lit] = STATE(4), + [sym_short_fn_lit] = STATE(4), + [sym_splice_lit] = STATE(4), + [sym_unquote_lit] = STATE(4), + [aux_sym_source_repeat1] = STATE(4), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(122), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(122), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(124), + [sym_buf_lit] = ACTIONS(124), + [sym_sym_lit] = ACTIONS(122), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_RBRACK] = ACTIONS(126), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(124), + [sym_long_str_lit] = ACTIONS(124), + }, + [11] = { + [sym__lit] = STATE(2), + [sym_kwd_lit] = STATE(2), + [sym_num_lit] = STATE(2), + [sym_par_arr_lit] = STATE(2), + [sym_sqr_arr_lit] = STATE(2), + [sym_struct_lit] = STATE(2), + [sym_tbl_lit] = STATE(2), + [sym_par_tup_lit] = STATE(2), + [sym_sqr_tup_lit] = STATE(2), + [sym_qq_lit] = STATE(2), + [sym_quote_lit] = STATE(2), + [sym_short_fn_lit] = STATE(2), + [sym_splice_lit] = STATE(2), + [sym_unquote_lit] = STATE(2), + [aux_sym_source_repeat1] = STATE(2), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(86), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(86), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(88), + [sym_buf_lit] = ACTIONS(88), + [sym_sym_lit] = ACTIONS(86), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_RPAREN] = ACTIONS(128), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(88), + [sym_long_str_lit] = ACTIONS(88), + }, + [12] = { + [sym__lit] = STATE(2), + [sym_kwd_lit] = STATE(2), + [sym_num_lit] = STATE(2), + [sym_par_arr_lit] = STATE(2), + [sym_sqr_arr_lit] = STATE(2), + [sym_struct_lit] = STATE(2), + [sym_tbl_lit] = STATE(2), + [sym_par_tup_lit] = STATE(2), + [sym_sqr_tup_lit] = STATE(2), + [sym_qq_lit] = STATE(2), + [sym_quote_lit] = STATE(2), + [sym_short_fn_lit] = STATE(2), + [sym_splice_lit] = STATE(2), + [sym_unquote_lit] = STATE(2), + [aux_sym_source_repeat1] = STATE(2), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(86), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(86), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(88), + [sym_buf_lit] = ACTIONS(88), + [sym_sym_lit] = ACTIONS(86), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_RBRACE] = ACTIONS(130), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(88), + [sym_long_str_lit] = ACTIONS(88), + }, + [13] = { + [sym__lit] = STATE(2), + [sym_kwd_lit] = STATE(2), + [sym_num_lit] = STATE(2), + [sym_par_arr_lit] = STATE(2), + [sym_sqr_arr_lit] = STATE(2), + [sym_struct_lit] = STATE(2), + [sym_tbl_lit] = STATE(2), + [sym_par_tup_lit] = STATE(2), + [sym_sqr_tup_lit] = STATE(2), + [sym_qq_lit] = STATE(2), + [sym_quote_lit] = STATE(2), + [sym_short_fn_lit] = STATE(2), + [sym_splice_lit] = STATE(2), + [sym_unquote_lit] = STATE(2), + [aux_sym_source_repeat1] = STATE(2), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(86), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(86), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(88), + [sym_buf_lit] = ACTIONS(88), + [sym_sym_lit] = ACTIONS(86), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_RBRACE] = ACTIONS(132), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(88), + [sym_long_str_lit] = ACTIONS(88), + }, + [14] = { + [sym__lit] = STATE(2), + [sym_kwd_lit] = STATE(2), + [sym_num_lit] = STATE(2), + [sym_par_arr_lit] = STATE(2), + [sym_sqr_arr_lit] = STATE(2), + [sym_struct_lit] = STATE(2), + [sym_tbl_lit] = STATE(2), + [sym_par_tup_lit] = STATE(2), + [sym_sqr_tup_lit] = STATE(2), + [sym_qq_lit] = STATE(2), + [sym_quote_lit] = STATE(2), + [sym_short_fn_lit] = STATE(2), + [sym_splice_lit] = STATE(2), + [sym_unquote_lit] = STATE(2), + [aux_sym_source_repeat1] = STATE(2), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(86), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(86), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(88), + [sym_buf_lit] = ACTIONS(88), + [sym_sym_lit] = ACTIONS(86), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_RBRACK] = ACTIONS(134), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(88), + [sym_long_str_lit] = ACTIONS(88), + }, + [15] = { + [sym__lit] = STATE(2), + [sym_kwd_lit] = STATE(2), + [sym_num_lit] = STATE(2), + [sym_par_arr_lit] = STATE(2), + [sym_sqr_arr_lit] = STATE(2), + [sym_struct_lit] = STATE(2), + [sym_tbl_lit] = STATE(2), + [sym_par_tup_lit] = STATE(2), + [sym_sqr_tup_lit] = STATE(2), + [sym_qq_lit] = STATE(2), + [sym_quote_lit] = STATE(2), + [sym_short_fn_lit] = STATE(2), + [sym_splice_lit] = STATE(2), + [sym_unquote_lit] = STATE(2), + [aux_sym_source_repeat1] = STATE(2), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(86), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(86), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(88), + [sym_buf_lit] = ACTIONS(88), + [sym_sym_lit] = ACTIONS(86), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_RPAREN] = ACTIONS(136), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(88), + [sym_long_str_lit] = ACTIONS(88), + }, + [16] = { + [sym__lit] = STATE(21), + [sym_kwd_lit] = STATE(21), + [sym_num_lit] = STATE(21), + [sym_par_arr_lit] = STATE(21), + [sym_sqr_arr_lit] = STATE(21), + [sym_struct_lit] = STATE(21), + [sym_tbl_lit] = STATE(21), + [sym_par_tup_lit] = STATE(21), + [sym_sqr_tup_lit] = STATE(21), + [sym_qq_lit] = STATE(21), + [sym_quote_lit] = STATE(21), + [sym_short_fn_lit] = STATE(21), + [sym_splice_lit] = STATE(21), + [sym_unquote_lit] = STATE(21), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(138), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(138), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(140), + [sym_buf_lit] = ACTIONS(140), + [sym_sym_lit] = ACTIONS(138), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(140), + [sym_long_str_lit] = ACTIONS(140), + }, + [17] = { + [sym__lit] = STATE(32), + [sym_kwd_lit] = STATE(32), + [sym_num_lit] = STATE(32), + [sym_par_arr_lit] = STATE(32), + [sym_sqr_arr_lit] = STATE(32), + [sym_struct_lit] = STATE(32), + [sym_tbl_lit] = STATE(32), + [sym_par_tup_lit] = STATE(32), + [sym_sqr_tup_lit] = STATE(32), + [sym_qq_lit] = STATE(32), + [sym_quote_lit] = STATE(32), + [sym_short_fn_lit] = STATE(32), + [sym_splice_lit] = STATE(32), + [sym_unquote_lit] = STATE(32), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(142), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(142), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(144), + [sym_buf_lit] = ACTIONS(144), + [sym_sym_lit] = ACTIONS(142), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(144), + [sym_long_str_lit] = ACTIONS(144), + }, + [18] = { + [sym__lit] = STATE(29), + [sym_kwd_lit] = STATE(29), + [sym_num_lit] = STATE(29), + [sym_par_arr_lit] = STATE(29), + [sym_sqr_arr_lit] = STATE(29), + [sym_struct_lit] = STATE(29), + [sym_tbl_lit] = STATE(29), + [sym_par_tup_lit] = STATE(29), + [sym_sqr_tup_lit] = STATE(29), + [sym_qq_lit] = STATE(29), + [sym_quote_lit] = STATE(29), + [sym_short_fn_lit] = STATE(29), + [sym_splice_lit] = STATE(29), + [sym_unquote_lit] = STATE(29), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(146), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(146), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(148), + [sym_buf_lit] = ACTIONS(148), + [sym_sym_lit] = ACTIONS(146), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(148), + [sym_long_str_lit] = ACTIONS(148), + }, + [19] = { + [sym__lit] = STATE(30), + [sym_kwd_lit] = STATE(30), + [sym_num_lit] = STATE(30), + [sym_par_arr_lit] = STATE(30), + [sym_sqr_arr_lit] = STATE(30), + [sym_struct_lit] = STATE(30), + [sym_tbl_lit] = STATE(30), + [sym_par_tup_lit] = STATE(30), + [sym_sqr_tup_lit] = STATE(30), + [sym_qq_lit] = STATE(30), + [sym_quote_lit] = STATE(30), + [sym_short_fn_lit] = STATE(30), + [sym_splice_lit] = STATE(30), + [sym_unquote_lit] = STATE(30), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(150), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(150), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(152), + [sym_buf_lit] = ACTIONS(152), + [sym_sym_lit] = ACTIONS(150), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(152), + [sym_long_str_lit] = ACTIONS(152), + }, + [20] = { + [sym__lit] = STATE(31), + [sym_kwd_lit] = STATE(31), + [sym_num_lit] = STATE(31), + [sym_par_arr_lit] = STATE(31), + [sym_sqr_arr_lit] = STATE(31), + [sym_struct_lit] = STATE(31), + [sym_tbl_lit] = STATE(31), + [sym_par_tup_lit] = STATE(31), + [sym_sqr_tup_lit] = STATE(31), + [sym_qq_lit] = STATE(31), + [sym_quote_lit] = STATE(31), + [sym_short_fn_lit] = STATE(31), + [sym_splice_lit] = STATE(31), + [sym_unquote_lit] = STATE(31), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(154), + [aux_sym_kwd_lit_token1] = ACTIONS(9), + [sym_nil_lit] = ACTIONS(154), + [sym__dec] = ACTIONS(11), + [sym__hex] = ACTIONS(11), + [sym__radix] = ACTIONS(11), + [sym_str_lit] = ACTIONS(156), + [sym_buf_lit] = ACTIONS(156), + [sym_sym_lit] = ACTIONS(154), + [anon_sym_AT_LPAREN] = ACTIONS(15), + [anon_sym_AT_LBRACK] = ACTIONS(17), + [anon_sym_LBRACE] = ACTIONS(19), + [anon_sym_AT_LBRACE] = ACTIONS(21), + [anon_sym_LPAREN] = ACTIONS(23), + [anon_sym_LBRACK] = ACTIONS(25), + [anon_sym_TILDE] = ACTIONS(27), + [anon_sym_SQUOTE] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_SEMI] = ACTIONS(33), + [anon_sym_COMMA] = ACTIONS(35), + [sym_long_buf_lit] = ACTIONS(156), + [sym_long_str_lit] = ACTIONS(156), + }, + [21] = { + [ts_builtin_sym_end] = ACTIONS(158), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(160), + [aux_sym_kwd_lit_token1] = ACTIONS(158), + [sym_nil_lit] = ACTIONS(160), + [sym__dec] = ACTIONS(160), + [sym__hex] = ACTIONS(160), + [sym__radix] = ACTIONS(160), + [sym_str_lit] = ACTIONS(158), + [sym_buf_lit] = ACTIONS(158), + [sym_sym_lit] = ACTIONS(160), + [anon_sym_AT_LPAREN] = ACTIONS(158), + [anon_sym_RPAREN] = ACTIONS(158), + [anon_sym_AT_LBRACK] = ACTIONS(158), + [anon_sym_RBRACK] = ACTIONS(158), + [anon_sym_LBRACE] = ACTIONS(158), + [anon_sym_RBRACE] = ACTIONS(158), + [anon_sym_AT_LBRACE] = ACTIONS(158), + [anon_sym_LPAREN] = ACTIONS(158), + [anon_sym_LBRACK] = ACTIONS(158), + [anon_sym_TILDE] = ACTIONS(158), + [anon_sym_SQUOTE] = ACTIONS(158), + [anon_sym_PIPE] = ACTIONS(158), + [anon_sym_SEMI] = ACTIONS(158), + [anon_sym_COMMA] = ACTIONS(158), + [sym_long_buf_lit] = ACTIONS(158), + [sym_long_str_lit] = ACTIONS(158), + }, + [22] = { + [ts_builtin_sym_end] = ACTIONS(162), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(164), + [aux_sym_kwd_lit_token1] = ACTIONS(162), + [sym_nil_lit] = ACTIONS(164), + [sym__dec] = ACTIONS(164), + [sym__hex] = ACTIONS(164), + [sym__radix] = ACTIONS(164), + [sym_str_lit] = ACTIONS(162), + [sym_buf_lit] = ACTIONS(162), + [sym_sym_lit] = ACTIONS(164), + [anon_sym_AT_LPAREN] = ACTIONS(162), + [anon_sym_RPAREN] = ACTIONS(162), + [anon_sym_AT_LBRACK] = ACTIONS(162), + [anon_sym_RBRACK] = ACTIONS(162), + [anon_sym_LBRACE] = ACTIONS(162), + [anon_sym_RBRACE] = ACTIONS(162), + [anon_sym_AT_LBRACE] = ACTIONS(162), + [anon_sym_LPAREN] = ACTIONS(162), + [anon_sym_LBRACK] = ACTIONS(162), + [anon_sym_TILDE] = ACTIONS(162), + [anon_sym_SQUOTE] = ACTIONS(162), + [anon_sym_PIPE] = ACTIONS(162), + [anon_sym_SEMI] = ACTIONS(162), + [anon_sym_COMMA] = ACTIONS(162), + [sym_long_buf_lit] = ACTIONS(162), + [sym_long_str_lit] = ACTIONS(162), + }, + [23] = { + [ts_builtin_sym_end] = ACTIONS(166), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(168), + [aux_sym_kwd_lit_token1] = ACTIONS(166), + [sym_nil_lit] = ACTIONS(168), + [sym__dec] = ACTIONS(168), + [sym__hex] = ACTIONS(168), + [sym__radix] = ACTIONS(168), + [sym_str_lit] = ACTIONS(166), + [sym_buf_lit] = ACTIONS(166), + [sym_sym_lit] = ACTIONS(168), + [anon_sym_AT_LPAREN] = ACTIONS(166), + [anon_sym_RPAREN] = ACTIONS(166), + [anon_sym_AT_LBRACK] = ACTIONS(166), + [anon_sym_RBRACK] = ACTIONS(166), + [anon_sym_LBRACE] = ACTIONS(166), + [anon_sym_RBRACE] = ACTIONS(166), + [anon_sym_AT_LBRACE] = ACTIONS(166), + [anon_sym_LPAREN] = ACTIONS(166), + [anon_sym_LBRACK] = ACTIONS(166), + [anon_sym_TILDE] = ACTIONS(166), + [anon_sym_SQUOTE] = ACTIONS(166), + [anon_sym_PIPE] = ACTIONS(166), + [anon_sym_SEMI] = ACTIONS(166), + [anon_sym_COMMA] = ACTIONS(166), + [sym_long_buf_lit] = ACTIONS(166), + [sym_long_str_lit] = ACTIONS(166), + }, + [24] = { + [ts_builtin_sym_end] = ACTIONS(170), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(172), + [aux_sym_kwd_lit_token1] = ACTIONS(170), + [sym_nil_lit] = ACTIONS(172), + [sym__dec] = ACTIONS(172), + [sym__hex] = ACTIONS(172), + [sym__radix] = ACTIONS(172), + [sym_str_lit] = ACTIONS(170), + [sym_buf_lit] = ACTIONS(170), + [sym_sym_lit] = ACTIONS(172), + [anon_sym_AT_LPAREN] = ACTIONS(170), + [anon_sym_RPAREN] = ACTIONS(170), + [anon_sym_AT_LBRACK] = ACTIONS(170), + [anon_sym_RBRACK] = ACTIONS(170), + [anon_sym_LBRACE] = ACTIONS(170), + [anon_sym_RBRACE] = ACTIONS(170), + [anon_sym_AT_LBRACE] = ACTIONS(170), + [anon_sym_LPAREN] = ACTIONS(170), + [anon_sym_LBRACK] = ACTIONS(170), + [anon_sym_TILDE] = ACTIONS(170), + [anon_sym_SQUOTE] = ACTIONS(170), + [anon_sym_PIPE] = ACTIONS(170), + [anon_sym_SEMI] = ACTIONS(170), + [anon_sym_COMMA] = ACTIONS(170), + [sym_long_buf_lit] = ACTIONS(170), + [sym_long_str_lit] = ACTIONS(170), + }, + [25] = { + [ts_builtin_sym_end] = ACTIONS(174), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(176), + [aux_sym_kwd_lit_token1] = ACTIONS(174), + [sym_nil_lit] = ACTIONS(176), + [sym__dec] = ACTIONS(176), + [sym__hex] = ACTIONS(176), + [sym__radix] = ACTIONS(176), + [sym_str_lit] = ACTIONS(174), + [sym_buf_lit] = ACTIONS(174), + [sym_sym_lit] = ACTIONS(176), + [anon_sym_AT_LPAREN] = ACTIONS(174), + [anon_sym_RPAREN] = ACTIONS(174), + [anon_sym_AT_LBRACK] = ACTIONS(174), + [anon_sym_RBRACK] = ACTIONS(174), + [anon_sym_LBRACE] = ACTIONS(174), + [anon_sym_RBRACE] = ACTIONS(174), + [anon_sym_AT_LBRACE] = ACTIONS(174), + [anon_sym_LPAREN] = ACTIONS(174), + [anon_sym_LBRACK] = ACTIONS(174), + [anon_sym_TILDE] = ACTIONS(174), + [anon_sym_SQUOTE] = ACTIONS(174), + [anon_sym_PIPE] = ACTIONS(174), + [anon_sym_SEMI] = ACTIONS(174), + [anon_sym_COMMA] = ACTIONS(174), + [sym_long_buf_lit] = ACTIONS(174), + [sym_long_str_lit] = ACTIONS(174), + }, + [26] = { + [ts_builtin_sym_end] = ACTIONS(178), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(180), + [aux_sym_kwd_lit_token1] = ACTIONS(178), + [sym_nil_lit] = ACTIONS(180), + [sym__dec] = ACTIONS(180), + [sym__hex] = ACTIONS(180), + [sym__radix] = ACTIONS(180), + [sym_str_lit] = ACTIONS(178), + [sym_buf_lit] = ACTIONS(178), + [sym_sym_lit] = ACTIONS(180), + [anon_sym_AT_LPAREN] = ACTIONS(178), + [anon_sym_RPAREN] = ACTIONS(178), + [anon_sym_AT_LBRACK] = ACTIONS(178), + [anon_sym_RBRACK] = ACTIONS(178), + [anon_sym_LBRACE] = ACTIONS(178), + [anon_sym_RBRACE] = ACTIONS(178), + [anon_sym_AT_LBRACE] = ACTIONS(178), + [anon_sym_LPAREN] = ACTIONS(178), + [anon_sym_LBRACK] = ACTIONS(178), + [anon_sym_TILDE] = ACTIONS(178), + [anon_sym_SQUOTE] = ACTIONS(178), + [anon_sym_PIPE] = ACTIONS(178), + [anon_sym_SEMI] = ACTIONS(178), + [anon_sym_COMMA] = ACTIONS(178), + [sym_long_buf_lit] = ACTIONS(178), + [sym_long_str_lit] = ACTIONS(178), + }, + [27] = { + [ts_builtin_sym_end] = ACTIONS(182), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(184), + [aux_sym_kwd_lit_token1] = ACTIONS(182), + [sym_nil_lit] = ACTIONS(184), + [sym__dec] = ACTIONS(184), + [sym__hex] = ACTIONS(184), + [sym__radix] = ACTIONS(184), + [sym_str_lit] = ACTIONS(182), + [sym_buf_lit] = ACTIONS(182), + [sym_sym_lit] = ACTIONS(184), + [anon_sym_AT_LPAREN] = ACTIONS(182), + [anon_sym_RPAREN] = ACTIONS(182), + [anon_sym_AT_LBRACK] = ACTIONS(182), + [anon_sym_RBRACK] = ACTIONS(182), + [anon_sym_LBRACE] = ACTIONS(182), + [anon_sym_RBRACE] = ACTIONS(182), + [anon_sym_AT_LBRACE] = ACTIONS(182), + [anon_sym_LPAREN] = ACTIONS(182), + [anon_sym_LBRACK] = ACTIONS(182), + [anon_sym_TILDE] = ACTIONS(182), + [anon_sym_SQUOTE] = ACTIONS(182), + [anon_sym_PIPE] = ACTIONS(182), + [anon_sym_SEMI] = ACTIONS(182), + [anon_sym_COMMA] = ACTIONS(182), + [sym_long_buf_lit] = ACTIONS(182), + [sym_long_str_lit] = ACTIONS(182), + }, + [28] = { + [ts_builtin_sym_end] = ACTIONS(186), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(188), + [aux_sym_kwd_lit_token1] = ACTIONS(186), + [sym_nil_lit] = ACTIONS(188), + [sym__dec] = ACTIONS(188), + [sym__hex] = ACTIONS(188), + [sym__radix] = ACTIONS(188), + [sym_str_lit] = ACTIONS(186), + [sym_buf_lit] = ACTIONS(186), + [sym_sym_lit] = ACTIONS(188), + [anon_sym_AT_LPAREN] = ACTIONS(186), + [anon_sym_RPAREN] = ACTIONS(186), + [anon_sym_AT_LBRACK] = ACTIONS(186), + [anon_sym_RBRACK] = ACTIONS(186), + [anon_sym_LBRACE] = ACTIONS(186), + [anon_sym_RBRACE] = ACTIONS(186), + [anon_sym_AT_LBRACE] = ACTIONS(186), + [anon_sym_LPAREN] = ACTIONS(186), + [anon_sym_LBRACK] = ACTIONS(186), + [anon_sym_TILDE] = ACTIONS(186), + [anon_sym_SQUOTE] = ACTIONS(186), + [anon_sym_PIPE] = ACTIONS(186), + [anon_sym_SEMI] = ACTIONS(186), + [anon_sym_COMMA] = ACTIONS(186), + [sym_long_buf_lit] = ACTIONS(186), + [sym_long_str_lit] = ACTIONS(186), + }, + [29] = { + [ts_builtin_sym_end] = ACTIONS(190), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(192), + [aux_sym_kwd_lit_token1] = ACTIONS(190), + [sym_nil_lit] = ACTIONS(192), + [sym__dec] = ACTIONS(192), + [sym__hex] = ACTIONS(192), + [sym__radix] = ACTIONS(192), + [sym_str_lit] = ACTIONS(190), + [sym_buf_lit] = ACTIONS(190), + [sym_sym_lit] = ACTIONS(192), + [anon_sym_AT_LPAREN] = ACTIONS(190), + [anon_sym_RPAREN] = ACTIONS(190), + [anon_sym_AT_LBRACK] = ACTIONS(190), + [anon_sym_RBRACK] = ACTIONS(190), + [anon_sym_LBRACE] = ACTIONS(190), + [anon_sym_RBRACE] = ACTIONS(190), + [anon_sym_AT_LBRACE] = ACTIONS(190), + [anon_sym_LPAREN] = ACTIONS(190), + [anon_sym_LBRACK] = ACTIONS(190), + [anon_sym_TILDE] = ACTIONS(190), + [anon_sym_SQUOTE] = ACTIONS(190), + [anon_sym_PIPE] = ACTIONS(190), + [anon_sym_SEMI] = ACTIONS(190), + [anon_sym_COMMA] = ACTIONS(190), + [sym_long_buf_lit] = ACTIONS(190), + [sym_long_str_lit] = ACTIONS(190), + }, + [30] = { + [ts_builtin_sym_end] = ACTIONS(194), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(196), + [aux_sym_kwd_lit_token1] = ACTIONS(194), + [sym_nil_lit] = ACTIONS(196), + [sym__dec] = ACTIONS(196), + [sym__hex] = ACTIONS(196), + [sym__radix] = ACTIONS(196), + [sym_str_lit] = ACTIONS(194), + [sym_buf_lit] = ACTIONS(194), + [sym_sym_lit] = ACTIONS(196), + [anon_sym_AT_LPAREN] = ACTIONS(194), + [anon_sym_RPAREN] = ACTIONS(194), + [anon_sym_AT_LBRACK] = ACTIONS(194), + [anon_sym_RBRACK] = ACTIONS(194), + [anon_sym_LBRACE] = ACTIONS(194), + [anon_sym_RBRACE] = ACTIONS(194), + [anon_sym_AT_LBRACE] = ACTIONS(194), + [anon_sym_LPAREN] = ACTIONS(194), + [anon_sym_LBRACK] = ACTIONS(194), + [anon_sym_TILDE] = ACTIONS(194), + [anon_sym_SQUOTE] = ACTIONS(194), + [anon_sym_PIPE] = ACTIONS(194), + [anon_sym_SEMI] = ACTIONS(194), + [anon_sym_COMMA] = ACTIONS(194), + [sym_long_buf_lit] = ACTIONS(194), + [sym_long_str_lit] = ACTIONS(194), + }, + [31] = { + [ts_builtin_sym_end] = ACTIONS(198), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(200), + [aux_sym_kwd_lit_token1] = ACTIONS(198), + [sym_nil_lit] = ACTIONS(200), + [sym__dec] = ACTIONS(200), + [sym__hex] = ACTIONS(200), + [sym__radix] = ACTIONS(200), + [sym_str_lit] = ACTIONS(198), + [sym_buf_lit] = ACTIONS(198), + [sym_sym_lit] = ACTIONS(200), + [anon_sym_AT_LPAREN] = ACTIONS(198), + [anon_sym_RPAREN] = ACTIONS(198), + [anon_sym_AT_LBRACK] = ACTIONS(198), + [anon_sym_RBRACK] = ACTIONS(198), + [anon_sym_LBRACE] = ACTIONS(198), + [anon_sym_RBRACE] = ACTIONS(198), + [anon_sym_AT_LBRACE] = ACTIONS(198), + [anon_sym_LPAREN] = ACTIONS(198), + [anon_sym_LBRACK] = ACTIONS(198), + [anon_sym_TILDE] = ACTIONS(198), + [anon_sym_SQUOTE] = ACTIONS(198), + [anon_sym_PIPE] = ACTIONS(198), + [anon_sym_SEMI] = ACTIONS(198), + [anon_sym_COMMA] = ACTIONS(198), + [sym_long_buf_lit] = ACTIONS(198), + [sym_long_str_lit] = ACTIONS(198), + }, + [32] = { + [ts_builtin_sym_end] = ACTIONS(202), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(204), + [aux_sym_kwd_lit_token1] = ACTIONS(202), + [sym_nil_lit] = ACTIONS(204), + [sym__dec] = ACTIONS(204), + [sym__hex] = ACTIONS(204), + [sym__radix] = ACTIONS(204), + [sym_str_lit] = ACTIONS(202), + [sym_buf_lit] = ACTIONS(202), + [sym_sym_lit] = ACTIONS(204), + [anon_sym_AT_LPAREN] = ACTIONS(202), + [anon_sym_RPAREN] = ACTIONS(202), + [anon_sym_AT_LBRACK] = ACTIONS(202), + [anon_sym_RBRACK] = ACTIONS(202), + [anon_sym_LBRACE] = ACTIONS(202), + [anon_sym_RBRACE] = ACTIONS(202), + [anon_sym_AT_LBRACE] = ACTIONS(202), + [anon_sym_LPAREN] = ACTIONS(202), + [anon_sym_LBRACK] = ACTIONS(202), + [anon_sym_TILDE] = ACTIONS(202), + [anon_sym_SQUOTE] = ACTIONS(202), + [anon_sym_PIPE] = ACTIONS(202), + [anon_sym_SEMI] = ACTIONS(202), + [anon_sym_COMMA] = ACTIONS(202), + [sym_long_buf_lit] = ACTIONS(202), + [sym_long_str_lit] = ACTIONS(202), + }, + [33] = { + [ts_builtin_sym_end] = ACTIONS(206), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(208), + [aux_sym_kwd_lit_token1] = ACTIONS(206), + [sym_nil_lit] = ACTIONS(208), + [sym__dec] = ACTIONS(208), + [sym__hex] = ACTIONS(208), + [sym__radix] = ACTIONS(208), + [sym_str_lit] = ACTIONS(206), + [sym_buf_lit] = ACTIONS(206), + [sym_sym_lit] = ACTIONS(208), + [anon_sym_AT_LPAREN] = ACTIONS(206), + [anon_sym_RPAREN] = ACTIONS(206), + [anon_sym_AT_LBRACK] = ACTIONS(206), + [anon_sym_RBRACK] = ACTIONS(206), + [anon_sym_LBRACE] = ACTIONS(206), + [anon_sym_RBRACE] = ACTIONS(206), + [anon_sym_AT_LBRACE] = ACTIONS(206), + [anon_sym_LPAREN] = ACTIONS(206), + [anon_sym_LBRACK] = ACTIONS(206), + [anon_sym_TILDE] = ACTIONS(206), + [anon_sym_SQUOTE] = ACTIONS(206), + [anon_sym_PIPE] = ACTIONS(206), + [anon_sym_SEMI] = ACTIONS(206), + [anon_sym_COMMA] = ACTIONS(206), + [sym_long_buf_lit] = ACTIONS(206), + [sym_long_str_lit] = ACTIONS(206), + }, + [34] = { + [ts_builtin_sym_end] = ACTIONS(210), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(212), + [aux_sym_kwd_lit_token1] = ACTIONS(210), + [sym_nil_lit] = ACTIONS(212), + [sym__dec] = ACTIONS(212), + [sym__hex] = ACTIONS(212), + [sym__radix] = ACTIONS(212), + [sym_str_lit] = ACTIONS(210), + [sym_buf_lit] = ACTIONS(210), + [sym_sym_lit] = ACTIONS(212), + [anon_sym_AT_LPAREN] = ACTIONS(210), + [anon_sym_RPAREN] = ACTIONS(210), + [anon_sym_AT_LBRACK] = ACTIONS(210), + [anon_sym_RBRACK] = ACTIONS(210), + [anon_sym_LBRACE] = ACTIONS(210), + [anon_sym_RBRACE] = ACTIONS(210), + [anon_sym_AT_LBRACE] = ACTIONS(210), + [anon_sym_LPAREN] = ACTIONS(210), + [anon_sym_LBRACK] = ACTIONS(210), + [anon_sym_TILDE] = ACTIONS(210), + [anon_sym_SQUOTE] = ACTIONS(210), + [anon_sym_PIPE] = ACTIONS(210), + [anon_sym_SEMI] = ACTIONS(210), + [anon_sym_COMMA] = ACTIONS(210), + [sym_long_buf_lit] = ACTIONS(210), + [sym_long_str_lit] = ACTIONS(210), + }, + [35] = { + [ts_builtin_sym_end] = ACTIONS(214), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(216), + [aux_sym_kwd_lit_token1] = ACTIONS(214), + [sym_nil_lit] = ACTIONS(216), + [sym__dec] = ACTIONS(216), + [sym__hex] = ACTIONS(216), + [sym__radix] = ACTIONS(216), + [sym_str_lit] = ACTIONS(214), + [sym_buf_lit] = ACTIONS(214), + [sym_sym_lit] = ACTIONS(216), + [anon_sym_AT_LPAREN] = ACTIONS(214), + [anon_sym_RPAREN] = ACTIONS(214), + [anon_sym_AT_LBRACK] = ACTIONS(214), + [anon_sym_RBRACK] = ACTIONS(214), + [anon_sym_LBRACE] = ACTIONS(214), + [anon_sym_RBRACE] = ACTIONS(214), + [anon_sym_AT_LBRACE] = ACTIONS(214), + [anon_sym_LPAREN] = ACTIONS(214), + [anon_sym_LBRACK] = ACTIONS(214), + [anon_sym_TILDE] = ACTIONS(214), + [anon_sym_SQUOTE] = ACTIONS(214), + [anon_sym_PIPE] = ACTIONS(214), + [anon_sym_SEMI] = ACTIONS(214), + [anon_sym_COMMA] = ACTIONS(214), + [sym_long_buf_lit] = ACTIONS(214), + [sym_long_str_lit] = ACTIONS(214), + }, + [36] = { + [ts_builtin_sym_end] = ACTIONS(218), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(220), + [aux_sym_kwd_lit_token1] = ACTIONS(218), + [sym_nil_lit] = ACTIONS(220), + [sym__dec] = ACTIONS(220), + [sym__hex] = ACTIONS(220), + [sym__radix] = ACTIONS(220), + [sym_str_lit] = ACTIONS(218), + [sym_buf_lit] = ACTIONS(218), + [sym_sym_lit] = ACTIONS(220), + [anon_sym_AT_LPAREN] = ACTIONS(218), + [anon_sym_RPAREN] = ACTIONS(218), + [anon_sym_AT_LBRACK] = ACTIONS(218), + [anon_sym_RBRACK] = ACTIONS(218), + [anon_sym_LBRACE] = ACTIONS(218), + [anon_sym_RBRACE] = ACTIONS(218), + [anon_sym_AT_LBRACE] = ACTIONS(218), + [anon_sym_LPAREN] = ACTIONS(218), + [anon_sym_LBRACK] = ACTIONS(218), + [anon_sym_TILDE] = ACTIONS(218), + [anon_sym_SQUOTE] = ACTIONS(218), + [anon_sym_PIPE] = ACTIONS(218), + [anon_sym_SEMI] = ACTIONS(218), + [anon_sym_COMMA] = ACTIONS(218), + [sym_long_buf_lit] = ACTIONS(218), + [sym_long_str_lit] = ACTIONS(218), + }, + [37] = { + [ts_builtin_sym_end] = ACTIONS(222), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(224), + [aux_sym_kwd_lit_token1] = ACTIONS(222), + [sym_nil_lit] = ACTIONS(224), + [sym__dec] = ACTIONS(224), + [sym__hex] = ACTIONS(224), + [sym__radix] = ACTIONS(224), + [sym_str_lit] = ACTIONS(222), + [sym_buf_lit] = ACTIONS(222), + [sym_sym_lit] = ACTIONS(224), + [anon_sym_AT_LPAREN] = ACTIONS(222), + [anon_sym_RPAREN] = ACTIONS(222), + [anon_sym_AT_LBRACK] = ACTIONS(222), + [anon_sym_RBRACK] = ACTIONS(222), + [anon_sym_LBRACE] = ACTIONS(222), + [anon_sym_RBRACE] = ACTIONS(222), + [anon_sym_AT_LBRACE] = ACTIONS(222), + [anon_sym_LPAREN] = ACTIONS(222), + [anon_sym_LBRACK] = ACTIONS(222), + [anon_sym_TILDE] = ACTIONS(222), + [anon_sym_SQUOTE] = ACTIONS(222), + [anon_sym_PIPE] = ACTIONS(222), + [anon_sym_SEMI] = ACTIONS(222), + [anon_sym_COMMA] = ACTIONS(222), + [sym_long_buf_lit] = ACTIONS(222), + [sym_long_str_lit] = ACTIONS(222), + }, + [38] = { + [ts_builtin_sym_end] = ACTIONS(226), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(228), + [aux_sym_kwd_lit_token1] = ACTIONS(226), + [sym_nil_lit] = ACTIONS(228), + [sym__dec] = ACTIONS(228), + [sym__hex] = ACTIONS(228), + [sym__radix] = ACTIONS(228), + [sym_str_lit] = ACTIONS(226), + [sym_buf_lit] = ACTIONS(226), + [sym_sym_lit] = ACTIONS(228), + [anon_sym_AT_LPAREN] = ACTIONS(226), + [anon_sym_RPAREN] = ACTIONS(226), + [anon_sym_AT_LBRACK] = ACTIONS(226), + [anon_sym_RBRACK] = ACTIONS(226), + [anon_sym_LBRACE] = ACTIONS(226), + [anon_sym_RBRACE] = ACTIONS(226), + [anon_sym_AT_LBRACE] = ACTIONS(226), + [anon_sym_LPAREN] = ACTIONS(226), + [anon_sym_LBRACK] = ACTIONS(226), + [anon_sym_TILDE] = ACTIONS(226), + [anon_sym_SQUOTE] = ACTIONS(226), + [anon_sym_PIPE] = ACTIONS(226), + [anon_sym_SEMI] = ACTIONS(226), + [anon_sym_COMMA] = ACTIONS(226), + [sym_long_buf_lit] = ACTIONS(226), + [sym_long_str_lit] = ACTIONS(226), + }, + [39] = { + [ts_builtin_sym_end] = ACTIONS(230), + [sym_comment] = ACTIONS(3), + [sym_bool_lit] = ACTIONS(232), + [aux_sym_kwd_lit_token1] = ACTIONS(230), + [sym_nil_lit] = ACTIONS(232), + [sym__dec] = ACTIONS(232), + [sym__hex] = ACTIONS(232), + [sym__radix] = ACTIONS(232), + [sym_str_lit] = ACTIONS(230), + [sym_buf_lit] = ACTIONS(230), + [sym_sym_lit] = ACTIONS(232), + [anon_sym_AT_LPAREN] = ACTIONS(230), + [anon_sym_RPAREN] = ACTIONS(230), + [anon_sym_AT_LBRACK] = ACTIONS(230), + [anon_sym_RBRACK] = ACTIONS(230), + [anon_sym_LBRACE] = ACTIONS(230), + [anon_sym_RBRACE] = ACTIONS(230), + [anon_sym_AT_LBRACE] = ACTIONS(230), + [anon_sym_LPAREN] = ACTIONS(230), + [anon_sym_LBRACK] = ACTIONS(230), + [anon_sym_TILDE] = ACTIONS(230), + [anon_sym_SQUOTE] = ACTIONS(230), + [anon_sym_PIPE] = ACTIONS(230), + [anon_sym_SEMI] = ACTIONS(230), + [anon_sym_COMMA] = ACTIONS(230), + [sym_long_buf_lit] = ACTIONS(230), + [sym_long_str_lit] = ACTIONS(230), + }, +}; + +static uint16_t ts_small_parse_table[] = { + [0] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(234), 1, + ts_builtin_sym_end, +}; + +static uint32_t ts_small_parse_table_map[] = { + [SMALL_STATE(40)] = 0, +}; + +static TSParseActionEntry ts_parse_actions[] = { + [0] = {.entry = {.count = 0, .reusable = false}}, + [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), + [3] = {.entry = {.count = 1, .reusable = true}}, SHIFT_EXTRA(), + [5] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 0), + [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(3), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), + [11] = {.entry = {.count = 1, .reusable = false}}, SHIFT(33), + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), + [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), + [17] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6), + [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7), + [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(8), + [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), + [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(10), + [27] = {.entry = {.count = 1, .reusable = true}}, SHIFT(16), + [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), + [31] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), + [33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), + [35] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), + [37] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), + [39] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(2), + [42] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(24), + [45] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(33), + [48] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(2), + [51] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(5), + [54] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(6), + [57] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(7), + [60] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(8), + [63] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(9), + [66] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(10), + [69] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(16), + [72] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(18), + [75] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(19), + [78] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(20), + [81] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_repeat1, 2), SHIFT_REPEAT(17), + [84] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source, 1), + [86] = {.entry = {.count = 1, .reusable = false}}, SHIFT(2), + [88] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), + [90] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), + [92] = {.entry = {.count = 1, .reusable = false}}, SHIFT(15), + [94] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15), + [96] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), + [98] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), + [100] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14), + [102] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), + [104] = {.entry = {.count = 1, .reusable = false}}, SHIFT(13), + [106] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13), + [108] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), + [110] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), + [112] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), + [114] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [116] = {.entry = {.count = 1, .reusable = false}}, SHIFT(11), + [118] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), + [120] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [122] = {.entry = {.count = 1, .reusable = false}}, SHIFT(4), + [124] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [126] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), + [128] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), + [130] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), + [132] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), + [134] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), + [136] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), + [138] = {.entry = {.count = 1, .reusable = false}}, SHIFT(21), + [140] = {.entry = {.count = 1, .reusable = true}}, SHIFT(21), + [142] = {.entry = {.count = 1, .reusable = false}}, SHIFT(32), + [144] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), + [146] = {.entry = {.count = 1, .reusable = false}}, SHIFT(29), + [148] = {.entry = {.count = 1, .reusable = true}}, SHIFT(29), + [150] = {.entry = {.count = 1, .reusable = false}}, SHIFT(30), + [152] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), + [154] = {.entry = {.count = 1, .reusable = false}}, SHIFT(31), + [156] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), + [158] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_qq_lit, 2), + [160] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_qq_lit, 2), + [162] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_lit, 2), + [164] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_struct_lit, 2), + [166] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tbl_lit, 2), + [168] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tbl_lit, 2), + [170] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_kwd_lit, 1), + [172] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_kwd_lit, 1), + [174] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_par_tup_lit, 2), + [176] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_par_tup_lit, 2), + [178] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sqr_tup_lit, 2), + [180] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sqr_tup_lit, 2), + [182] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sqr_arr_lit, 2), + [184] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sqr_arr_lit, 2), + [186] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_par_arr_lit, 2), + [188] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_par_arr_lit, 2), + [190] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_quote_lit, 2), + [192] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_quote_lit, 2), + [194] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_short_fn_lit, 2), + [196] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_short_fn_lit, 2), + [198] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_splice_lit, 2), + [200] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_splice_lit, 2), + [202] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_unquote_lit, 2), + [204] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_unquote_lit, 2), + [206] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_num_lit, 1), + [208] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_num_lit, 1), + [210] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_par_arr_lit, 3), + [212] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_par_arr_lit, 3), + [214] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sqr_arr_lit, 3), + [216] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sqr_arr_lit, 3), + [218] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_struct_lit, 3), + [220] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_struct_lit, 3), + [222] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tbl_lit, 3), + [224] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tbl_lit, 3), + [226] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_par_tup_lit, 3), + [228] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_par_tup_lit, 3), + [230] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_sqr_tup_lit, 3), + [232] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_sqr_tup_lit, 3), + [234] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), +}; + +#ifdef __cplusplus +extern "C" { +#endif +void *tree_sitter_janet_simple_external_scanner_create(void); +void tree_sitter_janet_simple_external_scanner_destroy(void *); +bool tree_sitter_janet_simple_external_scanner_scan(void *, TSLexer *, const bool *); +unsigned tree_sitter_janet_simple_external_scanner_serialize(void *, char *); +void tree_sitter_janet_simple_external_scanner_deserialize(void *, const char *, unsigned); + +#ifdef _WIN32 +#define extern __declspec(dllexport) +#endif + +extern const TSLanguage *tree_sitter_janet_simple(void) { + static TSLanguage language = { + .version = LANGUAGE_VERSION, + .symbol_count = SYMBOL_COUNT, + .alias_count = ALIAS_COUNT, + .token_count = TOKEN_COUNT, + .external_token_count = EXTERNAL_TOKEN_COUNT, + .state_count = STATE_COUNT, + .large_state_count = LARGE_STATE_COUNT, + .production_id_count = PRODUCTION_ID_COUNT, + .field_count = FIELD_COUNT, + .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH, + .parse_table = (const uint16_t *)ts_parse_table, + .small_parse_table = (const uint16_t *)ts_small_parse_table, + .small_parse_table_map = (const uint32_t *)ts_small_parse_table_map, + .parse_actions = ts_parse_actions, + .symbol_names = ts_symbol_names, + .symbol_metadata = ts_symbol_metadata, + .public_symbol_map = ts_symbol_map, + .alias_map = ts_non_terminal_alias_map, + .alias_sequences = (const TSSymbol *)ts_alias_sequences, + .lex_modes = ts_lex_modes, + .lex_fn = ts_lex, + .external_scanner = { + (const bool *)ts_external_scanner_states, + ts_external_scanner_symbol_map, + tree_sitter_janet_simple_external_scanner_create, + tree_sitter_janet_simple_external_scanner_destroy, + tree_sitter_janet_simple_external_scanner_scan, + tree_sitter_janet_simple_external_scanner_serialize, + tree_sitter_janet_simple_external_scanner_deserialize, + }, + }; + return &language; +} +#ifdef __cplusplus +} +#endif diff --git a/vendor/tree-sitter-janet-simple/src/scanner.c b/vendor/tree-sitter-janet-simple/src/scanner.c new file mode 100644 index 000000000..cb6ab1b85 --- /dev/null +++ b/vendor/tree-sitter-janet-simple/src/scanner.c @@ -0,0 +1,111 @@ +#include +#include + +enum TokenType { + LONG_BUF_LIT, + LONG_STR_LIT +}; + +void* tree_sitter_janet_simple_external_scanner_create( + void +) +{ + return NULL; +} + +void tree_sitter_janet_simple_external_scanner_destroy( + void* payload +) +{ +} + +void tree_sitter_janet_simple_external_scanner_reset( + void* payload +) +{ +} + +unsigned tree_sitter_janet_simple_external_scanner_serialize( + void* payload, + char* buffer +) +{ + return 0; +} + +void tree_sitter_janet_simple_external_scanner_deserialize( + void *payload, + const char *buffer, + unsigned length +) +{ +} + +bool tree_sitter_janet_simple_external_scanner_scan( + void *payload, + TSLexer *lexer, + const bool *valid_symbols +) +{ + // skip a bit brother + while (iswspace(lexer->lookahead)) { + lexer->advance(lexer, true); + } + // there can be only...two? + if (valid_symbols[LONG_BUF_LIT] || valid_symbols[LONG_STR_LIT]) { + // so which one was it? + if (lexer->lookahead == '@') { + lexer->result_symbol = LONG_BUF_LIT; + lexer->advance(lexer, false); + } else { + lexer->result_symbol = LONG_STR_LIT; + } + // long strings start with one or more backticks + // consume the first backtick + if (lexer->lookahead != '`') { + return false; + } + // getting here means a backtick was encountered + lexer->advance(lexer, false); + uint32_t n_backticks = 1; + // arrive at a total number of backticks + for (;;) { + if (lexer->lookahead == 0) { + return false; + } + // found one! + if (lexer->lookahead == '`') { + n_backticks++; + lexer->advance(lexer, false); + continue; + } else { // nope, time to bail + lexer->advance(lexer, false); + break; + } + } + // getting here means the last character examined was NOT a backtick. + // now keep looking until n_backticks are found + uint32_t cbt = 0; // consecutive backticks + for (;;) { + if (lexer->lookahead == 0) { + return false; + } + // found one! + if (lexer->lookahead == '`') { + cbt++; + // are we there yet? + if (cbt == n_backticks) { + lexer->advance(lexer, false); + return true; + } + } else { // nope, better reset the count + cbt = 0; + } + // next! + lexer->advance(lexer, false); + } + + } + + return false; +} diff --git a/vendor/tree-sitter-janet-simple/src/tree_sitter/parser.h b/vendor/tree-sitter-janet-simple/src/tree_sitter/parser.h new file mode 100644 index 000000000..a3a87bd1d --- /dev/null +++ b/vendor/tree-sitter-janet-simple/src/tree_sitter/parser.h @@ -0,0 +1,223 @@ +#ifndef TREE_SITTER_PARSER_H_ +#define TREE_SITTER_PARSER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#define ts_builtin_sym_error ((TSSymbol)-1) +#define ts_builtin_sym_end 0 +#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024 + +typedef uint16_t TSStateId; + +#ifndef TREE_SITTER_API_H_ +typedef uint16_t TSSymbol; +typedef uint16_t TSFieldId; +typedef struct TSLanguage TSLanguage; +#endif + +typedef struct { + TSFieldId field_id; + uint8_t child_index; + bool inherited; +} TSFieldMapEntry; + +typedef struct { + uint16_t index; + uint16_t length; +} TSFieldMapSlice; + +typedef struct { + bool visible; + bool named; + bool supertype; +} TSSymbolMetadata; + +typedef struct TSLexer TSLexer; + +struct TSLexer { + int32_t lookahead; + TSSymbol result_symbol; + void (*advance)(TSLexer *, bool); + void (*mark_end)(TSLexer *); + uint32_t (*get_column)(TSLexer *); + bool (*is_at_included_range_start)(const TSLexer *); + bool (*eof)(const TSLexer *); +}; + +typedef enum { + TSParseActionTypeShift, + TSParseActionTypeReduce, + TSParseActionTypeAccept, + TSParseActionTypeRecover, +} TSParseActionType; + +typedef union { + struct { + uint8_t type; + TSStateId state; + bool extra; + bool repetition; + } shift; + struct { + uint8_t type; + uint8_t child_count; + TSSymbol symbol; + int16_t dynamic_precedence; + uint16_t production_id; + } reduce; + uint8_t type; +} TSParseAction; + +typedef struct { + uint16_t lex_state; + uint16_t external_lex_state; +} TSLexMode; + +typedef union { + TSParseAction action; + struct { + uint8_t count; + bool reusable; + } entry; +} TSParseActionEntry; + +struct TSLanguage { + uint32_t version; + uint32_t symbol_count; + uint32_t alias_count; + uint32_t token_count; + uint32_t external_token_count; + uint32_t state_count; + uint32_t large_state_count; + uint32_t production_id_count; + uint32_t field_count; + uint16_t max_alias_sequence_length; + const uint16_t *parse_table; + const uint16_t *small_parse_table; + const uint32_t *small_parse_table_map; + const TSParseActionEntry *parse_actions; + const char **symbol_names; + const char **field_names; + const TSFieldMapSlice *field_map_slices; + const TSFieldMapEntry *field_map_entries; + const TSSymbolMetadata *symbol_metadata; + const TSSymbol *public_symbol_map; + const uint16_t *alias_map; + const TSSymbol *alias_sequences; + const TSLexMode *lex_modes; + bool (*lex_fn)(TSLexer *, TSStateId); + bool (*keyword_lex_fn)(TSLexer *, TSStateId); + TSSymbol keyword_capture_token; + struct { + const bool *states; + const TSSymbol *symbol_map; + void *(*create)(void); + void (*destroy)(void *); + bool (*scan)(void *, TSLexer *, const bool *symbol_whitelist); + unsigned (*serialize)(void *, char *); + void (*deserialize)(void *, const char *, unsigned); + } external_scanner; +}; + +/* + * Lexer Macros + */ + +#define START_LEXER() \ + bool result = false; \ + bool skip = false; \ + bool eof = false; \ + int32_t lookahead; \ + goto start; \ + next_state: \ + lexer->advance(lexer, skip); \ + start: \ + skip = false; \ + lookahead = lexer->lookahead; + +#define ADVANCE(state_value) \ + { \ + state = state_value; \ + goto next_state; \ + } + +#define SKIP(state_value) \ + { \ + skip = true; \ + state = state_value; \ + goto next_state; \ + } + +#define ACCEPT_TOKEN(symbol_value) \ + result = true; \ + lexer->result_symbol = symbol_value; \ + lexer->mark_end(lexer); + +#define END_STATE() return result; + +/* + * Parse Table Macros + */ + +#define SMALL_STATE(id) id - LARGE_STATE_COUNT + +#define STATE(id) id + +#define ACTIONS(id) id + +#define SHIFT(state_value) \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .state = state_value \ + } \ + }} + +#define SHIFT_REPEAT(state_value) \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .state = state_value, \ + .repetition = true \ + } \ + }} + +#define SHIFT_EXTRA() \ + {{ \ + .shift = { \ + .type = TSParseActionTypeShift, \ + .extra = true \ + } \ + }} + +#define REDUCE(symbol_val, child_count_val, ...) \ + {{ \ + .reduce = { \ + .type = TSParseActionTypeReduce, \ + .symbol = symbol_val, \ + .child_count = child_count_val, \ + __VA_ARGS__ \ + }, \ + }} + +#define RECOVER() \ + {{ \ + .type = TSParseActionTypeRecover \ + }} + +#define ACCEPT_INPUT() \ + {{ \ + .type = TSParseActionTypeAccept \ + }} + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_PARSER_H_