Skip to content

Commit 43b0248

Browse files
committed
No need for a distinct IMPORT_FROM, we can recycle the FROM token name
1 parent 8c08ae4 commit 43b0248

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/grammar.coffee

+2-2
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ grammar =
353353

354354
Import: [
355355
o 'IMPORT String', -> new Module 'import', null, $2
356-
o 'IMPORT ImportClause IMPORT_FROM String', -> new Module 'import', $2, $4
356+
o 'IMPORT ImportClause FROM String', -> new Module 'import', $2, $4
357357
]
358358

359359
ImportClause: [
@@ -366,7 +366,7 @@ grammar =
366366
Export: [
367367
o 'EXPORT ExportClause', -> new Module 'export', $2
368368
o 'EXPORT EXPORT_DEFAULT Expression', -> new Module 'export', $3, null, yes
369-
o 'EXPORT ExportClause IMPORT_FROM String', -> new Module 'export', $2, $4
369+
o 'EXPORT ExportClause FROM String', -> new Module 'export', $2, $4
370370
]
371371

372372
ExportClause: [

src/lexer.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ exports.Lexer = class Lexer
116116
@token 'FROM', id
117117
return id.length
118118
if id is 'from' and (@seenImport or @seenExport)
119-
@token 'IMPORT_FROM', id
119+
@token 'FROM', id
120120
return id.length
121121
if id is 'as' and @seenImport
122122
@token 'IMPORT_AS', id

0 commit comments

Comments
 (0)