Skip to content

Commit 595f30e

Browse files
authored
Merge pull request #203 from resolritter/export
Fix export_statement
2 parents 54931b3 + 891bcc5 commit 595f30e

File tree

8 files changed

+227974
-228585
lines changed

8 files changed

+227974
-228585
lines changed

common/corpus/declarations.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,13 @@ Export assignments
303303
==================================
304304

305305
export = Linter;
306+
export = {};
306307

307308
---
308309

309-
(program (export_statement (identifier)))
310+
(program
311+
(export_statement (identifier))
312+
(export_statement (object)))
310313

311314
==================================
312315
Import aliases

common/define-grammar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ module.exports = function defineGrammar(dialect) {
273273

274274
export_statement: ($, previous) => choice(
275275
previous,
276-
seq('export', 'type', $.export_clause),
277-
seq('export', '=', $.identifier, $._semicolon),
276+
seq('export', 'type', $.export_clause, $._semicolon),
277+
seq('export', '=', $.expression, $._semicolon),
278278
seq('export', 'as', 'namespace', $.identifier, $._semicolon),
279279
),
280280

tsx/src/grammar.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@
207207
{
208208
"type": "SYMBOL",
209209
"name": "export_clause"
210+
},
211+
{
212+
"type": "SYMBOL",
213+
"name": "_semicolon"
210214
}
211215
]
212216
},
@@ -223,7 +227,7 @@
223227
},
224228
{
225229
"type": "SYMBOL",
226-
"name": "identifier"
230+
"name": "expression"
227231
},
228232
{
229233
"type": "SYMBOL",

tsx/src/node-types.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,6 +2036,10 @@
20362036
"type": "export_clause",
20372037
"named": true
20382038
},
2039+
{
2040+
"type": "expression",
2041+
"named": true
2042+
},
20392043
{
20402044
"type": "identifier",
20412045
"named": true

0 commit comments

Comments
 (0)