Starting out the import statement
This commit is contained in:
committed by
Richard van Velzen
parent
6780d0906c
commit
0465bd270d
20
lib/parse.js
20
lib/parse.js
@@ -44,9 +44,9 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
var KEYWORDS = 'break case catch class const continue debugger default delete do else extends finally for function if in instanceof new return switch throw try typeof var let void while with';
|
||||
var KEYWORDS = 'break case catch class const continue debugger default delete do else extends finally for function if in instanceof new return switch throw try typeof var let void while with import';
|
||||
var KEYWORDS_ATOM = 'false null true';
|
||||
var RESERVED_WORDS = 'abstract boolean byte char double enum export final float goto implements import int interface long native package private protected public short static super synchronized this throws transient volatile yield'
|
||||
var RESERVED_WORDS = 'abstract boolean byte char double enum export final float goto implements int interface long native package private protected public short static super synchronized this throws transient volatile yield'
|
||||
+ " " + KEYWORDS_ATOM + " " + KEYWORDS;
|
||||
var KEYWORDS_BEFORE_EXPRESSION = 'return new delete throw else case';
|
||||
|
||||
@@ -909,6 +909,9 @@ function parse($TEXT, options) {
|
||||
body : statement()
|
||||
});
|
||||
|
||||
case "import":
|
||||
return tmp = import_(), semicolon(), tmp;
|
||||
|
||||
default:
|
||||
unexpected();
|
||||
}
|
||||
@@ -1607,6 +1610,19 @@ function parse($TEXT, options) {
|
||||
}
|
||||
}
|
||||
|
||||
function import_() {
|
||||
return new AST_Import({
|
||||
start: prev(),
|
||||
module_name: new AST_String({
|
||||
start : S.token,
|
||||
value : S.token.value,
|
||||
quote : S.token.quote,
|
||||
end : S.token,
|
||||
}),
|
||||
end: next(),
|
||||
});
|
||||
}
|
||||
|
||||
function as_property_name() {
|
||||
var tmp = S.token;
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user