Skip to content

Commit aa8adb4

Browse files
committed
Merge branch 'master' into update_elasticsearch
2 parents dc9024a + 72a9af0 commit aa8adb4

File tree

7 files changed

+38518
-37367
lines changed

7 files changed

+38518
-37367
lines changed

grammar.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ module.exports = grammar({
227227
instanceof_expression: $ => prec(PREC.REL, seq(
228228
field('left', $.expression),
229229
'instanceof',
230-
field('right', $._type)
230+
field('right', $._type),
231+
field('name', optional(choice($.identifier, $._reserved_identifier)))
231232
)),
232233

233234
lambda_expression: $ => seq(
@@ -636,6 +637,7 @@ module.exports = grammar({
636637
$.package_declaration,
637638
$.import_declaration,
638639
$.class_declaration,
640+
$.record_declaration,
639641
$.interface_declaration,
640642
$.annotation_type_declaration,
641643
$.enum_declaration,
@@ -903,6 +905,7 @@ module.exports = grammar({
903905
optional($.modifiers),
904906
'record',
905907
field('name', $.identifier),
908+
optional(field('type_parameters', $.type_parameters)),
906909
field('parameters', $.formal_parameters),
907910
field('body', $.class_body)
908911
),
@@ -1133,7 +1136,8 @@ module.exports = grammar({
11331136

11341137
_reserved_identifier: $ => alias(choice(
11351138
'open',
1136-
'module'
1139+
'module',
1140+
'record'
11371141
), $.identifier),
11381142

11391143
this: $ => 'this',
-1.66 KB
Binary file not shown.

src/grammar.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,6 +2013,31 @@
20132013
"type": "SYMBOL",
20142014
"name": "_type"
20152015
}
2016+
},
2017+
{
2018+
"type": "FIELD",
2019+
"name": "name",
2020+
"content": {
2021+
"type": "CHOICE",
2022+
"members": [
2023+
{
2024+
"type": "CHOICE",
2025+
"members": [
2026+
{
2027+
"type": "SYMBOL",
2028+
"name": "identifier"
2029+
},
2030+
{
2031+
"type": "SYMBOL",
2032+
"name": "_reserved_identifier"
2033+
}
2034+
]
2035+
},
2036+
{
2037+
"type": "BLANK"
2038+
}
2039+
]
2040+
}
20162041
}
20172042
]
20182043
}
@@ -4373,6 +4398,10 @@
43734398
"type": "SYMBOL",
43744399
"name": "class_declaration"
43754400
},
4401+
{
4402+
"type": "SYMBOL",
4403+
"name": "record_declaration"
4404+
},
43764405
{
43774406
"type": "SYMBOL",
43784407
"name": "interface_declaration"
@@ -5731,6 +5760,22 @@
57315760
"name": "identifier"
57325761
}
57335762
},
5763+
{
5764+
"type": "CHOICE",
5765+
"members": [
5766+
{
5767+
"type": "FIELD",
5768+
"name": "type_parameters",
5769+
"content": {
5770+
"type": "SYMBOL",
5771+
"name": "type_parameters"
5772+
}
5773+
},
5774+
{
5775+
"type": "BLANK"
5776+
}
5777+
]
5778+
},
57345779
{
57355780
"type": "FIELD",
57365781
"name": "parameters",
@@ -6893,6 +6938,10 @@
68936938
{
68946939
"type": "STRING",
68956940
"value": "module"
6941+
},
6942+
{
6943+
"type": "STRING",
6944+
"value": "record"
68966945
}
68976946
]
68986947
},

src/node-types.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@
160160
{
161161
"type": "package_declaration",
162162
"named": true
163+
},
164+
{
165+
"type": "record_declaration",
166+
"named": true
163167
}
164168
]
165169
},
@@ -2168,6 +2172,16 @@
21682172
}
21692173
]
21702174
},
2175+
"name": {
2176+
"multiple": false,
2177+
"required": false,
2178+
"types": [
2179+
{
2180+
"type": "identifier",
2181+
"named": true
2182+
}
2183+
]
2184+
},
21712185
"right": {
21722186
"multiple": false,
21732187
"required": true,
@@ -2914,6 +2928,16 @@
29142928
"named": true
29152929
}
29162930
]
2931+
},
2932+
"type_parameters": {
2933+
"multiple": false,
2934+
"required": false,
2935+
"types": [
2936+
{
2937+
"type": "type_parameters",
2938+
"named": true
2939+
}
2940+
]
29172941
}
29182942
},
29192943
"children": {

0 commit comments

Comments
 (0)