Skip to content

Commit

Permalink
Update tree-sitter-javascript (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli authored Oct 10, 2022
1 parent 082da44 commit 0ab9d99
Show file tree
Hide file tree
Showing 7 changed files with 296,043 additions and 284,991 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"main": "./bindings/node",
"devDependencies": {
"tree-sitter-cli": "^0.20.6",
"tree-sitter-javascript": "github:tree-sitter/tree-sitter-javascript#fdeb68a"
"tree-sitter-javascript": "github:tree-sitter/tree-sitter-javascript#936d976"
},
"scripts": {
"build": "npm run build-typescript && npm run build-tsx",
Expand Down
106 changes: 101 additions & 5 deletions tsx/src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1908,6 +1908,10 @@
"type": "SYMBOL",
"name": "primary_expression"
},
{
"type": "SYMBOL",
"name": "glimmer_template"
},
{
"type": "SYMBOL",
"name": "_jsx_element"
Expand Down Expand Up @@ -2597,6 +2601,86 @@
}
]
},
"glimmer_template": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "open_tag",
"content": {
"type": "SYMBOL",
"name": "glimmer_opening_tag"
}
},
{
"type": "FIELD",
"name": "content",
"content": {
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_glimmer_template_content"
}
}
},
{
"type": "FIELD",
"name": "close_tag",
"content": {
"type": "SYMBOL",
"name": "glimmer_closing_tag"
}
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "open_tag",
"content": {
"type": "SYMBOL",
"name": "glimmer_opening_tag"
}
},
{
"type": "FIELD",
"name": "close_tag",
"content": {
"type": "SYMBOL",
"name": "glimmer_closing_tag"
}
}
]
}
]
},
"_glimmer_template_content": {
"type": "PATTERN",
"value": ".{1,}"
},
"glimmer_opening_tag": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "<template>"
}
]
},
"glimmer_closing_tag": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "</template>"
}
]
},
"_jsx_element": {
"type": "CHOICE",
"members": [
Expand Down Expand Up @@ -3518,6 +3602,10 @@
}
]
},
"optional_chain": {
"type": "STRING",
"value": "?."
},
"call_expression": {
"type": "CHOICE",
"members": [
Expand Down Expand Up @@ -3719,8 +3807,12 @@
"value": "."
},
{
"type": "STRING",
"value": "?."
"type": "FIELD",
"name": "optional_chain",
"content": {
"type": "SYMBOL",
"name": "optional_chain"
}
}
]
},
Expand Down Expand Up @@ -3776,8 +3868,12 @@
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "?."
"type": "FIELD",
"name": "optional_chain",
"content": {
"type": "SYMBOL",
"name": "optional_chain"
}
},
{
"type": "BLANK"
Expand Down Expand Up @@ -4535,7 +4631,7 @@
}
},
{
"type": "PREC_LEFT",
"type": "PREC_RIGHT",
"value": "binary_exp",
"content": {
"type": "SEQ",
Expand Down
77 changes: 75 additions & 2 deletions tsx/src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@
"type": "binary_expression",
"named": true
},
{
"type": "glimmer_template",
"named": true
},
{
"type": "internal_module",
"named": true
Expand Down Expand Up @@ -2742,6 +2746,42 @@
}
}
},
{
"type": "glimmer_closing_tag",
"named": true,
"fields": {}
},
{
"type": "glimmer_opening_tag",
"named": true,
"fields": {}
},
{
"type": "glimmer_template",
"named": true,
"fields": {
"close_tag": {
"multiple": false,
"required": true,
"types": [
{
"type": "glimmer_closing_tag",
"named": true
}
]
},
"open_tag": {
"multiple": false,
"required": true,
"types": [
{
"type": "glimmer_opening_tag",
"named": true
}
]
}
}
},
{
"type": "identifier",
"named": true,
Expand Down Expand Up @@ -3652,6 +3692,16 @@
}
]
},
"optional_chain": {
"multiple": false,
"required": false,
"types": [
{
"type": "optional_chain",
"named": true
}
]
},
"property": {
"multiple": false,
"required": true,
Expand Down Expand Up @@ -4215,6 +4265,11 @@
]
}
},
{
"type": "optional_chain",
"named": true,
"fields": {}
},
{
"type": "optional_parameter",
"named": true,
Expand Down Expand Up @@ -4962,6 +5017,16 @@
"named": true
}
]
},
"optional_chain": {
"multiple": false,
"required": false,
"types": [
{
"type": "optional_chain",
"named": true
}
]
}
}
},
Expand Down Expand Up @@ -5892,6 +5957,10 @@
"type": "<",
"named": false
},
{
"type": "</template>",
"named": false
},
{
"type": "<<",
"named": false
Expand All @@ -5904,6 +5973,10 @@
"type": "<=",
"named": false
},
{
"type": "<template>",
"named": false
},
{
"type": "=",
"named": false
Expand Down Expand Up @@ -6182,11 +6255,11 @@
},
{
"type": "number",
"named": true
"named": false
},
{
"type": "number",
"named": false
"named": true
},
{
"type": "object",
Expand Down
Loading

0 comments on commit 0ab9d99

Please sign in to comment.