1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

Merge branch 'master' of github.com:jashkenas/coffeescript into 2

# Conflicts:
#	lib/coffee-script/parser.js
#	lib/coffeescript/lexer.js
This commit is contained in:
Geoffrey Booth 2017-04-02 23:10:31 -07:00
commit cfdec64958
6 changed files with 137 additions and 107 deletions

View file

@ -64,7 +64,7 @@
}
identifierToken() {
var alias, colon, colonOffset, id, idLength, input, match, poppedToken, prev, ref2, ref3, ref4, ref5, ref6, ref7, tag, tagToken;
var alias, colon, colonOffset, id, idLength, input, match, poppedToken, prev, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, tag, tagToken;
if (!(match = IDENTIFIER.exec(this.chunk))) {
return 0;
}
@ -90,19 +90,19 @@
return id.length;
}
}
if (id === 'as' && this.seenExport && this.tag() === 'IDENTIFIER') {
if (id === 'as' && this.seenExport && ((ref4 = this.tag()) === 'IDENTIFIER' || ref4 === 'DEFAULT')) {
this.token('AS', id);
return id.length;
}
if (id === 'default' && this.seenExport) {
if (id === 'default' && this.seenExport && ((ref5 = this.tag()) === 'EXPORT' || ref5 === 'AS')) {
this.token('DEFAULT', id);
return id.length;
}
ref4 = this.tokens, prev = ref4[ref4.length - 1];
tag = colon || (prev != null) && (((ref5 = prev[0]) === '.' || ref5 === '?.' || ref5 === '::' || ref5 === '?::') || !prev.spaced && prev[0] === '@') ? 'PROPERTY' : 'IDENTIFIER';
ref6 = this.tokens, prev = ref6[ref6.length - 1];
tag = colon || (prev != null) && (((ref7 = prev[0]) === '.' || ref7 === '?.' || ref7 === '::' || ref7 === '?::') || !prev.spaced && prev[0] === '@') ? 'PROPERTY' : 'IDENTIFIER';
if (tag === 'IDENTIFIER' && (indexOf.call(JS_KEYWORDS, id) >= 0 || indexOf.call(COFFEE_KEYWORDS, id) >= 0) && !(this.exportSpecifierList && indexOf.call(COFFEE_KEYWORDS, id) >= 0)) {
tag = id.toUpperCase();
if (tag === 'WHEN' && (ref6 = this.tag(), indexOf.call(LINE_BREAK, ref6) >= 0)) {
if (tag === 'WHEN' && (ref8 = this.tag(), indexOf.call(LINE_BREAK, ref8) >= 0)) {
tag = 'LEADING_WHEN';
} else if (tag === 'FOR') {
this.seenFor = true;
@ -167,7 +167,7 @@
tagToken.origin = [tag, alias, tagToken[2]];
}
if (poppedToken) {
ref7 = [poppedToken[2].first_line, poppedToken[2].first_column], tagToken[2].first_line = ref7[0], tagToken[2].first_column = ref7[1];
ref9 = [poppedToken[2].first_line, poppedToken[2].first_column], tagToken[2].first_line = ref9[0], tagToken[2].first_column = ref9[1];
}
if (colon) {
colonOffset = input.lastIndexOf(':');