diff --git a/resources/edit_grammars.sh b/resources/edit_grammars.sh new file mode 100755 index 000000000..d53537d04 --- /dev/null +++ b/resources/edit_grammars.sh @@ -0,0 +1,115 @@ +#!/bin/bash + +set -e + +# assumes that this script is run from marzano/resources directory +rm -rf language-metavariables +mkdir language-metavariables +rsync -r -l language-submodules/. language-metavariables --exclude={.git*,tree-sitter-*/example,tree-sitter-*/test,tree-sitter-*/corpus} +cd language-metavariables + +cd tree-sitter-toml && npm install regexp-util && npx tree-sitter generate && cd .. + +# we need to make sure all the languages use the same version of tree-sitter +for cargo in */[Cc]argo.toml ; do + sed -i '' -e 's/tree-sitter = ".*"/tree-sitter = "~0.20"/g' "$cargo" +done + +cp ../metavariable-grammars/css-metavariable-grammar.js tree-sitter-css/grammar.js +cp ../metavariable-grammars/json-metavariable-grammar.js tree-sitter-json/grammar.js +cp ../metavariable-grammars/solidity-metavariable-grammar.js tree-sitter-solidity/grammar.js +cp ../metavariable-grammars/sql-metavariable-grammar.js tree-sitter-sql/grammar.js +cp ../metavariable-grammars/hcl-metavariable-grammar.js tree-sitter-hcl/make_grammar.js +cp ../metavariable-grammars/python-metavariable-grammar.js tree-sitter-python/grammar.js +cp ../metavariable-grammars/markdown-common-metavariable-grammar.js tree-sitter-markdown/common/grammar.js +cp ../metavariable-grammars/markdown-block-metavariable-grammar.js tree-sitter-markdown/tree-sitter-markdown/grammar.js +cp ../metavariable-grammars/markdown-inline-metavariable-grammar.js tree-sitter-markdown/tree-sitter-markdown-inline/grammar.js +cp ../metavariable-grammars/javascript-metavariable-grammar.js tree-sitter-javascript/grammar.js +cp ../metavariable-grammars/java-metavariable-grammar.js tree-sitter-java/grammar.js +cp ../metavariable-grammars/rust-metavariable-grammar.js tree-sitter-rust/grammar.js +cp ../metavariable-grammars/go-metavariable-grammar.js tree-sitter-go/grammar.js +cp ../metavariable-grammars/vue-metavariable-grammar.js tree-sitter-vue/grammar.js +cp ../metavariable-grammars/yaml-metavariable-grammar.js tree-sitter-yaml/grammar.js +cp ../metavariable-grammars/yaml-metavariable-scanner.cc tree-sitter-yaml/src/scanner.cc +cp ../metavariable-grammars/toml-metavariable-grammar.js tree-sitter-toml/grammar.js + +# typescript is special +# we edit the package.json to point to our local version of the js grammar +cp ../metavariable-grammars/typescript-package.json tree-sitter-typescript/package.json +# typescript defines a typescript and tsx grammar so the grammar we care about is in common/define-grammar.js +cp ../metavariable-grammars/typescript-metavariable-define-grammar.js tree-sitter-typescript/common/define-grammar.js + +# vue package.json needs to be updated to use a newer version of nan, and local version of html grammar +cp ../metavariable-grammars/vue-package.json tree-sitter-vue/package.json + +# tree-sitter hangs on c-sharp and typescript has a special file structure for tsx and typescript. +# wanted to * and exclude c-sharp and type-script but couldn't get exclusion glob to work, so just listed all the languages. + +# TODO MARKDOWN INLINE AND MARKDOWN SHOULD PROBABLY BE BUILT TOGETHER +for dir in {tree-sitter-css,tree-sitter-go,tree-sitter-hcl,tree-sitter-html,tree-sitter-java,tree-sitter-javascript,tree-sitter-json,tree-sitter-markdown/tree-sitter-markdown,tree-sitter-markdown/tree-sitter-markdown-inline,tree-sitter-python,tree-sitter-ruby,tree-sitter-rust,tree-sitter-solidity,tree-sitter-yaml,tree-sitter-toml}; + do (cd $dir && npx tree-sitter generate && npx tree-sitter build-wasm && echo "Generated grammar for ${PWD##*/}" ) & +done +cd "tree-sitter-sql" && npx tree-sitter generate && echo "Generated grammar for ${PWD##*/}" & +wait +cd tree-sitter-typescript && yarn && yarn build && echo "Generated grammar for ${PWD##*/}" +cd tsx && npx tree-sitter build-wasm; +cd .. +cd typescript && npx tree-sitter build-wasm; +cd ../.. +cd tree-sitter-vue && yarn && yarn prepack && npx tree-sitter build-wasm && echo "Generated grammar for ${PWD##*/}" +cd .. + +cp ../metavariable-grammars/cc_build.rs tree-sitter-yaml/bindings/rust/build.rs +cp ../metavariable-grammars/cc_build.rs tree-sitter-vue/bindings/rust/build.rs +cp ../metavariable-grammars/c_build.rs tree-sitter-sql/bindings/rust/build.rs + +# I suck at bash scripting and couldn't figure out how to do this in a loop +# need the language name, but also need bash to expand the file literal +#marzano resources + +cp ../../../../vendor/tree-sitter-gritql/src/node-types.json ../node-types/gritql-node-types.json +cp tree-sitter-c-sharp/src/node-types.json ../node-types/csharp-node-types.json +cp tree-sitter-css/src/node-types.json ../node-types/css-node-types.json +cp tree-sitter-go/src/node-types.json ../node-types/go-node-types.json +cp tree-sitter-hcl/src/node-types.json ../node-types/hcl-node-types.json +cp tree-sitter-html/src/node-types.json ../node-types/html-node-types.json +cp tree-sitter-java/src/node-types.json ../node-types/java-node-types.json +cp tree-sitter-json/src/node-types.json ../node-types/json-node-types.json +cp tree-sitter-markdown/tree-sitter-markdown/src/node-types.json ../node-types/markdown-block-node-types.json +cp tree-sitter-markdown/tree-sitter-markdown-inline/src/node-types.json ../node-types/markdown-inline-node-types.json +cp tree-sitter-python/src/node-types.json ../node-types/python-node-types.json +cp tree-sitter-ruby/src/node-types.json ../node-types/ruby-node-types.json +cp tree-sitter-rust/src/node-types.json ../node-types/rust-node-types.json +cp tree-sitter-solidity/src/node-types.json ../node-types/solidity-node-types.json +cp tree-sitter-yaml/src/node-types.json ../node-types/yaml-node-types.json +cp tree-sitter-javascript/src/node-types.json ../node-types/javascript-node-types.json +cp tree-sitter-typescript/typescript/src/node-types.json ../node-types/typescript-node-types.json +cp tree-sitter-typescript/tsx/src/node-types.json ../node-types/tsx-node-types.json +cp tree-sitter-sql/src/node-types.json ../node-types/sql-node-types.json +cp tree-sitter-vue/src/node-types.json ../node-types/vue-node-types.json +cp tree-sitter-toml/src/node-types.json ../node-types/toml-node-types.json + +# move the wasm parsers to the wasm-parser directory +mv tree-sitter-css/tree-sitter-css.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-css.wasm +mv tree-sitter-go/tree-sitter-go.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-go.wasm +mv tree-sitter-hcl/tree-sitter-hcl.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-hcl.wasm +mv tree-sitter-html/tree-sitter-html.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-html.wasm +mv tree-sitter-java/tree-sitter-java.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-java.wasm +mv tree-sitter-json/tree-sitter-json.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-json.wasm +# mv tree-sitter-markdown/tree-sitter-markdown/tree-sitter-markdown.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-markdown-block.wasm +mv tree-sitter-markdown/tree-sitter-markdown-inline/tree-sitter-markdown_inline.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-markdown_inline.wasm +mv tree-sitter-python/tree-sitter-python.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-python.wasm +mv tree-sitter-ruby/tree-sitter-ruby.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-ruby.wasm +mv tree-sitter-rust/tree-sitter-rust.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-rust.wasm +mv tree-sitter-solidity/tree-sitter-solidity.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-solidity.wasm +mv tree-sitter-yaml/tree-sitter-yaml.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-yaml.wasm +mv tree-sitter-javascript/tree-sitter-javascript.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-javascript.wasm +mv tree-sitter-typescript/typescript/tree-sitter-typescript.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-typescript.wasm +mv tree-sitter-typescript/tsx/tree-sitter-tsx.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-tsx.wasm +mv tree-sitter-vue/tree-sitter-vue.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-vue.wasm +mv tree-sitter-toml/tree-sitter-toml.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-toml.wasm +# we skip wasm generation as it's too expensive +# mv tree-sitter-sql/tree-sitter-sql.wasm ../../wasm-bindings/wasm_parsers/tree-sitter-sql.wasm + +# Modify existing C/C++ compiler flag to ignore all warnings +find . -name "build.rs" -exec sed -i '' -e 's/Wno-unused-parameter/w/g' {} \; \ No newline at end of file diff --git a/resources/language-metavariables/tree-sitter-c-sharp/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-c-sharp/bindings/rust/build.rs index 7fe9b24a7..79518dda5 100644 --- a/resources/language-metavariables/tree-sitter-c-sharp/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-c-sharp/bindings/rust/build.rs @@ -7,7 +7,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(&src_dir); c_config - .flag_if_supported("-w") + .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"); diff --git a/resources/language-metavariables/tree-sitter-css/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-css/bindings/rust/build.rs index bb3b1da71..8851fed13 100644 --- a/resources/language-metavariables/tree-sitter-css/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-css/bindings/rust/build.rs @@ -4,7 +4,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(src_dir); c_config - .flag_if_supported("-w") + .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"); diff --git a/resources/language-metavariables/tree-sitter-css/tree-sitter-css.wasm b/resources/language-metavariables/tree-sitter-css/tree-sitter-css.wasm new file mode 100755 index 000000000..d62a709c2 Binary files /dev/null and b/resources/language-metavariables/tree-sitter-css/tree-sitter-css.wasm differ diff --git a/resources/language-metavariables/tree-sitter-go/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-go/bindings/rust/build.rs index efc1672ae..6a41cd05c 100644 --- a/resources/language-metavariables/tree-sitter-go/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-go/bindings/rust/build.rs @@ -3,7 +3,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(src_dir); c_config - .flag_if_supported("-w") + .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"); diff --git a/resources/language-metavariables/tree-sitter-go/tree-sitter-go.wasm b/resources/language-metavariables/tree-sitter-go/tree-sitter-go.wasm new file mode 100755 index 000000000..82a8b85ee Binary files /dev/null and b/resources/language-metavariables/tree-sitter-go/tree-sitter-go.wasm differ diff --git a/resources/language-metavariables/tree-sitter-hcl/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-hcl/bindings/rust/build.rs index bb3b1da71..8851fed13 100644 --- a/resources/language-metavariables/tree-sitter-hcl/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-hcl/bindings/rust/build.rs @@ -4,7 +4,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(src_dir); c_config - .flag_if_supported("-w") + .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"); diff --git a/resources/language-metavariables/tree-sitter-hcl/tree-sitter-hcl.wasm b/resources/language-metavariables/tree-sitter-hcl/tree-sitter-hcl.wasm new file mode 100755 index 000000000..ee895ecdf Binary files /dev/null and b/resources/language-metavariables/tree-sitter-hcl/tree-sitter-hcl.wasm differ diff --git a/resources/language-metavariables/tree-sitter-html/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-html/bindings/rust/build.rs index bb3b1da71..8851fed13 100644 --- a/resources/language-metavariables/tree-sitter-html/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-html/bindings/rust/build.rs @@ -4,7 +4,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(src_dir); c_config - .flag_if_supported("-w") + .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"); diff --git a/resources/language-metavariables/tree-sitter-html/tree-sitter-html.wasm b/resources/language-metavariables/tree-sitter-html/tree-sitter-html.wasm new file mode 100755 index 000000000..2d2835ca4 Binary files /dev/null and b/resources/language-metavariables/tree-sitter-html/tree-sitter-html.wasm differ diff --git a/resources/language-metavariables/tree-sitter-java/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-java/bindings/rust/build.rs index 4576d28e6..d8ec29c08 100644 --- a/resources/language-metavariables/tree-sitter-java/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-java/bindings/rust/build.rs @@ -7,7 +7,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(src_dir); c_config - .flag_if_supported("-w") + .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"); diff --git a/resources/language-metavariables/tree-sitter-java/tree-sitter-java.wasm b/resources/language-metavariables/tree-sitter-java/tree-sitter-java.wasm new file mode 100755 index 000000000..889206a4b Binary files /dev/null and b/resources/language-metavariables/tree-sitter-java/tree-sitter-java.wasm differ diff --git a/resources/language-metavariables/tree-sitter-javascript/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-javascript/bindings/rust/build.rs index fbc2cd00b..3a8ac8b66 100644 --- a/resources/language-metavariables/tree-sitter-javascript/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-javascript/bindings/rust/build.rs @@ -7,7 +7,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(src_dir); c_config - .flag_if_supported("-w") + .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"); diff --git a/resources/language-metavariables/tree-sitter-javascript/tree-sitter-javascript.wasm b/resources/language-metavariables/tree-sitter-javascript/tree-sitter-javascript.wasm new file mode 100755 index 000000000..e01894e1a Binary files /dev/null and b/resources/language-metavariables/tree-sitter-javascript/tree-sitter-javascript.wasm differ diff --git a/resources/language-metavariables/tree-sitter-json/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-json/bindings/rust/build.rs index f14262473..c6061f099 100644 --- a/resources/language-metavariables/tree-sitter-json/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-json/bindings/rust/build.rs @@ -4,7 +4,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(&src_dir); c_config - .flag_if_supported("-w") + .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"); @@ -30,7 +30,7 @@ fn main() { cpp_config.cpp(true); cpp_config.include(&src_dir); cpp_config - .flag_if_supported("-w") + .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); diff --git a/resources/language-metavariables/tree-sitter-json/tree-sitter-json.wasm b/resources/language-metavariables/tree-sitter-json/tree-sitter-json.wasm new file mode 100755 index 000000000..98d526fcb Binary files /dev/null and b/resources/language-metavariables/tree-sitter-json/tree-sitter-json.wasm differ diff --git a/resources/language-metavariables/tree-sitter-markdown/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-markdown/bindings/rust/build.rs index 4824c222d..f061ec216 100644 --- a/resources/language-metavariables/tree-sitter-markdown/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-markdown/bindings/rust/build.rs @@ -5,7 +5,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(&src_dir_block); c_config - .flag_if_supported("-w") + .flag_if_supported("-Wno-unused-parameter") .flag_if_supported("-Wno-unused-but-set-variable") .flag_if_supported("-Wno-trigraphs"); let parser_path = src_dir_block.join("parser.c"); @@ -16,7 +16,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(&src_dir_inline); c_config - .flag_if_supported("-w") + .flag_if_supported("-Wno-unused-parameter") .flag_if_supported("-Wno-unused-but-set-variable") .flag_if_supported("-Wno-trigraphs"); let parser_path = src_dir_inline.join("parser.c"); @@ -28,7 +28,7 @@ fn main() { c_config.cpp(false); c_config.include(&src_dir_block); c_config - .flag_if_supported("-w") + .flag_if_supported("-Wno-unused-parameter") .flag_if_supported("-Wno-unused-but-set-variable"); let scanner_path = src_dir_block.join("scanner.c"); c_config.file(&scanner_path); @@ -39,7 +39,7 @@ fn main() { c_config.cpp(false); c_config.include(&src_dir_inline); c_config - .flag_if_supported("-w") + .flag_if_supported("-Wno-unused-parameter") .flag_if_supported("-Wno-unused-but-set-variable"); let scanner_path = src_dir_inline.join("scanner.c"); c_config.file(&scanner_path); diff --git a/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown-inline/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown-inline/bindings/rust/build.rs index f14262473..c6061f099 100644 --- a/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown-inline/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown-inline/bindings/rust/build.rs @@ -4,7 +4,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(&src_dir); c_config - .flag_if_supported("-w") + .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"); @@ -30,7 +30,7 @@ fn main() { cpp_config.cpp(true); cpp_config.include(&src_dir); cpp_config - .flag_if_supported("-w") + .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); diff --git a/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown-inline/tree-sitter-markdown_inline.wasm b/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown-inline/tree-sitter-markdown_inline.wasm new file mode 100755 index 000000000..accc76206 Binary files /dev/null and b/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown-inline/tree-sitter-markdown_inline.wasm differ diff --git a/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown/bindings/rust/build.rs index f14262473..c6061f099 100644 --- a/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown/bindings/rust/build.rs @@ -4,7 +4,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(&src_dir); c_config - .flag_if_supported("-w") + .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"); @@ -30,7 +30,7 @@ fn main() { cpp_config.cpp(true); cpp_config.include(&src_dir); cpp_config - .flag_if_supported("-w") + .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); diff --git a/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown/tree-sitter-markdown.wasm b/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown/tree-sitter-markdown.wasm new file mode 100755 index 000000000..961e7ef82 Binary files /dev/null and b/resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown/tree-sitter-markdown.wasm differ diff --git a/resources/language-metavariables/tree-sitter-python/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-python/bindings/rust/build.rs index bb3b1da71..8851fed13 100644 --- a/resources/language-metavariables/tree-sitter-python/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-python/bindings/rust/build.rs @@ -4,7 +4,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(src_dir); c_config - .flag_if_supported("-w") + .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"); diff --git a/resources/language-metavariables/tree-sitter-python/tree-sitter-python.wasm b/resources/language-metavariables/tree-sitter-python/tree-sitter-python.wasm new file mode 100755 index 000000000..aff6ed2e0 Binary files /dev/null and b/resources/language-metavariables/tree-sitter-python/tree-sitter-python.wasm differ diff --git a/resources/language-metavariables/tree-sitter-ruby/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-ruby/bindings/rust/build.rs index 8d54b83bd..7fac95e7b 100644 --- a/resources/language-metavariables/tree-sitter-ruby/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-ruby/bindings/rust/build.rs @@ -8,7 +8,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(&src_dir); c_config - .flag_if_supported("-w") + .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"); @@ -25,7 +25,7 @@ fn main() { } cpp_config - .flag_if_supported("-w") + .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); diff --git a/resources/language-metavariables/tree-sitter-ruby/tree-sitter-ruby.wasm b/resources/language-metavariables/tree-sitter-ruby/tree-sitter-ruby.wasm new file mode 100755 index 000000000..22af3a1cb Binary files /dev/null and b/resources/language-metavariables/tree-sitter-ruby/tree-sitter-ruby.wasm differ diff --git a/resources/language-metavariables/tree-sitter-rust/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-rust/bindings/rust/build.rs index 0f05a1f7d..0dce566d6 100644 --- a/resources/language-metavariables/tree-sitter-rust/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-rust/bindings/rust/build.rs @@ -3,7 +3,7 @@ fn main() { let mut config = cc::Build::new(); config.include(&src_dir); config - .flag_if_supported("-w") + .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"); diff --git a/resources/language-metavariables/tree-sitter-rust/tree-sitter-rust.wasm b/resources/language-metavariables/tree-sitter-rust/tree-sitter-rust.wasm new file mode 100755 index 000000000..85b996e2d Binary files /dev/null and b/resources/language-metavariables/tree-sitter-rust/tree-sitter-rust.wasm differ diff --git a/resources/language-metavariables/tree-sitter-solidity/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-solidity/bindings/rust/build.rs index f14262473..c6061f099 100644 --- a/resources/language-metavariables/tree-sitter-solidity/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-solidity/bindings/rust/build.rs @@ -4,7 +4,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(&src_dir); c_config - .flag_if_supported("-w") + .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"); @@ -30,7 +30,7 @@ fn main() { cpp_config.cpp(true); cpp_config.include(&src_dir); cpp_config - .flag_if_supported("-w") + .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); diff --git a/resources/language-metavariables/tree-sitter-solidity/tree-sitter-solidity.wasm b/resources/language-metavariables/tree-sitter-solidity/tree-sitter-solidity.wasm new file mode 100755 index 000000000..211212c00 Binary files /dev/null and b/resources/language-metavariables/tree-sitter-solidity/tree-sitter-solidity.wasm differ diff --git a/resources/language-metavariables/tree-sitter-toml/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-toml/bindings/rust/build.rs index f14262473..c6061f099 100644 --- a/resources/language-metavariables/tree-sitter-toml/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-toml/bindings/rust/build.rs @@ -4,7 +4,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(&src_dir); c_config - .flag_if_supported("-w") + .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"); @@ -30,7 +30,7 @@ fn main() { cpp_config.cpp(true); cpp_config.include(&src_dir); cpp_config - .flag_if_supported("-w") + .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); diff --git a/resources/language-metavariables/tree-sitter-toml/tree-sitter-toml.wasm b/resources/language-metavariables/tree-sitter-toml/tree-sitter-toml.wasm new file mode 100755 index 000000000..7834d11e5 Binary files /dev/null and b/resources/language-metavariables/tree-sitter-toml/tree-sitter-toml.wasm differ diff --git a/resources/language-metavariables/tree-sitter-typescript/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-typescript/bindings/rust/build.rs index cf2bc9c20..b7cda9251 100644 --- a/resources/language-metavariables/tree-sitter-typescript/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-typescript/bindings/rust/build.rs @@ -6,7 +6,7 @@ fn main() { let mut config = cc::Build::new(); config.include(&typescript_dir); config - .flag_if_supported("-w") + .flag_if_supported("-Wno-unused-parameter") .flag_if_supported("-Wno-unused-but-set-variable"); for path in &[ diff --git a/resources/language-metavariables/tree-sitter-typescript/build/Makefile b/resources/language-metavariables/tree-sitter-typescript/build/Makefile index 156d41d1e..85a4c98c4 100644 --- a/resources/language-metavariables/tree-sitter-typescript/build/Makefile +++ b/resources/language-metavariables/tree-sitter-typescript/build/Makefile @@ -327,7 +327,7 @@ endif quiet_cmd_regen_makefile = ACTION Regenerating $@ cmd_regen_makefile = cd $(srcdir); /Users/itamarlevy-or/.nvm/versions/node/v18.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/itamarlevy-or/Library/Caches/node-gyp/18.5.0" "-Dnode_gyp_dir=/Users/itamarlevy-or/.nvm/versions/node/v18.5.0/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/Users/itamarlevy-or/Library/Caches/node-gyp/18.5.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/itamarlevy-or/dev/gritql/resources/language-metavariables/tree-sitter-typescript" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/itamarlevy-or/dev/gritql/resources/language-metavariables/tree-sitter-typescript/build/config.gypi -I/Users/itamarlevy-or/.nvm/versions/node/v18.5.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/itamarlevy-or/Library/Caches/node-gyp/18.5.0/include/node/common.gypi "--toplevel-dir=." binding.gyp -Makefile: $(srcdir)/binding.gyp $(srcdir)/build/config.gypi $(srcdir)/../../../../../.nvm/versions/node/v18.5.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/../../../../../Library/Caches/node-gyp/18.5.0/include/node/common.gypi +Makefile: $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../.nvm/versions/node/v18.5.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/../../../../../Library/Caches/node-gyp/18.5.0/include/node/common.gypi $(call do_cmd,regen_makefile) # "all" is a concatenation of the "all" targets from all the included diff --git a/resources/language-metavariables/tree-sitter-typescript/build/Release/tree_sitter_typescript_binding.node b/resources/language-metavariables/tree-sitter-typescript/build/Release/tree_sitter_typescript_binding.node index 21aa0822d..2d5a1e537 100755 Binary files a/resources/language-metavariables/tree-sitter-typescript/build/Release/tree_sitter_typescript_binding.node and b/resources/language-metavariables/tree-sitter-typescript/build/Release/tree_sitter_typescript_binding.node differ diff --git a/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/bindings/rust/build.rs b/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/bindings/rust/build.rs index fbc2cd00b..3a8ac8b66 100644 --- a/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/bindings/rust/build.rs +++ b/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/bindings/rust/build.rs @@ -7,7 +7,7 @@ fn main() { let mut c_config = cc::Build::new(); c_config.include(src_dir); c_config - .flag_if_supported("-w") + .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"); diff --git a/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Makefile b/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Makefile index 8bcd78b9a..85454051c 100644 --- a/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Makefile +++ b/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Makefile @@ -327,7 +327,7 @@ endif quiet_cmd_regen_makefile = ACTION Regenerating $@ cmd_regen_makefile = cd $(srcdir); /Users/itamarlevy-or/.nvm/versions/node/v18.5.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/itamarlevy-or/Library/Caches/node-gyp/18.5.0" "-Dnode_gyp_dir=/Users/itamarlevy-or/.nvm/versions/node/v18.5.0/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/Users/itamarlevy-or/Library/Caches/node-gyp/18.5.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/itamarlevy-or/dev/gritql/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/itamarlevy-or/dev/gritql/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/config.gypi -I/Users/itamarlevy-or/.nvm/versions/node/v18.5.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/itamarlevy-or/Library/Caches/node-gyp/18.5.0/include/node/common.gypi "--toplevel-dir=." binding.gyp -Makefile: $(srcdir)/../../../../../../../Library/Caches/node-gyp/18.5.0/include/node/common.gypi $(srcdir)/../../../../../../../.nvm/versions/node/v18.5.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp +Makefile: $(srcdir)/build/config.gypi $(srcdir)/../../../../../../../.nvm/versions/node/v18.5.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../../../Library/Caches/node-gyp/18.5.0/include/node/common.gypi $(call do_cmd,regen_makefile) # "all" is a concatenation of the "all" targets from all the included diff --git a/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Release/obj.target/tree_sitter_javascript_binding/src/parser.o b/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Release/obj.target/tree_sitter_javascript_binding/src/parser.o index d211ec065..3126b9234 100644 Binary files a/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Release/obj.target/tree_sitter_javascript_binding/src/parser.o and b/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Release/obj.target/tree_sitter_javascript_binding/src/parser.o differ diff --git a/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Release/obj.target/tree_sitter_javascript_binding/src/scanner.o b/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Release/obj.target/tree_sitter_javascript_binding/src/scanner.o index 2180780ea..6917008b9 100644 Binary files a/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Release/obj.target/tree_sitter_javascript_binding/src/scanner.o and b/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Release/obj.target/tree_sitter_javascript_binding/src/scanner.o differ diff --git a/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Release/tree_sitter_javascript_binding.node b/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Release/tree_sitter_javascript_binding.node index bde8d553b..c5b14a108 100755 Binary files a/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Release/tree_sitter_javascript_binding.node and b/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/build/Release/tree_sitter_javascript_binding.node differ diff --git a/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/src/node-types.json b/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/src/node-types.json index ec93c93c8..3a6daf3ad 100644 --- a/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/src/node-types.json +++ b/resources/language-metavariables/tree-sitter-typescript/node_modules/tree-sitter-javascript/src/node-types.json @@ -15,6 +15,10 @@ "type": "generator_function_declaration", "named": true }, + { + "type": "grit_metavariable", + "named": true + }, { "type": "lexical_declaration", "named": true @@ -53,6 +57,10 @@ "type": "jsx_element", "named": true }, + { + "type": "jsx_fragment", + "named": true + }, { "type": "jsx_self_closing_element", "named": true @@ -91,6 +99,10 @@ "type": "array_pattern", "named": true }, + { + "type": "grit_metavariable", + "named": true + }, { "type": "identifier", "named": true @@ -142,7 +154,7 @@ "named": true }, { - "type": "function_expression", + "type": "function", "named": true }, { @@ -153,6 +165,10 @@ "type": "identifier", "named": true }, + { + "type": "import", + "named": true + }, { "type": "member_expression", "named": true @@ -298,66 +314,97 @@ ] }, { - "type": "arguments", + "type": "aliased_name", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "expression", - "named": true - }, - { - "type": "spread_element", - "named": true - } - ] + "fields": { + "alias": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + }, + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + }, + { + "type": "string", + "named": true + } + ] + } } }, { "type": "array", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "expression", - "named": true - }, - { - "type": "spread_element", - "named": true - } - ] + "fields": { + "elements": { + "multiple": true, + "required": false, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "expression", + "named": true + }, + { + "type": "spread_element", + "named": true + } + ] + } } }, { "type": "array_pattern", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "assignment_pattern", - "named": true - }, - { - "type": "pattern", - "named": true - } - ] + "fields": { + "elements": { + "multiple": true, + "required": false, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "assignment_pattern", + "named": true + }, + { + "type": "pattern", + "named": true + } + ] + } } }, { "type": "arrow_function", "named": true, "fields": { + "async": { + "multiple": false, + "required": false, + "types": [ + { + "type": "async", + "named": true + } + ] + }, "body": { "multiple": false, "required": true, @@ -372,22 +419,34 @@ } ] }, - "parameter": { - "multiple": false, + "parameters": { + "multiple": true, "required": false, "types": [ { - "type": "identifier", + "type": ",", + "named": false + }, + { + "type": "assignment_pattern", + "named": true + }, + { + "type": "pattern", "named": true } ] }, - "parameters": { - "multiple": false, + "parenthesis": { + "multiple": true, "required": false, "types": [ { - "type": "formal_parameters", + "type": "l_parenthesis", + "named": true + }, + { + "type": "r_parenthesis", "named": true } ] @@ -501,64 +560,64 @@ "required": true, "types": [ { - "type": "%=", - "named": false + "type": "and_equal", + "named": true }, { - "type": "&&=", - "named": false + "type": "divide_equal", + "named": true }, { - "type": "&=", - "named": false + "type": "exponent_equal", + "named": true }, { - "type": "**=", - "named": false + "type": "left_shift_equal", + "named": true }, { - "type": "*=", - "named": false + "type": "logical_and_equal", + "named": true }, { - "type": "+=", - "named": false + "type": "logical_nullish_equal", + "named": true }, { - "type": "-=", - "named": false + "type": "logical_or_equal", + "named": true }, { - "type": "/=", - "named": false + "type": "minus_equal", + "named": true }, { - "type": "<<=", - "named": false + "type": "modulo_equal", + "named": true }, { - "type": ">>=", - "named": false + "type": "or_equal", + "named": true }, { - "type": ">>>=", - "named": false + "type": "plus_equal", + "named": true }, { - "type": "??=", - "named": false + "type": "right_shift_equal", + "named": true }, { - "type": "^=", - "named": false + "type": "times_equal", + "named": true }, { - "type": "|=", - "named": false + "type": "unsigned_right_shift_equal", + "named": true }, { - "type": "||=", - "named": false + "type": "xor_equal", + "named": true } ] }, @@ -577,18 +636,24 @@ { "type": "await_expression", "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "expression", - "named": true - } - ] + "fields": { + "expression": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } } }, + { + "type": "binary_divide", + "named": true, + "fields": {} + }, { "type": "binary_expression", "named": true, @@ -600,10 +665,6 @@ { "type": "expression", "named": true - }, - { - "type": "private_property_identifier", - "named": true } ] }, @@ -612,104 +673,104 @@ "required": true, "types": [ { - "type": "!=", - "named": false + "type": "binary_divide", + "named": true }, { - "type": "!==", - "named": false + "type": "binary_exp", + "named": true }, { - "type": "%", - "named": false + "type": "binary_left_shift", + "named": true }, { - "type": "&", - "named": false + "type": "binary_modulo", + "named": true }, { - "type": "&&", - "named": false + "type": "binary_right_shift", + "named": true }, { - "type": "*", - "named": false + "type": "binary_times", + "named": true }, { - "type": "**", - "named": false + "type": "binary_unsigned_right_shift", + "named": true }, { - "type": "+", - "named": false + "type": "bitwise_and", + "named": true }, { - "type": "-", - "named": false + "type": "bitwise_or", + "named": true }, { - "type": "/", - "named": false + "type": "bitwise_xor", + "named": true }, { - "type": "<", - "named": false + "type": "equal", + "named": true }, { - "type": "<<", - "named": false + "type": "greater_than", + "named": true }, { - "type": "<=", - "named": false + "type": "greater_than_or_equal", + "named": true }, { - "type": "==", - "named": false + "type": "in", + "named": true }, { - "type": "===", - "named": false + "type": "instanceof", + "named": true }, { - "type": ">", - "named": false + "type": "less_than", + "named": true }, { - "type": ">=", - "named": false + "type": "less_than_or_equal", + "named": true }, { - "type": ">>", - "named": false + "type": "logical_and", + "named": true }, { - "type": ">>>", - "named": false + "type": "logical_nullish", + "named": true }, { - "type": "??", - "named": false + "type": "logical_or", + "named": true }, { - "type": "^", - "named": false + "type": "minus", + "named": true }, { - "type": "in", - "named": false + "type": "not_equal", + "named": true }, { - "type": "instanceof", - "named": false + "type": "plus", + "named": true }, { - "type": "|", - "named": false + "type": "strict_equal", + "named": true }, { - "type": "||", - "named": false + "type": "strict_not_equal", + "named": true } ] }, @@ -725,6 +786,11 @@ } } }, + { + "type": "binary_times", + "named": true, + "fields": {} + }, { "type": "break_statement", "named": true, @@ -746,15 +812,23 @@ "named": true, "fields": { "arguments": { - "multiple": false, - "required": true, + "multiple": true, + "required": false, "types": [ { - "type": "arguments", - "named": true + "type": ",", + "named": false }, { - "type": "template_string", + "type": "expression", + "named": true + }, + { + "type": "spread_element", + "named": true + }, + { + "type": "template_string", "named": true } ] @@ -766,10 +840,6 @@ { "type": "expression", "named": true - }, - { - "type": "import", - "named": true } ] }, @@ -819,6 +889,11 @@ } } }, + { + "type": "chain", + "named": true, + "fields": {} + }, { "type": "class", "named": true, @@ -843,6 +918,16 @@ } ] }, + "heritage": { + "multiple": false, + "required": false, + "types": [ + { + "type": "class_heritage", + "named": true + } + ] + }, "name": { "multiple": false, "required": false, @@ -853,16 +938,6 @@ } ] } - }, - "children": { - "multiple": false, - "required": false, - "types": [ - { - "type": "class_heritage", - "named": true - } - ] } }, { @@ -923,6 +998,16 @@ } ] }, + "heritage": { + "multiple": false, + "required": false, + "types": [ + { + "type": "class_heritage", + "named": true + } + ] + }, "name": { "multiple": false, "required": true, @@ -933,31 +1018,22 @@ } ] } - }, - "children": { - "multiple": false, - "required": false, - "types": [ - { - "type": "class_heritage", - "named": true - } - ] } }, { "type": "class_heritage", "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "expression", - "named": true - } - ] + "fields": { + "expression": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } } }, { @@ -974,28 +1050,34 @@ } ] } - } - }, - { - "type": "comment", - "named": true, - "fields": {} - }, - { - "type": "computed_property_name", - "named": true, - "fields": {}, + }, "children": { "multiple": false, "required": true, "types": [ { - "type": "expression", + "type": "static", "named": true } ] } }, + { + "type": "computed_property_name", + "named": true, + "fields": { + "expression": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } + }, { "type": "continue_statement", "named": true, @@ -1020,24 +1102,25 @@ { "type": "decorator", "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "call_expression", - "named": true - }, - { - "type": "identifier", - "named": true - }, - { - "type": "member_expression", - "named": true - } - ] + "fields": { + "identifier": { + "multiple": false, + "required": true, + "types": [ + { + "type": "call_expression", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "member_expression", + "named": true + } + ] + } } }, { @@ -1069,16 +1152,17 @@ { "type": "else_clause", "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "statement", - "named": true - } - ] + "fields": { + "else": { + "multiple": false, + "required": true, + "types": [ + { + "type": "statement", + "named": true + } + ] + } } }, { @@ -1089,16 +1173,21 @@ { "type": "export_clause", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "export_specifier", - "named": true - } - ] + "fields": { + "specifiers": { + "multiple": true, + "required": false, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "export_specifier", + "named": true + } + ] + } } }, { @@ -1146,6 +1235,10 @@ { "type": "declaration", "named": true + }, + { + "type": "expression", + "named": true } ] }, @@ -1159,59 +1252,58 @@ } ] }, - "source": { + "export": { "multiple": false, "required": false, "types": [ { - "type": "string", + "type": "export_clause", + "named": true + }, + { + "type": "namespace_export", "named": true } ] }, - "value": { + "source": { "multiple": false, "required": false, "types": [ { - "type": "expression", + "type": "grit_metavariable", + "named": true + }, + { + "type": "string", "named": true } ] } - }, - "children": { - "multiple": false, - "required": false, - "types": [ - { - "type": "export_clause", - "named": true - }, - { - "type": "namespace_export", - "named": true - } - ] } }, { "type": "expression_statement", "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "expression", - "named": true - }, - { - "type": "sequence_expression", - "named": true - } - ] + "fields": { + "expression": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + }, + { + "type": "grit_metavariable", + "named": true + }, + { + "type": "sequence_expression", + "named": true + } + ] + } } }, { @@ -1236,6 +1328,10 @@ "type": "computed_property_name", "named": true }, + { + "type": "grit_metavariable", + "named": true + }, { "type": "number", "named": true @@ -1254,6 +1350,16 @@ } ] }, + "static": { + "multiple": false, + "required": false, + "types": [ + { + "type": "static", + "named": true + } + ] + }, "value": { "multiple": false, "required": false, @@ -1302,15 +1408,15 @@ "types": [ { "type": "const", - "named": false + "named": true }, { "type": "let", - "named": false + "named": true }, { "type": "var", - "named": false + "named": true } ] }, @@ -1354,11 +1460,11 @@ "types": [ { "type": "in", - "named": false + "named": true }, { "type": "of", - "named": false + "named": true } ] }, @@ -1370,6 +1476,10 @@ "type": "expression", "named": true }, + { + "type": "grit_metavariable", + "named": true + }, { "type": "sequence_expression", "named": true @@ -1424,6 +1534,10 @@ "type": "expression", "named": true }, + { + "type": "grit_metavariable", + "named": true + }, { "type": "sequence_expression", "named": true @@ -1455,28 +1569,19 @@ } }, { - "type": "formal_parameters", - "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "assignment_pattern", - "named": true - }, - { - "type": "pattern", - "named": true - } - ] - } - }, - { - "type": "function_declaration", + "type": "function", "named": true, "fields": { + "async": { + "multiple": false, + "required": false, + "types": [ + { + "type": "async", + "named": true + } + ] + }, "body": { "multiple": false, "required": true, @@ -1489,7 +1594,7 @@ }, "name": { "multiple": false, - "required": true, + "required": false, "types": [ { "type": "identifier", @@ -1498,11 +1603,33 @@ ] }, "parameters": { - "multiple": false, + "multiple": true, + "required": false, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "assignment_pattern", + "named": true + }, + { + "type": "pattern", + "named": true + } + ] + }, + "parenthesis": { + "multiple": true, "required": true, "types": [ { - "type": "formal_parameters", + "type": "l_parenthesis", + "named": true + }, + { + "type": "r_parenthesis", "named": true } ] @@ -1510,9 +1637,19 @@ } }, { - "type": "function_expression", + "type": "function_declaration", "named": true, "fields": { + "async": { + "multiple": false, + "required": false, + "types": [ + { + "type": "async", + "named": true + } + ] + }, "body": { "multiple": false, "required": true, @@ -1525,7 +1662,7 @@ }, "name": { "multiple": false, - "required": false, + "required": true, "types": [ { "type": "identifier", @@ -1534,11 +1671,33 @@ ] }, "parameters": { - "multiple": false, + "multiple": true, + "required": false, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "assignment_pattern", + "named": true + }, + { + "type": "pattern", + "named": true + } + ] + }, + "parenthesis": { + "multiple": true, "required": true, "types": [ { - "type": "formal_parameters", + "type": "l_parenthesis", + "named": true + }, + { + "type": "r_parenthesis", "named": true } ] @@ -1549,6 +1708,16 @@ "type": "generator_function", "named": true, "fields": { + "async": { + "multiple": false, + "required": false, + "types": [ + { + "type": "async", + "named": true + } + ] + }, "body": { "multiple": false, "required": true, @@ -1570,11 +1739,33 @@ ] }, "parameters": { - "multiple": false, + "multiple": true, + "required": false, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "assignment_pattern", + "named": true + }, + { + "type": "pattern", + "named": true + } + ] + }, + "parenthesis": { + "multiple": true, "required": true, "types": [ { - "type": "formal_parameters", + "type": "l_parenthesis", + "named": true + }, + { + "type": "r_parenthesis", "named": true } ] @@ -1585,6 +1776,16 @@ "type": "generator_function_declaration", "named": true, "fields": { + "async": { + "multiple": false, + "required": false, + "types": [ + { + "type": "async", + "named": true + } + ] + }, "body": { "multiple": false, "required": true, @@ -1606,11 +1807,33 @@ ] }, "parameters": { - "multiple": false, + "multiple": true, + "required": false, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "assignment_pattern", + "named": true + }, + { + "type": "pattern", + "named": true + } + ] + }, + "parenthesis": { + "multiple": true, "required": true, "types": [ { - "type": "formal_parameters", + "type": "l_parenthesis", + "named": true + }, + { + "type": "r_parenthesis", "named": true } ] @@ -1653,6 +1876,26 @@ } } }, + { + "type": "greater_than", + "named": true, + "fields": {} + }, + { + "type": "identifier", + "named": true, + "fields": {}, + "children": { + "multiple": false, + "required": false, + "types": [ + { + "type": "grit_metavariable", + "named": true + } + ] + } + }, { "type": "if_statement", "named": true, @@ -1694,49 +1937,11 @@ "named": true, "fields": {} }, - { - "type": "import_attribute", - "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "object", - "named": true - } - ] - } - }, { "type": "import_clause", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": true, - "types": [ - { - "type": "identifier", - "named": true - }, - { - "type": "named_imports", - "named": true - }, - { - "type": "namespace_import", - "named": true - } - ] - } - }, - { - "type": "import_specifier", - "named": true, "fields": { - "alias": { + "default": { "multiple": false, "required": false, "types": [ @@ -1748,14 +1953,14 @@ }, "name": { "multiple": false, - "required": true, + "required": false, "types": [ { - "type": "identifier", + "type": "named_imports", "named": true }, { - "type": "string", + "type": "namespace_import", "named": true } ] @@ -1763,88 +1968,49 @@ } }, { - "type": "import_statement", + "type": "import_specifier", "named": true, "fields": { - "source": { + "name": { "multiple": false, "required": true, "types": [ { - "type": "string", + "type": "aliased_name", + "named": true + }, + { + "type": "identifier", "named": true } ] } - }, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "import_attribute", - "named": true - }, - { - "type": "import_clause", - "named": true - } - ] - } - }, - { - "type": "jsx_attribute", - "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": true, - "types": [ - { - "type": "jsx_element", - "named": true - }, - { - "type": "jsx_expression", - "named": true - }, - { - "type": "jsx_namespace_name", - "named": true - }, - { - "type": "jsx_self_closing_element", - "named": true - }, - { - "type": "property_identifier", - "named": true - }, - { - "type": "string", - "named": true - } - ] } }, { - "type": "jsx_closing_element", + "type": "import_statement", "named": true, "fields": { - "name": { + "import": { "multiple": false, "required": false, "types": [ { - "type": "identifier", + "type": "import_clause", "named": true - }, + } + ] + }, + "source": { + "multiple": false, + "required": true, + "types": [ { - "type": "jsx_namespace_name", + "type": "grit_metavariable", "named": true }, { - "type": "member_expression", + "type": "string", "named": true } ] @@ -1852,10 +2018,134 @@ } }, { - "type": "jsx_element", + "type": "jsx_assigned_attribute", "named": true, "fields": { - "close_tag": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "jsx_namespace_name", + "named": true + }, + { + "type": "property_identifier", + "named": true + } + ] + }, + "value": { + "multiple": false, + "required": true, + "types": [ + { + "type": "jsx_element", + "named": true + }, + { + "type": "jsx_expression", + "named": true + }, + { + "type": "jsx_fragment", + "named": true + }, + { + "type": "jsx_self_closing_element", + "named": true + }, + { + "type": "string", + "named": true + } + ] + } + } + }, + { + "type": "jsx_attribute", + "named": true, + "fields": { + "attribute": { + "multiple": false, + "required": true, + "types": [ + { + "type": "jsx_assigned_attribute", + "named": true + }, + { + "type": "jsx_namespace_name", + "named": true + }, + { + "type": "property_identifier", + "named": true + } + ] + } + } + }, + { + "type": "jsx_closing_element", + "named": true, + "fields": { + "name": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + }, + { + "type": "jsx_namespace_name", + "named": true + }, + { + "type": "nested_identifier", + "named": true + } + ] + } + } + }, + { + "type": "jsx_element", + "named": true, + "fields": { + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "grit_metavariable", + "named": true + }, + { + "type": "jsx_element", + "named": true + }, + { + "type": "jsx_expression", + "named": true + }, + { + "type": "jsx_fragment", + "named": true + }, + { + "type": "jsx_self_closing_element", + "named": true + }, + { + "type": "jsx_text", + "named": true + } + ] + }, + "close_tag": { "multiple": false, "required": true, "types": [ @@ -1875,70 +2165,92 @@ } ] } - }, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "html_character_reference", - "named": true - }, - { - "type": "jsx_element", - "named": true - }, - { - "type": "jsx_expression", - "named": true - }, - { - "type": "jsx_self_closing_element", - "named": true - }, - { - "type": "jsx_text", - "named": true - } - ] } }, { "type": "jsx_expression", "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": false, - "types": [ - { - "type": "expression", - "named": true - }, - { - "type": "sequence_expression", - "named": true - }, - { - "type": "spread_element", - "named": true - } - ] + "fields": { + "expression": { + "multiple": false, + "required": false, + "types": [ + { + "type": "expression", + "named": true + }, + { + "type": "sequence_expression", + "named": true + }, + { + "type": "spread_element", + "named": true + } + ] + } + } + }, + { + "type": "jsx_fragment", + "named": true, + "fields": { + "children": { + "multiple": true, + "required": false, + "types": [ + { + "type": "grit_metavariable", + "named": true + }, + { + "type": "jsx_element", + "named": true + }, + { + "type": "jsx_expression", + "named": true + }, + { + "type": "jsx_fragment", + "named": true + }, + { + "type": "jsx_self_closing_element", + "named": true + }, + { + "type": "jsx_text", + "named": true + } + ] + } } }, { "type": "jsx_namespace_name", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": true, - "types": [ - { - "type": "identifier", - "named": true - } - ] + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + } } }, { @@ -1961,7 +2273,7 @@ }, "name": { "multiple": false, - "required": false, + "required": true, "types": [ { "type": "identifier", @@ -1972,7 +2284,7 @@ "named": true }, { - "type": "member_expression", + "type": "nested_identifier", "named": true } ] @@ -2010,18 +2322,13 @@ "named": true }, { - "type": "member_expression", + "type": "nested_identifier", "named": true } ] } } }, - { - "type": "jsx_text", - "named": true, - "fields": {} - }, { "type": "labeled_statement", "named": true, @@ -2048,60 +2355,69 @@ } } }, + { + "type": "less_than", + "named": true, + "fields": {} + }, { "type": "lexical_declaration", "named": true, "fields": { + "declarations": { + "multiple": true, + "required": true, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "variable_declarator", + "named": true + } + ] + }, "kind": { "multiple": false, "required": true, "types": [ { "type": "const", - "named": false + "named": true }, { "type": "let", - "named": false + "named": true } ] } - }, - "children": { - "multiple": true, - "required": true, - "types": [ - { - "type": "variable_declarator", - "named": true - } - ] } }, { "type": "member_expression", "named": true, "fields": { - "object": { + "chain": { "multiple": false, - "required": true, + "required": false, "types": [ { - "type": "expression", + "type": "chain", "named": true }, { - "type": "import", + "type": "optional_chain", "named": true } ] }, - "optional_chain": { + "object": { "multiple": false, - "required": false, + "required": true, "types": [ { - "type": "optional_chain", + "type": "expression", "named": true } ] @@ -2131,6 +2447,16 @@ "type": "method_definition", "named": true, "fields": { + "async": { + "multiple": false, + "required": false, + "types": [ + { + "type": "async", + "named": true + } + ] + }, "body": { "multiple": false, "required": true, @@ -2159,6 +2485,10 @@ "type": "computed_property_name", "named": true }, + { + "type": "grit_metavariable", + "named": true + }, { "type": "number", "named": true @@ -2178,11 +2508,43 @@ ] }, "parameters": { - "multiple": false, + "multiple": true, + "required": false, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "assignment_pattern", + "named": true + }, + { + "type": "pattern", + "named": true + } + ] + }, + "parenthesis": { + "multiple": true, "required": true, "types": [ { - "type": "formal_parameters", + "type": "l_parenthesis", + "named": true + }, + { + "type": "r_parenthesis", + "named": true + } + ] + }, + "static": { + "multiple": false, + "required": false, + "types": [ + { + "type": "static", "named": true } ] @@ -2192,13 +2554,28 @@ { "type": "named_imports", "named": true, - "fields": {}, + "fields": { + "imports": { + "multiple": true, + "required": false, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "import_specifier", + "named": true + } + ] + } + }, "children": { - "multiple": true, + "multiple": false, "required": false, "types": [ { - "type": "import_specifier", + "type": "grit_metavariable", "named": true } ] @@ -2207,35 +2584,73 @@ { "type": "namespace_export", "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "identifier", - "named": true - }, - { - "type": "string", - "named": true - } - ] + "fields": { + "module": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + }, + { + "type": "string", + "named": true + } + ] + } } }, { "type": "namespace_import", "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "identifier", - "named": true - } - ] + "fields": { + "namespace": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + } + } + }, + { + "type": "nested_identifier", + "named": true, + "fields": { + "base": { + "multiple": false, + "required": false, + "types": [ + { + "type": "identifier", + "named": true + } + ] + }, + "nested": { + "multiple": false, + "required": false, + "types": [ + { + "type": "nested_identifier", + "named": true + } + ] + }, + "terminal": { + "multiple": false, + "required": true, + "types": [ + { + "type": "identifier", + "named": true + } + ] + } } }, { @@ -2243,11 +2658,19 @@ "named": true, "fields": { "arguments": { - "multiple": false, + "multiple": true, "required": false, "types": [ { - "type": "arguments", + "type": ",", + "named": false + }, + { + "type": "expression", + "named": true + }, + { + "type": "spread_element", "named": true } ] @@ -2271,28 +2694,33 @@ { "type": "object", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "method_definition", - "named": true - }, - { - "type": "pair", - "named": true - }, - { - "type": "shorthand_property_identifier", - "named": true - }, - { - "type": "spread_element", - "named": true - } - ] + "fields": { + "properties": { + "multiple": true, + "required": false, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "method_definition", + "named": true + }, + { + "type": "pair", + "named": true + }, + { + "type": "shorthand_property_identifier", + "named": true + }, + { + "type": "spread_element", + "named": true + } + ] + } } }, { @@ -2332,28 +2760,33 @@ { "type": "object_pattern", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "object_assignment_pattern", - "named": true - }, - { - "type": "pair_pattern", - "named": true - }, - { - "type": "rest_pattern", - "named": true - }, - { - "type": "shorthand_property_identifier_pattern", - "named": true - } - ] + "fields": { + "properties": { + "multiple": true, + "required": false, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "object_assignment_pattern", + "named": true + }, + { + "type": "pair_pattern", + "named": true + }, + { + "type": "rest_pattern", + "named": true + }, + { + "type": "shorthand_property_identifier_pattern", + "named": true + } + ] + } } }, { @@ -2368,6 +2801,10 @@ "type": "computed_property_name", "named": true }, + { + "type": "grit_metavariable", + "named": true + }, { "type": "number", "named": true @@ -2410,6 +2847,10 @@ "type": "computed_property_name", "named": true }, + { + "type": "grit_metavariable", + "named": true + }, { "type": "number", "named": true @@ -2447,36 +2888,63 @@ { "type": "parenthesized_expression", "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "expression", - "named": true - }, - { - "type": "sequence_expression", - "named": true - } - ] + "fields": { + "expressions": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + }, + { + "type": "grit_metavariable", + "named": true + }, + { + "type": "sequence_expression", + "named": true + } + ] + } } }, { "type": "program", "named": true, + "fields": { + "hash_bang": { + "multiple": false, + "required": false, + "types": [ + { + "type": "hash_bang_line", + "named": true + } + ] + }, + "statements": { + "multiple": true, + "required": false, + "types": [ + { + "type": "statement", + "named": true + } + ] + } + } + }, + { + "type": "property_identifier", + "named": true, "fields": {}, "children": { - "multiple": true, + "multiple": false, "required": false, "types": [ { - "type": "hash_bang_line", - "named": true - }, - { - "type": "statement", + "type": "grit_metavariable", "named": true } ] @@ -2511,40 +2979,95 @@ { "type": "rest_pattern", "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "array_pattern", - "named": true - }, - { - "type": "identifier", - "named": true - }, - { - "type": "member_expression", - "named": true - }, - { - "type": "object_pattern", - "named": true - }, - { - "type": "subscript_expression", - "named": true - }, - { - "type": "undefined", - "named": true - } - ] + "fields": { + "expression": { + "multiple": false, + "required": true, + "types": [ + { + "type": "array_pattern", + "named": true + }, + { + "type": "identifier", + "named": true + }, + { + "type": "member_expression", + "named": true + }, + { + "type": "object_pattern", + "named": true + }, + { + "type": "subscript_expression", + "named": true + }, + { + "type": "undefined", + "named": true + } + ] + } + } + }, + { + "type": "return_statement", + "named": true, + "fields": { + "expressions": { + "multiple": false, + "required": false, + "types": [ + { + "type": "expression", + "named": true + }, + { + "type": "grit_metavariable", + "named": true + }, + { + "type": "sequence_expression", + "named": true + } + ] + } + } + }, + { + "type": "sequence_expression", + "named": true, + "fields": { + "left": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + }, + "right": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + }, + { + "type": "sequence_expression", + "named": true + } + ] + } } }, { - "type": "return_statement", + "type": "shorthand_property_identifier", "named": true, "fields": {}, "children": { @@ -2552,26 +3075,22 @@ "required": false, "types": [ { - "type": "expression", - "named": true - }, - { - "type": "sequence_expression", + "type": "grit_metavariable", "named": true } ] } }, { - "type": "sequence_expression", + "type": "shorthand_property_identifier_pattern", "named": true, "fields": {}, "children": { - "multiple": true, - "required": true, + "multiple": false, + "required": false, "types": [ { - "type": "expression", + "type": "grit_metavariable", "named": true } ] @@ -2580,28 +3099,45 @@ { "type": "spread_element", "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "expression", - "named": true - } - ] + "fields": { + "expression": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + } + ] + } } }, { "type": "statement_block", "named": true, + "fields": { + "statements": { + "multiple": true, + "required": false, + "types": [ + { + "type": "statement", + "named": true + } + ] + } + } + }, + { + "type": "statement_identifier", + "named": true, "fields": {}, "children": { - "multiple": true, + "multiple": false, "required": false, "types": [ { - "type": "statement", + "type": "grit_metavariable", "named": true } ] @@ -2610,24 +3146,25 @@ { "type": "string", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "escape_sequence", - "named": true - }, - { - "type": "html_character_reference", - "named": true - }, - { - "type": "string_fragment", - "named": true - } - ] + "fields": { + "fragment": { + "multiple": true, + "required": false, + "types": [ + { + "type": "escape_sequence", + "named": true + }, + { + "type": "grit_metavariable", + "named": true + }, + { + "type": "string_fragment", + "named": true + } + ] + } } }, { @@ -2642,6 +3179,10 @@ "type": "expression", "named": true }, + { + "type": "grit_metavariable", + "named": true + }, { "type": "sequence_expression", "named": true @@ -2711,6 +3252,10 @@ "type": "expression", "named": true }, + { + "type": "grit_metavariable", + "named": true + }, { "type": "sequence_expression", "named": true @@ -2761,46 +3306,68 @@ } } }, + { + "type": "template_content", + "named": true, + "fields": { + "content": { + "multiple": true, + "required": true, + "types": [ + { + "type": "escape_sequence", + "named": true + }, + { + "type": "template_chars", + "named": true + }, + { + "type": "template_substitution", + "named": true + } + ] + } + } + }, { "type": "template_string", "named": true, - "fields": {}, - "children": { - "multiple": true, - "required": false, - "types": [ - { - "type": "escape_sequence", - "named": true - }, - { - "type": "string_fragment", - "named": true - }, - { - "type": "template_substitution", - "named": true - } - ] + "fields": { + "template": { + "multiple": false, + "required": false, + "types": [ + { + "type": "template_content", + "named": true + } + ] + } } }, { "type": "template_substitution", "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "expression", - "named": true - }, - { - "type": "sequence_expression", - "named": true - } - ] + "fields": { + "expressions": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + }, + { + "type": "grit_metavariable", + "named": true + }, + { + "type": "sequence_expression", + "named": true + } + ] + } } }, { @@ -2842,20 +3409,25 @@ { "type": "throw_statement", "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": true, - "types": [ - { - "type": "expression", - "named": true - }, - { - "type": "sequence_expression", - "named": true - } - ] + "fields": { + "expressions": { + "multiple": false, + "required": true, + "types": [ + { + "type": "expression", + "named": true + }, + { + "type": "grit_metavariable", + "named": true + }, + { + "type": "sequence_expression", + "named": true + } + ] + } } }, { @@ -2913,32 +3485,32 @@ "required": true, "types": [ { - "type": "!", - "named": false + "type": "bitwise_not", + "named": true }, { - "type": "+", - "named": false + "type": "delete", + "named": true }, { - "type": "-", - "named": false + "type": "minus", + "named": true }, { - "type": "delete", - "named": false + "type": "not", + "named": true }, { - "type": "typeof", - "named": false + "type": "plus", + "named": true }, { - "type": "void", - "named": false + "type": "typeof", + "named": true }, { - "type": "~", - "named": false + "type": "void", + "named": true } ] } @@ -2963,12 +3535,12 @@ "required": true, "types": [ { - "type": "++", - "named": false + "type": "decrement", + "named": true }, { - "type": "--", - "named": false + "type": "increment", + "named": true } ] } @@ -2977,13 +3549,28 @@ { "type": "variable_declaration", "named": true, - "fields": {}, + "fields": { + "declarations": { + "multiple": true, + "required": true, + "types": [ + { + "type": ",", + "named": false + }, + { + "type": "variable_declarator", + "named": true + } + ] + } + }, "children": { - "multiple": true, + "multiple": false, "required": true, "types": [ { - "type": "variable_declarator", + "type": "var", "named": true } ] @@ -3076,31 +3663,20 @@ } }, { - "type": "yield_expression", - "named": true, - "fields": {}, - "children": { - "multiple": false, - "required": false, - "types": [ - { - "type": "expression", - "named": true - } - ] - } - }, - { - "type": "!", - "named": false - }, - { - "type": "!=", - "named": false - }, - { - "type": "!==", - "named": false + "type": "yield_expression", + "named": true, + "fields": { + "expression": { + "multiple": false, + "required": false, + "types": [ + { + "type": "expression", + "named": true + } + ] + } + } }, { "type": "\"", @@ -3111,348 +3687,340 @@ "named": false }, { - "type": "%", - "named": false - }, - { - "type": "%=", - "named": false - }, - { - "type": "&", + "type": "'", "named": false }, { - "type": "&&", + "type": "(", "named": false }, { - "type": "&&=", + "type": ")", "named": false }, { - "type": "&=", + "type": "*", "named": false }, { - "type": "'", + "type": ",", "named": false }, { - "type": "(", + "type": ".", "named": false }, { - "type": ")", + "type": "...", "named": false }, { - "type": "*", + "type": "/", "named": false }, { - "type": "**", + "type": ":", "named": false }, { - "type": "**=", + "type": ";", "named": false }, { - "type": "*=", + "type": "<", "named": false }, { - "type": "+", + "type": "", "named": false }, { - "type": "++", + "type": "