Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: frog/minfrog

Issue 8980014: Make 'class' and 'extends' into real keywords, per language spec 0.06 . (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | frog/scripts/token_info.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env node 1 #!/usr/bin/env node
2 // ********** Library dart:core ************** 2 // ********** Library dart:core **************
3 // ********** Natives dart:core ************** 3 // ********** Natives dart:core **************
4 /** 4 /**
5 * Generates a dynamic call stub for a function. 5 * Generates a dynamic call stub for a function.
6 * Our goal is to create a stub method like this on-the-fly: 6 * Our goal is to create a stub method like this on-the-fly:
7 * function($0, $1, capture) { return this($0, $1, true, capture); } 7 * function($0, $1, capture) { return this($0, $1, true, capture); }
8 * 8 *
9 * This stub then replaces the dynamic one on Function, with one that is 9 * This stub then replaces the dynamic one on Function, with one that is
10 * specialized for that particular function, taking into account its default 10 * specialized for that particular function, taking into account its default
(...skipping 4960 matching lines...) Expand 10 before | Expand all | Expand 10 after
4971 FieldMember.prototype.get$isField = function() { 4971 FieldMember.prototype.get$isField = function() {
4972 return true; 4972 return true;
4973 } 4973 }
4974 FieldMember.prototype.resolve = function() { 4974 FieldMember.prototype.resolve = function() {
4975 this.isStatic = this.declaringType.get$isTop(); 4975 this.isStatic = this.declaringType.get$isTop();
4976 this.isFinal = false; 4976 this.isFinal = false;
4977 if (this.definition.modifiers != null) { 4977 if (this.definition.modifiers != null) {
4978 var $$list = this.definition.modifiers; 4978 var $$list = this.definition.modifiers;
4979 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { 4979 for (var $$i = 0;$$i < $$list.get$length(); $$i++) {
4980 var mod = $$list.$index($$i); 4980 var mod = $$list.$index($$i);
4981 if ($eq(mod.get$kind(), 86/*TokenKind.STATIC*/)) { 4981 if ($eq(mod.get$kind(), 84/*TokenKind.STATIC*/)) {
4982 if (this.isStatic) { 4982 if (this.isStatic) {
4983 $globals.world.error('duplicate static modifier', mod.get$span()); 4983 $globals.world.error('duplicate static modifier', mod.get$span());
4984 } 4984 }
4985 this.isStatic = true; 4985 this.isStatic = true;
4986 } 4986 }
4987 else if ($eq(mod.get$kind(), 98/*TokenKind.FINAL*/)) { 4987 else if ($eq(mod.get$kind(), 98/*TokenKind.FINAL*/)) {
4988 if (this.isFinal) { 4988 if (this.isFinal) {
4989 $globals.world.error('duplicate final modifier', mod.get$span()); 4989 $globals.world.error('duplicate final modifier', mod.get$span());
4990 } 4990 }
4991 this.isFinal = true; 4991 this.isFinal = true;
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
5982 } 5982 }
5983 MethodMember.prototype.resolve = function() { 5983 MethodMember.prototype.resolve = function() {
5984 this.isStatic = this.declaringType.get$isTop(); 5984 this.isStatic = this.declaringType.get$isTop();
5985 this.isConst = false; 5985 this.isConst = false;
5986 this.isFactory = false; 5986 this.isFactory = false;
5987 this.isAbstract = !this.declaringType.get$isClass(); 5987 this.isAbstract = !this.declaringType.get$isClass();
5988 if (this.definition.modifiers != null) { 5988 if (this.definition.modifiers != null) {
5989 var $$list = this.definition.modifiers; 5989 var $$list = this.definition.modifiers;
5990 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { 5990 for (var $$i = 0;$$i < $$list.get$length(); $$i++) {
5991 var mod = $$list.$index($$i); 5991 var mod = $$list.$index($$i);
5992 if ($eq(mod.get$kind(), 86/*TokenKind.STATIC*/)) { 5992 if ($eq(mod.get$kind(), 84/*TokenKind.STATIC*/)) {
5993 if (this.isStatic) { 5993 if (this.isStatic) {
5994 $globals.world.error('duplicate static modifier', mod.get$span()); 5994 $globals.world.error('duplicate static modifier', mod.get$span());
5995 } 5995 }
5996 this.isStatic = true; 5996 this.isStatic = true;
5997 } 5997 }
5998 else if (this.get$isConstructor() && $eq(mod.get$kind(), 92/*TokenKind.CON ST*/)) { 5998 else if (this.get$isConstructor() && $eq(mod.get$kind(), 91/*TokenKind.CON ST*/)) {
5999 if (this.isConst) { 5999 if (this.isConst) {
6000 $globals.world.error('duplicate const modifier', mod.get$span()); 6000 $globals.world.error('duplicate const modifier', mod.get$span());
6001 } 6001 }
6002 this.isConst = true; 6002 this.isConst = true;
6003 } 6003 }
6004 else if ($eq(mod.get$kind(), 75/*TokenKind.FACTORY*/)) { 6004 else if ($eq(mod.get$kind(), 73/*TokenKind.FACTORY*/)) {
6005 if (this.isFactory) { 6005 if (this.isFactory) {
6006 $globals.world.error('duplicate factory modifier', mod.get$span()); 6006 $globals.world.error('duplicate factory modifier', mod.get$span());
6007 } 6007 }
6008 this.isFactory = true; 6008 this.isFactory = true;
6009 } 6009 }
6010 else if ($eq(mod.get$kind(), 71/*TokenKind.ABSTRACT*/)) { 6010 else if ($eq(mod.get$kind(), 71/*TokenKind.ABSTRACT*/)) {
6011 if (this.isAbstract) { 6011 if (this.isAbstract) {
6012 if (this.declaringType.get$isClass()) { 6012 if (this.declaringType.get$isClass()) {
6013 $globals.world.error('duplicate abstract modifier', mod.get$span()); 6013 $globals.world.error('duplicate abstract modifier', mod.get$span());
6014 } 6014 }
(...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
7274 } 7274 }
7275 7275
7276 } 7276 }
7277 } 7277 }
7278 Tokenizer.prototype.getIdentifierKind = function() { 7278 Tokenizer.prototype.getIdentifierKind = function() {
7279 var i0 = this._startIndex; 7279 var i0 = this._startIndex;
7280 switch (this._index - i0) { 7280 switch (this._index - i0) {
7281 case 2: 7281 case 2:
7282 7282
7283 if (this._text.charCodeAt(i0) == 100) { 7283 if (this._text.charCodeAt(i0) == 100) {
7284 if (this._text.charCodeAt(i0 + 1) == 111) return 95/*TokenKind.DO*/; 7284 if (this._text.charCodeAt(i0 + 1) == 111) return 94/*TokenKind.DO*/;
7285 } 7285 }
7286 else if (this._text.charCodeAt(i0) == 105) { 7286 else if (this._text.charCodeAt(i0) == 105) {
7287 if (this._text.charCodeAt(i0 + 1) == 102) { 7287 if (this._text.charCodeAt(i0 + 1) == 102) {
7288 return 101/*TokenKind.IF*/; 7288 return 101/*TokenKind.IF*/;
7289 } 7289 }
7290 else if (this._text.charCodeAt(i0 + 1) == 110) { 7290 else if (this._text.charCodeAt(i0 + 1) == 110) {
7291 return 102/*TokenKind.IN*/; 7291 return 102/*TokenKind.IN*/;
7292 } 7292 }
7293 else if (this._text.charCodeAt(i0 + 1) == 115) { 7293 else if (this._text.charCodeAt(i0 + 1) == 115) {
7294 return 103/*TokenKind.IS*/; 7294 return 103/*TokenKind.IS*/;
7295 } 7295 }
7296 } 7296 }
7297 return 70/*TokenKind.IDENTIFIER*/; 7297 return 70/*TokenKind.IDENTIFIER*/;
7298 7298
7299 case 3: 7299 case 3:
7300 7300
7301 if (this._text.charCodeAt(i0) == 102) { 7301 if (this._text.charCodeAt(i0) == 102) {
7302 if (this._text.charCodeAt(i0 + 1) == 111 && this._text.charCodeAt(i0 + 2 ) == 114) return 100/*TokenKind.FOR*/; 7302 if (this._text.charCodeAt(i0 + 1) == 111 && this._text.charCodeAt(i0 + 2 ) == 114) return 100/*TokenKind.FOR*/;
7303 } 7303 }
7304 else if (this._text.charCodeAt(i0) == 103) { 7304 else if (this._text.charCodeAt(i0) == 103) {
7305 if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2 ) == 116) return 76/*TokenKind.GET*/; 7305 if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2 ) == 116) return 74/*TokenKind.GET*/;
7306 } 7306 }
7307 else if (this._text.charCodeAt(i0) == 110) { 7307 else if (this._text.charCodeAt(i0) == 110) {
7308 if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2 ) == 119) return 104/*TokenKind.NEW*/; 7308 if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2 ) == 119) return 104/*TokenKind.NEW*/;
7309 } 7309 }
7310 else if (this._text.charCodeAt(i0) == 115) { 7310 else if (this._text.charCodeAt(i0) == 115) {
7311 if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2 ) == 116) return 84/*TokenKind.SET*/; 7311 if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2 ) == 116) return 82/*TokenKind.SET*/;
7312 } 7312 }
7313 else if (this._text.charCodeAt(i0) == 116) { 7313 else if (this._text.charCodeAt(i0) == 116) {
7314 if (this._text.charCodeAt(i0 + 1) == 114 && this._text.charCodeAt(i0 + 2 ) == 121) return 112/*TokenKind.TRY*/; 7314 if (this._text.charCodeAt(i0 + 1) == 114 && this._text.charCodeAt(i0 + 2 ) == 121) return 112/*TokenKind.TRY*/;
7315 } 7315 }
7316 else if (this._text.charCodeAt(i0) == 118) { 7316 else if (this._text.charCodeAt(i0) == 118) {
7317 if (this._text.charCodeAt(i0 + 1) == 97 && this._text.charCodeAt(i0 + 2) == 114) return 113/*TokenKind.VAR*/; 7317 if (this._text.charCodeAt(i0 + 1) == 97 && this._text.charCodeAt(i0 + 2) == 114) return 113/*TokenKind.VAR*/;
7318 } 7318 }
7319 return 70/*TokenKind.IDENTIFIER*/; 7319 return 70/*TokenKind.IDENTIFIER*/;
7320 7320
7321 case 4: 7321 case 4:
7322 7322
7323 if (this._text.charCodeAt(i0) == 99) { 7323 if (this._text.charCodeAt(i0) == 99) {
7324 if (this._text.charCodeAt(i0 + 1) == 97 && this._text.charCodeAt(i0 + 2) == 115 && this._text.charCodeAt(i0 + 3) == 101) return 90/*TokenKind.CASE*/; 7324 if (this._text.charCodeAt(i0 + 1) == 97 && this._text.charCodeAt(i0 + 2) == 115 && this._text.charCodeAt(i0 + 3) == 101) return 88/*TokenKind.CASE*/;
7325 } 7325 }
7326 else if (this._text.charCodeAt(i0) == 101) { 7326 else if (this._text.charCodeAt(i0) == 101) {
7327 if (this._text.charCodeAt(i0 + 1) == 108 && this._text.charCodeAt(i0 + 2 ) == 115 && this._text.charCodeAt(i0 + 3) == 101) return 96/*TokenKind.ELSE*/; 7327 if (this._text.charCodeAt(i0 + 1) == 108 && this._text.charCodeAt(i0 + 2 ) == 115 && this._text.charCodeAt(i0 + 3) == 101) return 95/*TokenKind.ELSE*/;
7328 } 7328 }
7329 else if (this._text.charCodeAt(i0) == 110) { 7329 else if (this._text.charCodeAt(i0) == 110) {
7330 if (this._text.charCodeAt(i0 + 1) == 117 && this._text.charCodeAt(i0 + 2 ) == 108 && this._text.charCodeAt(i0 + 3) == 108) return 105/*TokenKind.NULL*/; 7330 if (this._text.charCodeAt(i0 + 1) == 117 && this._text.charCodeAt(i0 + 2 ) == 108 && this._text.charCodeAt(i0 + 3) == 108) return 105/*TokenKind.NULL*/;
7331 } 7331 }
7332 else if (this._text.charCodeAt(i0) == 116) { 7332 else if (this._text.charCodeAt(i0) == 116) {
7333 if (this._text.charCodeAt(i0 + 1) == 104) { 7333 if (this._text.charCodeAt(i0 + 1) == 104) {
7334 if (this._text.charCodeAt(i0 + 2) == 105 && this._text.charCodeAt(i0 + 3) == 115) return 109/*TokenKind.THIS*/; 7334 if (this._text.charCodeAt(i0 + 2) == 105 && this._text.charCodeAt(i0 + 3) == 115) return 109/*TokenKind.THIS*/;
7335 } 7335 }
7336 else if (this._text.charCodeAt(i0 + 1) == 114) { 7336 else if (this._text.charCodeAt(i0 + 1) == 114) {
7337 if (this._text.charCodeAt(i0 + 2) == 117 && this._text.charCodeAt(i0 + 3) == 101) return 111/*TokenKind.TRUE*/; 7337 if (this._text.charCodeAt(i0 + 2) == 117 && this._text.charCodeAt(i0 + 3) == 101) return 111/*TokenKind.TRUE*/;
7338 } 7338 }
7339 } 7339 }
7340 else if (this._text.charCodeAt(i0) == 118) { 7340 else if (this._text.charCodeAt(i0) == 118) {
7341 if (this._text.charCodeAt(i0 + 1) == 111 && this._text.charCodeAt(i0 + 2 ) == 105 && this._text.charCodeAt(i0 + 3) == 100) return 114/*TokenKind.VOID*/; 7341 if (this._text.charCodeAt(i0 + 1) == 111 && this._text.charCodeAt(i0 + 2 ) == 105 && this._text.charCodeAt(i0 + 3) == 100) return 114/*TokenKind.VOID*/;
7342 } 7342 }
7343 return 70/*TokenKind.IDENTIFIER*/; 7343 return 70/*TokenKind.IDENTIFIER*/;
7344 7344
7345 case 5: 7345 case 5:
7346 7346
7347 if (this._text.charCodeAt(i0) == 97) { 7347 if (this._text.charCodeAt(i0) == 97) {
7348 if (this._text.charCodeAt(i0 + 1) == 119 && this._text.charCodeAt(i0 + 2 ) == 97 && this._text.charCodeAt(i0 + 3) == 105 && this._text.charCodeAt(i0 + 4) == 116) return 88/*TokenKind.AWAIT*/; 7348 if (this._text.charCodeAt(i0 + 1) == 119 && this._text.charCodeAt(i0 + 2 ) == 97 && this._text.charCodeAt(i0 + 3) == 105 && this._text.charCodeAt(i0 + 4) == 116) return 86/*TokenKind.AWAIT*/;
7349 } 7349 }
7350 else if (this._text.charCodeAt(i0) == 98) { 7350 else if (this._text.charCodeAt(i0) == 98) {
7351 if (this._text.charCodeAt(i0 + 1) == 114 && this._text.charCodeAt(i0 + 2 ) == 101 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 107) return 89/*TokenKind.BREAK*/; 7351 if (this._text.charCodeAt(i0 + 1) == 114 && this._text.charCodeAt(i0 + 2 ) == 101 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 107) return 87/*TokenKind.BREAK*/;
7352 } 7352 }
7353 else if (this._text.charCodeAt(i0) == 99) { 7353 else if (this._text.charCodeAt(i0) == 99) {
7354 if (this._text.charCodeAt(i0 + 1) == 97) { 7354 if (this._text.charCodeAt(i0 + 1) == 97) {
7355 if (this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 99 && this._text.charCodeAt(i0 + 4) == 104) return 91/*TokenKind.CATCH*/; 7355 if (this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 99 && this._text.charCodeAt(i0 + 4) == 104) return 89/*TokenKind.CATCH*/;
7356 } 7356 }
7357 else if (this._text.charCodeAt(i0 + 1) == 108) { 7357 else if (this._text.charCodeAt(i0 + 1) == 108) {
7358 if (this._text.charCodeAt(i0 + 2) == 97 && this._text.charCodeAt(i0 + 3) == 115 && this._text.charCodeAt(i0 + 4) == 115) return 73/*TokenKind.CLASS*/; 7358 if (this._text.charCodeAt(i0 + 2) == 97 && this._text.charCodeAt(i0 + 3) == 115 && this._text.charCodeAt(i0 + 4) == 115) return 90/*TokenKind.CLASS*/;
7359 } 7359 }
7360 else if (this._text.charCodeAt(i0 + 1) == 111) { 7360 else if (this._text.charCodeAt(i0 + 1) == 111) {
7361 if (this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 115 && this._text.charCodeAt(i0 + 4) == 116) return 92/*TokenKind.CONST*/ ; 7361 if (this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 115 && this._text.charCodeAt(i0 + 4) == 116) return 91/*TokenKind.CONST*/ ;
7362 } 7362 }
7363 } 7363 }
7364 else if (this._text.charCodeAt(i0) == 102) { 7364 else if (this._text.charCodeAt(i0) == 102) {
7365 if (this._text.charCodeAt(i0 + 1) == 97) { 7365 if (this._text.charCodeAt(i0 + 1) == 97) {
7366 if (this._text.charCodeAt(i0 + 2) == 108 && this._text.charCodeAt(i0 + 3) == 115 && this._text.charCodeAt(i0 + 4) == 101) return 97/*TokenKind.FALSE*/ ; 7366 if (this._text.charCodeAt(i0 + 2) == 108 && this._text.charCodeAt(i0 + 3) == 115 && this._text.charCodeAt(i0 + 4) == 101) return 97/*TokenKind.FALSE*/ ;
7367 } 7367 }
7368 else if (this._text.charCodeAt(i0 + 1) == 105) { 7368 else if (this._text.charCodeAt(i0 + 1) == 105) {
7369 if (this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 108) return 98/*TokenKind.FINAL*/; 7369 if (this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 108) return 98/*TokenKind.FINAL*/;
7370 } 7370 }
7371 } 7371 }
7372 else if (this._text.charCodeAt(i0) == 115) { 7372 else if (this._text.charCodeAt(i0) == 115) {
7373 if (this._text.charCodeAt(i0 + 1) == 117 && this._text.charCodeAt(i0 + 2 ) == 112 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4 ) == 114) return 107/*TokenKind.SUPER*/; 7373 if (this._text.charCodeAt(i0 + 1) == 117 && this._text.charCodeAt(i0 + 2 ) == 112 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4 ) == 114) return 107/*TokenKind.SUPER*/;
7374 } 7374 }
7375 else if (this._text.charCodeAt(i0) == 116) { 7375 else if (this._text.charCodeAt(i0) == 116) {
7376 if (this._text.charCodeAt(i0 + 1) == 104 && this._text.charCodeAt(i0 + 2 ) == 114 && this._text.charCodeAt(i0 + 3) == 111 && this._text.charCodeAt(i0 + 4 ) == 119) return 110/*TokenKind.THROW*/; 7376 if (this._text.charCodeAt(i0 + 1) == 104 && this._text.charCodeAt(i0 + 2 ) == 114 && this._text.charCodeAt(i0 + 3) == 111 && this._text.charCodeAt(i0 + 4 ) == 119) return 110/*TokenKind.THROW*/;
7377 } 7377 }
7378 else if (this._text.charCodeAt(i0) == 119) { 7378 else if (this._text.charCodeAt(i0) == 119) {
7379 if (this._text.charCodeAt(i0 + 1) == 104 && this._text.charCodeAt(i0 + 2 ) == 105 && this._text.charCodeAt(i0 + 3) == 108 && this._text.charCodeAt(i0 + 4 ) == 101) return 115/*TokenKind.WHILE*/; 7379 if (this._text.charCodeAt(i0 + 1) == 104 && this._text.charCodeAt(i0 + 2 ) == 105 && this._text.charCodeAt(i0 + 3) == 108 && this._text.charCodeAt(i0 + 4 ) == 101) return 115/*TokenKind.WHILE*/;
7380 } 7380 }
7381 return 70/*TokenKind.IDENTIFIER*/; 7381 return 70/*TokenKind.IDENTIFIER*/;
7382 7382
7383 case 6: 7383 case 6:
7384 7384
7385 if (this._text.charCodeAt(i0) == 97) { 7385 if (this._text.charCodeAt(i0) == 97) {
7386 if (this._text.charCodeAt(i0 + 1) == 115 && this._text.charCodeAt(i0 + 2 ) == 115 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4 ) == 114 && this._text.charCodeAt(i0 + 5) == 116) return 72/*TokenKind.ASSERT*/; 7386 if (this._text.charCodeAt(i0 + 1) == 115 && this._text.charCodeAt(i0 + 2 ) == 115 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4 ) == 114 && this._text.charCodeAt(i0 + 5) == 116) return 72/*TokenKind.ASSERT*/;
7387 } 7387 }
7388 else if (this._text.charCodeAt(i0) == 105) { 7388 else if (this._text.charCodeAt(i0) == 105) {
7389 if (this._text.charCodeAt(i0 + 1) == 109 && this._text.charCodeAt(i0 + 2 ) == 112 && this._text.charCodeAt(i0 + 3) == 111 && this._text.charCodeAt(i0 + 4 ) == 114 && this._text.charCodeAt(i0 + 5) == 116) return 78/*TokenKind.IMPORT*/; 7389 if (this._text.charCodeAt(i0 + 1) == 109 && this._text.charCodeAt(i0 + 2 ) == 112 && this._text.charCodeAt(i0 + 3) == 111 && this._text.charCodeAt(i0 + 4 ) == 114 && this._text.charCodeAt(i0 + 5) == 116) return 76/*TokenKind.IMPORT*/;
7390 } 7390 }
7391 else if (this._text.charCodeAt(i0) == 110) { 7391 else if (this._text.charCodeAt(i0) == 110) {
7392 if (this._text.charCodeAt(i0 + 1) == 97) { 7392 if (this._text.charCodeAt(i0 + 1) == 97) {
7393 if (this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 105 && this._text.charCodeAt(i0 + 4) == 118 && this._text.charCodeAt(i0 + 5) == 101) return 81/*TokenKind.NATIVE*/; 7393 if (this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 105 && this._text.charCodeAt(i0 + 4) == 118 && this._text.charCodeAt(i0 + 5) == 101) return 79/*TokenKind.NATIVE*/;
7394 } 7394 }
7395 else if (this._text.charCodeAt(i0 + 1) == 101) { 7395 else if (this._text.charCodeAt(i0 + 1) == 101) {
7396 if (this._text.charCodeAt(i0 + 2) == 103 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 116 && this._text.charCodeAt(i0 + 5) == 101) return 82/*TokenKind.NEGATE*/; 7396 if (this._text.charCodeAt(i0 + 2) == 103 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 116 && this._text.charCodeAt(i0 + 5) == 101) return 80/*TokenKind.NEGATE*/;
7397 } 7397 }
7398 } 7398 }
7399 else if (this._text.charCodeAt(i0) == 114) { 7399 else if (this._text.charCodeAt(i0) == 114) {
7400 if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2 ) == 116 && this._text.charCodeAt(i0 + 3) == 117 && this._text.charCodeAt(i0 + 4 ) == 114 && this._text.charCodeAt(i0 + 5) == 110) return 106/*TokenKind.RETURN*/ ; 7400 if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2 ) == 116 && this._text.charCodeAt(i0 + 3) == 117 && this._text.charCodeAt(i0 + 4 ) == 114 && this._text.charCodeAt(i0 + 5) == 110) return 106/*TokenKind.RETURN*/ ;
7401 } 7401 }
7402 else if (this._text.charCodeAt(i0) == 115) { 7402 else if (this._text.charCodeAt(i0) == 115) {
7403 if (this._text.charCodeAt(i0 + 1) == 111) { 7403 if (this._text.charCodeAt(i0 + 1) == 111) {
7404 if (this._text.charCodeAt(i0 + 2) == 117 && this._text.charCodeAt(i0 + 3) == 114 && this._text.charCodeAt(i0 + 4) == 99 && this._text.charCodeAt(i0 + 5) == 101) return 85/*TokenKind.SOURCE*/; 7404 if (this._text.charCodeAt(i0 + 2) == 117 && this._text.charCodeAt(i0 + 3) == 114 && this._text.charCodeAt(i0 + 4) == 99 && this._text.charCodeAt(i0 + 5) == 101) return 83/*TokenKind.SOURCE*/;
7405 } 7405 }
7406 else if (this._text.charCodeAt(i0 + 1) == 116) { 7406 else if (this._text.charCodeAt(i0 + 1) == 116) {
7407 if (this._text.charCodeAt(i0 + 2) == 97 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 105 && this._text.charCodeAt(i0 + 5) == 99) return 86/*TokenKind.STATIC*/; 7407 if (this._text.charCodeAt(i0 + 2) == 97 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 105 && this._text.charCodeAt(i0 + 5) == 99) return 84/*TokenKind.STATIC*/;
7408 } 7408 }
7409 else if (this._text.charCodeAt(i0 + 1) == 119) { 7409 else if (this._text.charCodeAt(i0 + 1) == 119) {
7410 if (this._text.charCodeAt(i0 + 2) == 105 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 99 && this._text.charCodeAt(i0 + 5) == 104) return 108/*TokenKind.SWITCH*/; 7410 if (this._text.charCodeAt(i0 + 2) == 105 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 99 && this._text.charCodeAt(i0 + 5) == 104) return 108/*TokenKind.SWITCH*/;
7411 } 7411 }
7412 } 7412 }
7413 return 70/*TokenKind.IDENTIFIER*/; 7413 return 70/*TokenKind.IDENTIFIER*/;
7414 7414
7415 case 7: 7415 case 7:
7416 7416
7417 if (this._text.charCodeAt(i0) == 100) { 7417 if (this._text.charCodeAt(i0) == 100) {
7418 if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2 ) == 102 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 117 && this._text.charCodeAt(i0 + 5) == 108 && this._text.charCodeAt(i0 + 6) == 116) return 94/*TokenKind.DEFAULT*/; 7418 if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2 ) == 102 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 117 && this._text.charCodeAt(i0 + 5) == 108 && this._text.charCodeAt(i0 + 6) == 116) return 93/*TokenKind.DEFAULT*/;
7419 } 7419 }
7420 else if (this._text.charCodeAt(i0) == 101) { 7420 else if (this._text.charCodeAt(i0) == 101) {
7421 if (this._text.charCodeAt(i0 + 1) == 120 && this._text.charCodeAt(i0 + 2 ) == 116 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4 ) == 110 && this._text.charCodeAt(i0 + 5) == 100 && this._text.charCodeAt(i0 + 6 ) == 115) return 74/*TokenKind.EXTENDS*/; 7421 if (this._text.charCodeAt(i0 + 1) == 120 && this._text.charCodeAt(i0 + 2 ) == 116 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4 ) == 110 && this._text.charCodeAt(i0 + 5) == 100 && this._text.charCodeAt(i0 + 6 ) == 115) return 96/*TokenKind.EXTENDS*/;
7422 } 7422 }
7423 else if (this._text.charCodeAt(i0) == 102) { 7423 else if (this._text.charCodeAt(i0) == 102) {
7424 if (this._text.charCodeAt(i0 + 1) == 97) { 7424 if (this._text.charCodeAt(i0 + 1) == 97) {
7425 if (this._text.charCodeAt(i0 + 2) == 99 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 111 && this._text.charCodeAt(i0 + 5) == 114 && this._text.charCodeAt(i0 + 6) == 121) return 75/*TokenKind.FACTORY* /; 7425 if (this._text.charCodeAt(i0 + 2) == 99 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 111 && this._text.charCodeAt(i0 + 5) == 114 && this._text.charCodeAt(i0 + 6) == 121) return 73/*TokenKind.FACTORY* /;
7426 } 7426 }
7427 else if (this._text.charCodeAt(i0 + 1) == 105) { 7427 else if (this._text.charCodeAt(i0 + 1) == 105) {
7428 if (this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 108 && this._text.charCodeAt(i0 + 5) == 108 && this._text.charCodeAt(i0 + 6) == 121) return 99/*TokenKind.FINALLY* /; 7428 if (this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 108 && this._text.charCodeAt(i0 + 5) == 108 && this._text.charCodeAt(i0 + 6) == 121) return 99/*TokenKind.FINALLY* /;
7429 } 7429 }
7430 } 7430 }
7431 else if (this._text.charCodeAt(i0) == 108) { 7431 else if (this._text.charCodeAt(i0) == 108) {
7432 if (this._text.charCodeAt(i0 + 1) == 105 && this._text.charCodeAt(i0 + 2 ) == 98 && this._text.charCodeAt(i0 + 3) == 114 && this._text.charCodeAt(i0 + 4) == 97 && this._text.charCodeAt(i0 + 5) == 114 && this._text.charCodeAt(i0 + 6) == 121) return 80/*TokenKind.LIBRARY*/; 7432 if (this._text.charCodeAt(i0 + 1) == 105 && this._text.charCodeAt(i0 + 2 ) == 98 && this._text.charCodeAt(i0 + 3) == 114 && this._text.charCodeAt(i0 + 4) == 97 && this._text.charCodeAt(i0 + 5) == 114 && this._text.charCodeAt(i0 + 6) == 121) return 78/*TokenKind.LIBRARY*/;
7433 } 7433 }
7434 else if (this._text.charCodeAt(i0) == 116) { 7434 else if (this._text.charCodeAt(i0) == 116) {
7435 if (this._text.charCodeAt(i0 + 1) == 121 && this._text.charCodeAt(i0 + 2 ) == 112 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4 ) == 100 && this._text.charCodeAt(i0 + 5) == 101 && this._text.charCodeAt(i0 + 6 ) == 102) return 87/*TokenKind.TYPEDEF*/; 7435 if (this._text.charCodeAt(i0 + 1) == 121 && this._text.charCodeAt(i0 + 2 ) == 112 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4 ) == 100 && this._text.charCodeAt(i0 + 5) == 101 && this._text.charCodeAt(i0 + 6 ) == 102) return 85/*TokenKind.TYPEDEF*/;
7436 } 7436 }
7437 return 70/*TokenKind.IDENTIFIER*/; 7437 return 70/*TokenKind.IDENTIFIER*/;
7438 7438
7439 case 8: 7439 case 8:
7440 7440
7441 if (this._text.charCodeAt(i0) == 97) { 7441 if (this._text.charCodeAt(i0) == 97) {
7442 if (this._text.charCodeAt(i0 + 1) == 98 && this._text.charCodeAt(i0 + 2) == 115 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 97 && this._text.charCodeAt(i0 + 6) == 99 && this._text.charCodeAt(i0 + 7) == 116) return 71/*TokenKind.ABSTRACT*/; 7442 if (this._text.charCodeAt(i0 + 1) == 98 && this._text.charCodeAt(i0 + 2) == 115 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 97 && this._text.charCodeAt(i0 + 6) == 99 && this._text.charCodeAt(i0 + 7) == 116) return 71/*TokenKind.ABSTRACT*/;
7443 } 7443 }
7444 else if (this._text.charCodeAt(i0) == 99) { 7444 else if (this._text.charCodeAt(i0) == 99) {
7445 if (this._text.charCodeAt(i0 + 1) == 111 && this._text.charCodeAt(i0 + 2 ) == 110 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4 ) == 105 && this._text.charCodeAt(i0 + 5) == 110 && this._text.charCodeAt(i0 + 6 ) == 117 && this._text.charCodeAt(i0 + 7) == 101) return 93/*TokenKind.CONTINUE* /; 7445 if (this._text.charCodeAt(i0 + 1) == 111 && this._text.charCodeAt(i0 + 2 ) == 110 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4 ) == 105 && this._text.charCodeAt(i0 + 5) == 110 && this._text.charCodeAt(i0 + 6 ) == 117 && this._text.charCodeAt(i0 + 7) == 101) return 92/*TokenKind.CONTINUE* /;
7446 } 7446 }
7447 else if (this._text.charCodeAt(i0) == 111) { 7447 else if (this._text.charCodeAt(i0) == 111) {
7448 if (this._text.charCodeAt(i0 + 1) == 112 && this._text.charCodeAt(i0 + 2 ) == 101 && this._text.charCodeAt(i0 + 3) == 114 && this._text.charCodeAt(i0 + 4 ) == 97 && this._text.charCodeAt(i0 + 5) == 116 && this._text.charCodeAt(i0 + 6) == 111 && this._text.charCodeAt(i0 + 7) == 114) return 83/*TokenKind.OPERATOR*/ ; 7448 if (this._text.charCodeAt(i0 + 1) == 112 && this._text.charCodeAt(i0 + 2 ) == 101 && this._text.charCodeAt(i0 + 3) == 114 && this._text.charCodeAt(i0 + 4 ) == 97 && this._text.charCodeAt(i0 + 5) == 116 && this._text.charCodeAt(i0 + 6) == 111 && this._text.charCodeAt(i0 + 7) == 114) return 81/*TokenKind.OPERATOR*/ ;
7449 } 7449 }
7450 return 70/*TokenKind.IDENTIFIER*/; 7450 return 70/*TokenKind.IDENTIFIER*/;
7451 7451
7452 case 9: 7452 case 9:
7453 7453
7454 if (this._text.charCodeAt(i0) == 105 && this._text.charCodeAt(i0 + 1) == 1 10 && this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 1 01 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 1 02 && this._text.charCodeAt(i0 + 6) == 97 && this._text.charCodeAt(i0 + 7) == 99 && this._text.charCodeAt(i0 + 8) == 101) return 79/*TokenKind.INTERFACE*/; 7454 if (this._text.charCodeAt(i0) == 105 && this._text.charCodeAt(i0 + 1) == 1 10 && this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 1 01 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 1 02 && this._text.charCodeAt(i0 + 6) == 97 && this._text.charCodeAt(i0 + 7) == 99 && this._text.charCodeAt(i0 + 8) == 101) return 77/*TokenKind.INTERFACE*/;
7455 return 70/*TokenKind.IDENTIFIER*/; 7455 return 70/*TokenKind.IDENTIFIER*/;
7456 7456
7457 case 10: 7457 case 10:
7458 7458
7459 if (this._text.charCodeAt(i0) == 105 && this._text.charCodeAt(i0 + 1) == 1 09 && this._text.charCodeAt(i0 + 2) == 112 && this._text.charCodeAt(i0 + 3) == 1 08 && this._text.charCodeAt(i0 + 4) == 101 && this._text.charCodeAt(i0 + 5) == 1 09 && this._text.charCodeAt(i0 + 6) == 101 && this._text.charCodeAt(i0 + 7) == 1 10 && this._text.charCodeAt(i0 + 8) == 116 && this._text.charCodeAt(i0 + 9) == 1 15) return 77/*TokenKind.IMPLEMENTS*/; 7459 if (this._text.charCodeAt(i0) == 105 && this._text.charCodeAt(i0 + 1) == 1 09 && this._text.charCodeAt(i0 + 2) == 112 && this._text.charCodeAt(i0 + 3) == 1 08 && this._text.charCodeAt(i0 + 4) == 101 && this._text.charCodeAt(i0 + 5) == 1 09 && this._text.charCodeAt(i0 + 6) == 101 && this._text.charCodeAt(i0 + 7) == 1 10 && this._text.charCodeAt(i0 + 8) == 116 && this._text.charCodeAt(i0 + 9) == 1 15) return 75/*TokenKind.IMPLEMENTS*/;
7460 return 70/*TokenKind.IDENTIFIER*/; 7460 return 70/*TokenKind.IDENTIFIER*/;
7461 7461
7462 default: 7462 default:
7463 7463
7464 return 70/*TokenKind.IDENTIFIER*/; 7464 return 70/*TokenKind.IDENTIFIER*/;
7465 7465
7466 } 7466 }
7467 } 7467 }
7468 Tokenizer.prototype.next$0 = Tokenizer.prototype.next; 7468 Tokenizer.prototype.next$0 = Tokenizer.prototype.next;
7469 // ********** Code for TokenKind ************** 7469 // ********** Code for TokenKind **************
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
7751 return "identifier"; 7751 return "identifier";
7752 7752
7753 case 71/*TokenKind.ABSTRACT*/: 7753 case 71/*TokenKind.ABSTRACT*/:
7754 7754
7755 return "pseudo-keyword 'abstract'"; 7755 return "pseudo-keyword 'abstract'";
7756 7756
7757 case 72/*TokenKind.ASSERT*/: 7757 case 72/*TokenKind.ASSERT*/:
7758 7758
7759 return "pseudo-keyword 'assert'"; 7759 return "pseudo-keyword 'assert'";
7760 7760
7761 case 73/*TokenKind.CLASS*/: 7761 case 90/*TokenKind.CLASS*/:
7762 7762
7763 return "pseudo-keyword 'class'"; 7763 return "pseudo-keyword 'class'";
7764 7764
7765 case 74/*TokenKind.EXTENDS*/: 7765 case 96/*TokenKind.EXTENDS*/:
7766 7766
7767 return "pseudo-keyword 'extends'"; 7767 return "pseudo-keyword 'extends'";
7768 7768
7769 case 75/*TokenKind.FACTORY*/: 7769 case 73/*TokenKind.FACTORY*/:
7770 7770
7771 return "pseudo-keyword 'factory'"; 7771 return "pseudo-keyword 'factory'";
7772 7772
7773 case 76/*TokenKind.GET*/: 7773 case 74/*TokenKind.GET*/:
7774 7774
7775 return "pseudo-keyword 'get'"; 7775 return "pseudo-keyword 'get'";
7776 7776
7777 case 77/*TokenKind.IMPLEMENTS*/: 7777 case 75/*TokenKind.IMPLEMENTS*/:
7778 7778
7779 return "pseudo-keyword 'implements'"; 7779 return "pseudo-keyword 'implements'";
7780 7780
7781 case 78/*TokenKind.IMPORT*/: 7781 case 76/*TokenKind.IMPORT*/:
7782 7782
7783 return "pseudo-keyword 'import'"; 7783 return "pseudo-keyword 'import'";
7784 7784
7785 case 79/*TokenKind.INTERFACE*/: 7785 case 77/*TokenKind.INTERFACE*/:
7786 7786
7787 return "pseudo-keyword 'interface'"; 7787 return "pseudo-keyword 'interface'";
7788 7788
7789 case 80/*TokenKind.LIBRARY*/: 7789 case 78/*TokenKind.LIBRARY*/:
7790 7790
7791 return "pseudo-keyword 'library'"; 7791 return "pseudo-keyword 'library'";
7792 7792
7793 case 81/*TokenKind.NATIVE*/: 7793 case 79/*TokenKind.NATIVE*/:
7794 7794
7795 return "pseudo-keyword 'native'"; 7795 return "pseudo-keyword 'native'";
7796 7796
7797 case 82/*TokenKind.NEGATE*/: 7797 case 80/*TokenKind.NEGATE*/:
7798 7798
7799 return "pseudo-keyword 'negate'"; 7799 return "pseudo-keyword 'negate'";
7800 7800
7801 case 83/*TokenKind.OPERATOR*/: 7801 case 81/*TokenKind.OPERATOR*/:
7802 7802
7803 return "pseudo-keyword 'operator'"; 7803 return "pseudo-keyword 'operator'";
7804 7804
7805 case 84/*TokenKind.SET*/: 7805 case 82/*TokenKind.SET*/:
7806 7806
7807 return "pseudo-keyword 'set'"; 7807 return "pseudo-keyword 'set'";
7808 7808
7809 case 85/*TokenKind.SOURCE*/: 7809 case 83/*TokenKind.SOURCE*/:
7810 7810
7811 return "pseudo-keyword 'source'"; 7811 return "pseudo-keyword 'source'";
7812 7812
7813 case 86/*TokenKind.STATIC*/: 7813 case 84/*TokenKind.STATIC*/:
7814 7814
7815 return "pseudo-keyword 'static'"; 7815 return "pseudo-keyword 'static'";
7816 7816
7817 case 87/*TokenKind.TYPEDEF*/: 7817 case 85/*TokenKind.TYPEDEF*/:
7818 7818
7819 return "pseudo-keyword 'typedef'"; 7819 return "pseudo-keyword 'typedef'";
7820 7820
7821 case 88/*TokenKind.AWAIT*/: 7821 case 86/*TokenKind.AWAIT*/:
7822 7822
7823 return "keyword 'await'"; 7823 return "keyword 'await'";
7824 7824
7825 case 89/*TokenKind.BREAK*/: 7825 case 87/*TokenKind.BREAK*/:
7826 7826
7827 return "keyword 'break'"; 7827 return "keyword 'break'";
7828 7828
7829 case 90/*TokenKind.CASE*/: 7829 case 88/*TokenKind.CASE*/:
7830 7830
7831 return "keyword 'case'"; 7831 return "keyword 'case'";
7832 7832
7833 case 91/*TokenKind.CATCH*/: 7833 case 89/*TokenKind.CATCH*/:
7834 7834
7835 return "keyword 'catch'"; 7835 return "keyword 'catch'";
7836 7836
7837 case 92/*TokenKind.CONST*/: 7837 case 91/*TokenKind.CONST*/:
7838 7838
7839 return "keyword 'const'"; 7839 return "keyword 'const'";
7840 7840
7841 case 93/*TokenKind.CONTINUE*/: 7841 case 92/*TokenKind.CONTINUE*/:
7842 7842
7843 return "keyword 'continue'"; 7843 return "keyword 'continue'";
7844 7844
7845 case 94/*TokenKind.DEFAULT*/: 7845 case 93/*TokenKind.DEFAULT*/:
7846 7846
7847 return "keyword 'default'"; 7847 return "keyword 'default'";
7848 7848
7849 case 95/*TokenKind.DO*/: 7849 case 94/*TokenKind.DO*/:
7850 7850
7851 return "keyword 'do'"; 7851 return "keyword 'do'";
7852 7852
7853 case 96/*TokenKind.ELSE*/: 7853 case 95/*TokenKind.ELSE*/:
7854 7854
7855 return "keyword 'else'"; 7855 return "keyword 'else'";
7856 7856
7857 case 97/*TokenKind.FALSE*/: 7857 case 97/*TokenKind.FALSE*/:
7858 7858
7859 return "keyword 'false'"; 7859 return "keyword 'false'";
7860 7860
7861 case 98/*TokenKind.FINAL*/: 7861 case 98/*TokenKind.FINAL*/:
7862 7862
7863 return "keyword 'final'"; 7863 return "keyword 'final'";
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
7930 7930
7931 return "keyword 'while'"; 7931 return "keyword 'while'";
7932 7932
7933 default: 7933 default:
7934 7934
7935 return "TokenKind(" + kind.toString() + ")"; 7935 return "TokenKind(" + kind.toString() + ")";
7936 7936
7937 } 7937 }
7938 } 7938 }
7939 TokenKind.isIdentifier = function(kind) { 7939 TokenKind.isIdentifier = function(kind) {
7940 return kind >= 70/*TokenKind.IDENTIFIER*/ && kind < 88/*TokenKind.AWAIT*/; 7940 return kind >= 70/*TokenKind.IDENTIFIER*/ && kind < 86/*TokenKind.AWAIT*/;
7941 } 7941 }
7942 TokenKind.infixPrecedence = function(kind) { 7942 TokenKind.infixPrecedence = function(kind) {
7943 switch (kind) { 7943 switch (kind) {
7944 case 20/*TokenKind.ASSIGN*/: 7944 case 20/*TokenKind.ASSIGN*/:
7945 7945
7946 return 2; 7946 return 2;
7947 7947
7948 case 21/*TokenKind.ASSIGN_OR*/: 7948 case 21/*TokenKind.ASSIGN_OR*/:
7949 7949
7950 return 2; 7950 return 2;
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
8322 this._peekToken = this.tokenizer.next(); 8322 this._peekToken = this.tokenizer.next();
8323 return this._previousToken; 8323 return this._previousToken;
8324 } 8324 }
8325 Parser.prototype._peekKind = function(kind) { 8325 Parser.prototype._peekKind = function(kind) {
8326 return this._peekToken.kind == kind; 8326 return this._peekToken.kind == kind;
8327 } 8327 }
8328 Parser.prototype._peekIdentifier = function() { 8328 Parser.prototype._peekIdentifier = function() {
8329 return this._isIdentifier(this._peekToken.kind); 8329 return this._isIdentifier(this._peekToken.kind);
8330 } 8330 }
8331 Parser.prototype._isIdentifier = function(kind) { 8331 Parser.prototype._isIdentifier = function(kind) {
8332 return TokenKind.isIdentifier(kind) || (!this.get$enableAwait() && $eq(kind, 8 8/*TokenKind.AWAIT*/)); 8332 return TokenKind.isIdentifier(kind) || (!this.get$enableAwait() && $eq(kind, 8 6/*TokenKind.AWAIT*/));
8333 } 8333 }
8334 Parser.prototype._maybeEat = function(kind) { 8334 Parser.prototype._maybeEat = function(kind) {
8335 if (this._peekToken.kind == kind) { 8335 if (this._peekToken.kind == kind) {
8336 this._previousToken = this._peekToken; 8336 this._previousToken = this._peekToken;
8337 this._peekToken = this.tokenizer.next(); 8337 this._peekToken = this.tokenizer.next();
8338 return true; 8338 return true;
8339 } 8339 }
8340 else { 8340 else {
8341 return false; 8341 return false;
8342 } 8342 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
8405 Parser.prototype.directive = function() { 8405 Parser.prototype.directive = function() {
8406 var start = this._peekToken.start; 8406 var start = this._peekToken.start;
8407 this._eat(12/*TokenKind.HASH*/); 8407 this._eat(12/*TokenKind.HASH*/);
8408 var name = this.identifier(); 8408 var name = this.identifier();
8409 var args = this.arguments(); 8409 var args = this.arguments();
8410 this._eatSemicolon(); 8410 this._eatSemicolon();
8411 return new DirectiveDefinition(name, args, this._makeSpan(start)); 8411 return new DirectiveDefinition(name, args, this._makeSpan(start));
8412 } 8412 }
8413 Parser.prototype.topLevelDefinition = function() { 8413 Parser.prototype.topLevelDefinition = function() {
8414 switch (this._peek()) { 8414 switch (this._peek()) {
8415 case 73/*TokenKind.CLASS*/: 8415 case 90/*TokenKind.CLASS*/:
8416 8416
8417 return this.classDefinition(73/*TokenKind.CLASS*/); 8417 return this.classDefinition(90/*TokenKind.CLASS*/);
8418 8418
8419 case 79/*TokenKind.INTERFACE*/: 8419 case 77/*TokenKind.INTERFACE*/:
8420 8420
8421 return this.classDefinition(79/*TokenKind.INTERFACE*/); 8421 return this.classDefinition(77/*TokenKind.INTERFACE*/);
8422 8422
8423 case 87/*TokenKind.TYPEDEF*/: 8423 case 85/*TokenKind.TYPEDEF*/:
8424 8424
8425 return this.functionTypeAlias(); 8425 return this.functionTypeAlias();
8426 8426
8427 default: 8427 default:
8428 8428
8429 return this.declaration(true); 8429 return this.declaration(true);
8430 8430
8431 } 8431 }
8432 } 8432 }
8433 Parser.prototype.classDefinition = function(kind) { 8433 Parser.prototype.classDefinition = function(kind) {
8434 var start = this._peekToken.start; 8434 var start = this._peekToken.start;
8435 this._eat(kind); 8435 this._eat(kind);
8436 var name = this.identifier(); 8436 var name = this.identifier();
8437 var typeParams = null; 8437 var typeParams = null;
8438 if (this._peekKind(52/*TokenKind.LT*/)) { 8438 if (this._peekKind(52/*TokenKind.LT*/)) {
8439 typeParams = this.typeParameters(); 8439 typeParams = this.typeParameters();
8440 } 8440 }
8441 var _extends = null; 8441 var _extends = null;
8442 if (this._maybeEat(74/*TokenKind.EXTENDS*/)) { 8442 if (this._maybeEat(96/*TokenKind.EXTENDS*/)) {
8443 _extends = this.typeList(); 8443 _extends = this.typeList();
8444 } 8444 }
8445 var _implements = null; 8445 var _implements = null;
8446 if (this._maybeEat(77/*TokenKind.IMPLEMENTS*/)) { 8446 if (this._maybeEat(75/*TokenKind.IMPLEMENTS*/)) {
8447 _implements = this.typeList(); 8447 _implements = this.typeList();
8448 } 8448 }
8449 var _native = null; 8449 var _native = null;
8450 if (this._maybeEat(81/*TokenKind.NATIVE*/)) { 8450 if (this._maybeEat(79/*TokenKind.NATIVE*/)) {
8451 _native = this.maybeStringLiteral(); 8451 _native = this.maybeStringLiteral();
8452 if (_native != null) _native = new NativeType(_native); 8452 if (_native != null) _native = new NativeType(_native);
8453 } 8453 }
8454 var oldFactory = this._maybeEat(75/*TokenKind.FACTORY*/); 8454 var oldFactory = this._maybeEat(73/*TokenKind.FACTORY*/);
8455 var defaultType = null; 8455 var defaultType = null;
8456 if (oldFactory || this._maybeEat(94/*TokenKind.DEFAULT*/)) { 8456 if (oldFactory || this._maybeEat(93/*TokenKind.DEFAULT*/)) {
8457 if (oldFactory) { 8457 if (oldFactory) {
8458 $globals.world.warning('factory no longer supported, use "default" instead ', this._previousToken.get$span()); 8458 $globals.world.warning('factory no longer supported, use "default" instead ', this._previousToken.get$span());
8459 } 8459 }
8460 var baseType = this.nameTypeReference(); 8460 var baseType = this.nameTypeReference();
8461 var typeParams0 = null; 8461 var typeParams0 = null;
8462 if (this._peekKind(52/*TokenKind.LT*/)) { 8462 if (this._peekKind(52/*TokenKind.LT*/)) {
8463 typeParams0 = this.typeParameters(); 8463 typeParams0 = this.typeParameters();
8464 } 8464 }
8465 defaultType = new DefaultTypeReference(oldFactory, baseType, typeParams0, th is._makeSpan(baseType.get$span().get$start())); 8465 defaultType = new DefaultTypeReference(oldFactory, baseType, typeParams0, th is._makeSpan(baseType.get$span().get$start()));
8466 } 8466 }
8467 var body = []; 8467 var body = [];
8468 if (this._maybeEat(6/*TokenKind.LBRACE*/)) { 8468 if (this._maybeEat(6/*TokenKind.LBRACE*/)) {
8469 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) { 8469 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) {
8470 body.add$1(this.declaration(true)); 8470 body.add$1(this.declaration(true));
8471 if (this._recover) { 8471 if (this._recover) {
8472 if (!this._recoverTo(7/*TokenKind.RBRACE*/, 10/*TokenKind.SEMICOLON*/)) break; 8472 if (!this._recoverTo(7/*TokenKind.RBRACE*/, 10/*TokenKind.SEMICOLON*/)) break;
8473 this._maybeEat(10/*TokenKind.SEMICOLON*/); 8473 this._maybeEat(10/*TokenKind.SEMICOLON*/);
8474 } 8474 }
8475 } 8475 }
8476 } 8476 }
8477 else { 8477 else {
8478 this._errorExpected('block starting with "{" or ";"'); 8478 this._errorExpected('block starting with "{" or ";"');
8479 } 8479 }
8480 return new TypeDefinition(kind == 73/*TokenKind.CLASS*/, name, typeParams, _ex tends, _implements, _native, defaultType, body, this._makeSpan(start)); 8480 return new TypeDefinition(kind == 90/*TokenKind.CLASS*/, name, typeParams, _ex tends, _implements, _native, defaultType, body, this._makeSpan(start));
8481 } 8481 }
8482 Parser.prototype.functionTypeAlias = function() { 8482 Parser.prototype.functionTypeAlias = function() {
8483 var start = this._peekToken.start; 8483 var start = this._peekToken.start;
8484 this._eat(87/*TokenKind.TYPEDEF*/); 8484 this._eat(85/*TokenKind.TYPEDEF*/);
8485 var di = this.declaredIdentifier(false); 8485 var di = this.declaredIdentifier(false);
8486 var typeParams = null; 8486 var typeParams = null;
8487 if (this._peekKind(52/*TokenKind.LT*/)) { 8487 if (this._peekKind(52/*TokenKind.LT*/)) {
8488 typeParams = this.typeParameters(); 8488 typeParams = this.typeParameters();
8489 } 8489 }
8490 var formals = this.formalParameterList(); 8490 var formals = this.formalParameterList();
8491 this._eatSemicolon(); 8491 this._eatSemicolon();
8492 var func = new FunctionDefinition(null, di.get$type(), di.get$name(), formals, null, null, null, this._makeSpan(start)); 8492 var func = new FunctionDefinition(null, di.get$type(), di.get$name(), formals, null, null, null, this._makeSpan(start));
8493 return new FunctionTypeDefinition(func, typeParams, this._makeSpan(start)); 8493 return new FunctionTypeDefinition(func, typeParams, this._makeSpan(start));
8494 } 8494 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
8547 } 8547 }
8548 Parser.prototype.finishDefinition = function(start, modifiers, di) { 8548 Parser.prototype.finishDefinition = function(start, modifiers, di) {
8549 switch (this._peek()) { 8549 switch (this._peek()) {
8550 case 2/*TokenKind.LPAREN*/: 8550 case 2/*TokenKind.LPAREN*/:
8551 8551
8552 var formals = this.formalParameterList(); 8552 var formals = this.formalParameterList();
8553 var inits = null, native_ = null; 8553 var inits = null, native_ = null;
8554 if (this._maybeEat(8/*TokenKind.COLON*/)) { 8554 if (this._maybeEat(8/*TokenKind.COLON*/)) {
8555 inits = this.initializers(); 8555 inits = this.initializers();
8556 } 8556 }
8557 if (this._maybeEat(81/*TokenKind.NATIVE*/)) { 8557 if (this._maybeEat(79/*TokenKind.NATIVE*/)) {
8558 native_ = this.maybeStringLiteral(); 8558 native_ = this.maybeStringLiteral();
8559 if (native_ == null) native_ = ''; 8559 if (native_ == null) native_ = '';
8560 } 8560 }
8561 var body = this.functionBody(false); 8561 var body = this.functionBody(false);
8562 if (di.get$name() == null) { 8562 if (di.get$name() == null) {
8563 di.set$name(di.get$type().get$name()); 8563 di.set$name(di.get$type().get$name());
8564 } 8564 }
8565 return new FunctionDefinition(modifiers, di.get$type(), di.get$name(), for mals, inits, native_, body, this._makeSpan(start)); 8565 return new FunctionDefinition(modifiers, di.get$type(), di.get$name(), for mals, inits, native_, body, this._makeSpan(start));
8566 8566
8567 case 20/*TokenKind.ASSIGN*/: 8567 case 20/*TokenKind.ASSIGN*/:
8568 8568
8569 this._eat(20/*TokenKind.ASSIGN*/); 8569 this._eat(20/*TokenKind.ASSIGN*/);
8570 var value = this.expression(); 8570 var value = this.expression();
8571 return this.finishField(start, modifiers, di.get$type(), di.get$name(), va lue); 8571 return this.finishField(start, modifiers, di.get$type(), di.get$name(), va lue);
8572 8572
8573 case 11/*TokenKind.COMMA*/: 8573 case 11/*TokenKind.COMMA*/:
8574 case 10/*TokenKind.SEMICOLON*/: 8574 case 10/*TokenKind.SEMICOLON*/:
8575 8575
8576 return this.finishField(start, modifiers, di.get$type(), di.get$name(), nu ll); 8576 return this.finishField(start, modifiers, di.get$type(), di.get$name(), nu ll);
8577 8577
8578 default: 8578 default:
8579 8579
8580 this._errorExpected('declaration'); 8580 this._errorExpected('declaration');
8581 return null; 8581 return null;
8582 8582
8583 } 8583 }
8584 } 8584 }
8585 Parser.prototype.declaration = function(includeOperators) { 8585 Parser.prototype.declaration = function(includeOperators) {
8586 var start = this._peekToken.start; 8586 var start = this._peekToken.start;
8587 if (this._peekKind(75/*TokenKind.FACTORY*/)) { 8587 if (this._peekKind(73/*TokenKind.FACTORY*/)) {
8588 return this.factoryConstructorDeclaration(); 8588 return this.factoryConstructorDeclaration();
8589 } 8589 }
8590 var modifiers = this._readModifiers(); 8590 var modifiers = this._readModifiers();
8591 return this.finishDefinition(start, modifiers, this.declaredIdentifier(include Operators)); 8591 return this.finishDefinition(start, modifiers, this.declaredIdentifier(include Operators));
8592 } 8592 }
8593 Parser.prototype.factoryConstructorDeclaration = function() { 8593 Parser.prototype.factoryConstructorDeclaration = function() {
8594 var start = this._peekToken.start; 8594 var start = this._peekToken.start;
8595 var factoryToken = this._next(); 8595 var factoryToken = this._next();
8596 var names = [this.identifier()]; 8596 var names = [this.identifier()];
8597 while (this._maybeEat(14/*TokenKind.DOT*/)) { 8597 while (this._maybeEat(14/*TokenKind.DOT*/)) {
(...skipping 19 matching lines...) Expand all
8617 } 8617 }
8618 if (names.get$length() > 1) { 8618 if (names.get$length() > 1) {
8619 this._error('unsupported qualified name for factory', names.$index(0).get$sp an()); 8619 this._error('unsupported qualified name for factory', names.$index(0).get$sp an());
8620 } 8620 }
8621 type = new NameTypeReference(false, names.$index(0), null, names.$index(0).get $span()); 8621 type = new NameTypeReference(false, names.$index(0), null, names.$index(0).get $span());
8622 var di = new DeclaredIdentifier(type, name, this._makeSpan(start)); 8622 var di = new DeclaredIdentifier(type, name, this._makeSpan(start));
8623 return this.finishDefinition(start, [factoryToken], di); 8623 return this.finishDefinition(start, [factoryToken], di);
8624 } 8624 }
8625 Parser.prototype.statement = function() { 8625 Parser.prototype.statement = function() {
8626 switch (this._peek()) { 8626 switch (this._peek()) {
8627 case 89/*TokenKind.BREAK*/: 8627 case 87/*TokenKind.BREAK*/:
8628 8628
8629 return this.breakStatement(); 8629 return this.breakStatement();
8630 8630
8631 case 93/*TokenKind.CONTINUE*/: 8631 case 92/*TokenKind.CONTINUE*/:
8632 8632
8633 return this.continueStatement(); 8633 return this.continueStatement();
8634 8634
8635 case 106/*TokenKind.RETURN*/: 8635 case 106/*TokenKind.RETURN*/:
8636 8636
8637 return this.returnStatement(); 8637 return this.returnStatement();
8638 8638
8639 case 110/*TokenKind.THROW*/: 8639 case 110/*TokenKind.THROW*/:
8640 8640
8641 return this.throwStatement(); 8641 return this.throwStatement();
8642 8642
8643 case 72/*TokenKind.ASSERT*/: 8643 case 72/*TokenKind.ASSERT*/:
8644 8644
8645 return this.assertStatement(); 8645 return this.assertStatement();
8646 8646
8647 case 115/*TokenKind.WHILE*/: 8647 case 115/*TokenKind.WHILE*/:
8648 8648
8649 return this.whileStatement(); 8649 return this.whileStatement();
8650 8650
8651 case 95/*TokenKind.DO*/: 8651 case 94/*TokenKind.DO*/:
8652 8652
8653 return this.doStatement(); 8653 return this.doStatement();
8654 8654
8655 case 100/*TokenKind.FOR*/: 8655 case 100/*TokenKind.FOR*/:
8656 8656
8657 return this.forStatement(); 8657 return this.forStatement();
8658 8658
8659 case 101/*TokenKind.IF*/: 8659 case 101/*TokenKind.IF*/:
8660 8660
8661 return this.ifStatement(); 8661 return this.ifStatement();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
8751 var start = this._peekToken.start; 8751 var start = this._peekToken.start;
8752 this._eat(10/*TokenKind.SEMICOLON*/); 8752 this._eat(10/*TokenKind.SEMICOLON*/);
8753 return new EmptyStatement(this._makeSpan(start)); 8753 return new EmptyStatement(this._makeSpan(start));
8754 } 8754 }
8755 Parser.prototype.ifStatement = function() { 8755 Parser.prototype.ifStatement = function() {
8756 var start = this._peekToken.start; 8756 var start = this._peekToken.start;
8757 this._eat(101/*TokenKind.IF*/); 8757 this._eat(101/*TokenKind.IF*/);
8758 var test = this.testCondition(); 8758 var test = this.testCondition();
8759 var trueBranch = this.statement(); 8759 var trueBranch = this.statement();
8760 var falseBranch = null; 8760 var falseBranch = null;
8761 if (this._maybeEat(96/*TokenKind.ELSE*/)) { 8761 if (this._maybeEat(95/*TokenKind.ELSE*/)) {
8762 falseBranch = this.statement(); 8762 falseBranch = this.statement();
8763 } 8763 }
8764 return new IfStatement(test, trueBranch, falseBranch, this._makeSpan(start)); 8764 return new IfStatement(test, trueBranch, falseBranch, this._makeSpan(start));
8765 } 8765 }
8766 Parser.prototype.whileStatement = function() { 8766 Parser.prototype.whileStatement = function() {
8767 var start = this._peekToken.start; 8767 var start = this._peekToken.start;
8768 this._eat(115/*TokenKind.WHILE*/); 8768 this._eat(115/*TokenKind.WHILE*/);
8769 var test = this.testCondition(); 8769 var test = this.testCondition();
8770 var body = this.statement(); 8770 var body = this.statement();
8771 return new WhileStatement(test, body, this._makeSpan(start)); 8771 return new WhileStatement(test, body, this._makeSpan(start));
8772 } 8772 }
8773 Parser.prototype.doStatement = function() { 8773 Parser.prototype.doStatement = function() {
8774 var start = this._peekToken.start; 8774 var start = this._peekToken.start;
8775 this._eat(95/*TokenKind.DO*/); 8775 this._eat(94/*TokenKind.DO*/);
8776 var body = this.statement(); 8776 var body = this.statement();
8777 this._eat(115/*TokenKind.WHILE*/); 8777 this._eat(115/*TokenKind.WHILE*/);
8778 var test = this.testCondition(); 8778 var test = this.testCondition();
8779 this._eatSemicolon(); 8779 this._eatSemicolon();
8780 return new DoStatement(body, test, this._makeSpan(start)); 8780 return new DoStatement(body, test, this._makeSpan(start));
8781 } 8781 }
8782 Parser.prototype.forStatement = function() { 8782 Parser.prototype.forStatement = function() {
8783 var start = this._peekToken.start; 8783 var start = this._peekToken.start;
8784 this._eat(100/*TokenKind.FOR*/); 8784 this._eat(100/*TokenKind.FOR*/);
8785 this._eatLeftParen(); 8785 this._eatLeftParen();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
8829 var expr = this.expression(); 8829 var expr = this.expression();
8830 this._eat(3/*TokenKind.RPAREN*/); 8830 this._eat(3/*TokenKind.RPAREN*/);
8831 var body = this.statement(); 8831 var body = this.statement();
8832 return new ForInStatement(di, expr, body, this._makeSpan(start)); 8832 return new ForInStatement(di, expr, body, this._makeSpan(start));
8833 } 8833 }
8834 Parser.prototype.tryStatement = function() { 8834 Parser.prototype.tryStatement = function() {
8835 var start = this._peekToken.start; 8835 var start = this._peekToken.start;
8836 this._eat(112/*TokenKind.TRY*/); 8836 this._eat(112/*TokenKind.TRY*/);
8837 var body = this.block(); 8837 var body = this.block();
8838 var catches = []; 8838 var catches = [];
8839 while (this._peekKind(91/*TokenKind.CATCH*/)) { 8839 while (this._peekKind(89/*TokenKind.CATCH*/)) {
8840 catches.add$1(this.catchNode()); 8840 catches.add$1(this.catchNode());
8841 } 8841 }
8842 var finallyBlock = null; 8842 var finallyBlock = null;
8843 if (this._maybeEat(99/*TokenKind.FINALLY*/)) { 8843 if (this._maybeEat(99/*TokenKind.FINALLY*/)) {
8844 finallyBlock = this.block(); 8844 finallyBlock = this.block();
8845 } 8845 }
8846 return new TryStatement(body, catches, finallyBlock, this._makeSpan(start)); 8846 return new TryStatement(body, catches, finallyBlock, this._makeSpan(start));
8847 } 8847 }
8848 Parser.prototype.catchNode = function() { 8848 Parser.prototype.catchNode = function() {
8849 var start = this._peekToken.start; 8849 var start = this._peekToken.start;
8850 this._eat(91/*TokenKind.CATCH*/); 8850 this._eat(89/*TokenKind.CATCH*/);
8851 this._eatLeftParen(); 8851 this._eatLeftParen();
8852 var exc = this.declaredIdentifier(false); 8852 var exc = this.declaredIdentifier(false);
8853 var trace = null; 8853 var trace = null;
8854 if (this._maybeEat(11/*TokenKind.COMMA*/)) { 8854 if (this._maybeEat(11/*TokenKind.COMMA*/)) {
8855 trace = this.declaredIdentifier(false); 8855 trace = this.declaredIdentifier(false);
8856 } 8856 }
8857 this._eat(3/*TokenKind.RPAREN*/); 8857 this._eat(3/*TokenKind.RPAREN*/);
8858 var body = this.block(); 8858 var body = this.block();
8859 return new CatchNode(exc, trace, body, this._makeSpan(start)); 8859 return new CatchNode(exc, trace, body, this._makeSpan(start));
8860 } 8860 }
8861 Parser.prototype.switchStatement = function() { 8861 Parser.prototype.switchStatement = function() {
8862 var start = this._peekToken.start; 8862 var start = this._peekToken.start;
8863 this._eat(108/*TokenKind.SWITCH*/); 8863 this._eat(108/*TokenKind.SWITCH*/);
8864 var test = this.testCondition(); 8864 var test = this.testCondition();
8865 var cases = []; 8865 var cases = [];
8866 this._eat(6/*TokenKind.LBRACE*/); 8866 this._eat(6/*TokenKind.LBRACE*/);
8867 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) { 8867 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) {
8868 cases.add$1(this.caseNode()); 8868 cases.add$1(this.caseNode());
8869 } 8869 }
8870 return new SwitchStatement(test, cases, this._makeSpan(start)); 8870 return new SwitchStatement(test, cases, this._makeSpan(start));
8871 } 8871 }
8872 Parser.prototype._peekCaseEnd = function() { 8872 Parser.prototype._peekCaseEnd = function() {
8873 var kind = this._peek(); 8873 var kind = this._peek();
8874 return $eq(kind, 7/*TokenKind.RBRACE*/) || $eq(kind, 90/*TokenKind.CASE*/) || $eq(kind, 94/*TokenKind.DEFAULT*/); 8874 return $eq(kind, 7/*TokenKind.RBRACE*/) || $eq(kind, 88/*TokenKind.CASE*/) || $eq(kind, 93/*TokenKind.DEFAULT*/);
8875 } 8875 }
8876 Parser.prototype.caseNode = function() { 8876 Parser.prototype.caseNode = function() {
8877 var start = this._peekToken.start; 8877 var start = this._peekToken.start;
8878 var label = null; 8878 var label = null;
8879 if (this._peekIdentifier()) { 8879 if (this._peekIdentifier()) {
8880 label = this.identifier(); 8880 label = this.identifier();
8881 this._eat(8/*TokenKind.COLON*/); 8881 this._eat(8/*TokenKind.COLON*/);
8882 } 8882 }
8883 var cases = []; 8883 var cases = [];
8884 while (true) { 8884 while (true) {
8885 if (this._maybeEat(90/*TokenKind.CASE*/)) { 8885 if (this._maybeEat(88/*TokenKind.CASE*/)) {
8886 cases.add$1(this.expression()); 8886 cases.add$1(this.expression());
8887 this._eat(8/*TokenKind.COLON*/); 8887 this._eat(8/*TokenKind.COLON*/);
8888 } 8888 }
8889 else if (this._maybeEat(94/*TokenKind.DEFAULT*/)) { 8889 else if (this._maybeEat(93/*TokenKind.DEFAULT*/)) {
8890 cases.add$1(); 8890 cases.add$1();
8891 this._eat(8/*TokenKind.COLON*/); 8891 this._eat(8/*TokenKind.COLON*/);
8892 } 8892 }
8893 else { 8893 else {
8894 break; 8894 break;
8895 } 8895 }
8896 } 8896 }
8897 if ($eq(cases.get$length(), 0)) { 8897 if ($eq(cases.get$length(), 0)) {
8898 this._error('case or default'); 8898 this._error('case or default');
8899 } 8899 }
8900 var stmts = []; 8900 var stmts = [];
8901 while (!this._peekCaseEnd()) { 8901 while (!this._peekCaseEnd()) {
8902 stmts.add$1(this.statement()); 8902 stmts.add$1(this.statement());
8903 if (this._recover && !this._recoverTo(7/*TokenKind.RBRACE*/, 90/*TokenKind.C ASE*/, 94/*TokenKind.DEFAULT*/)) { 8903 if (this._recover && !this._recoverTo(7/*TokenKind.RBRACE*/, 88/*TokenKind.C ASE*/, 93/*TokenKind.DEFAULT*/)) {
8904 break; 8904 break;
8905 } 8905 }
8906 } 8906 }
8907 return new CaseNode(label, cases, stmts, this._makeSpan(start)); 8907 return new CaseNode(label, cases, stmts, this._makeSpan(start));
8908 } 8908 }
8909 Parser.prototype.returnStatement = function() { 8909 Parser.prototype.returnStatement = function() {
8910 var start = this._peekToken.start; 8910 var start = this._peekToken.start;
8911 this._eat(106/*TokenKind.RETURN*/); 8911 this._eat(106/*TokenKind.RETURN*/);
8912 var expr; 8912 var expr;
8913 if (this._maybeEat(10/*TokenKind.SEMICOLON*/)) { 8913 if (this._maybeEat(10/*TokenKind.SEMICOLON*/)) {
(...skipping 22 matching lines...) Expand all
8936 var start = this._peekToken.start; 8936 var start = this._peekToken.start;
8937 this._eat(72/*TokenKind.ASSERT*/); 8937 this._eat(72/*TokenKind.ASSERT*/);
8938 this._eatLeftParen(); 8938 this._eatLeftParen();
8939 var expr = this.expression(); 8939 var expr = this.expression();
8940 this._eat(3/*TokenKind.RPAREN*/); 8940 this._eat(3/*TokenKind.RPAREN*/);
8941 this._eatSemicolon(); 8941 this._eatSemicolon();
8942 return new AssertStatement(expr, this._makeSpan(start)); 8942 return new AssertStatement(expr, this._makeSpan(start));
8943 } 8943 }
8944 Parser.prototype.breakStatement = function() { 8944 Parser.prototype.breakStatement = function() {
8945 var start = this._peekToken.start; 8945 var start = this._peekToken.start;
8946 this._eat(89/*TokenKind.BREAK*/); 8946 this._eat(87/*TokenKind.BREAK*/);
8947 var name = null; 8947 var name = null;
8948 if (this._peekIdentifier()) { 8948 if (this._peekIdentifier()) {
8949 name = this.identifier(); 8949 name = this.identifier();
8950 } 8950 }
8951 this._eatSemicolon(); 8951 this._eatSemicolon();
8952 return new BreakStatement(name, this._makeSpan(start)); 8952 return new BreakStatement(name, this._makeSpan(start));
8953 } 8953 }
8954 Parser.prototype.continueStatement = function() { 8954 Parser.prototype.continueStatement = function() {
8955 var start = this._peekToken.start; 8955 var start = this._peekToken.start;
8956 this._eat(93/*TokenKind.CONTINUE*/); 8956 this._eat(92/*TokenKind.CONTINUE*/);
8957 var name = null; 8957 var name = null;
8958 if (this._peekIdentifier()) { 8958 if (this._peekIdentifier()) {
8959 name = this.identifier(); 8959 name = this.identifier();
8960 } 8960 }
8961 this._eatSemicolon(); 8961 this._eatSemicolon();
8962 return new ContinueStatement(name, this._makeSpan(start)); 8962 return new ContinueStatement(name, this._makeSpan(start));
8963 } 8963 }
8964 Parser.prototype.expression = function() { 8964 Parser.prototype.expression = function() {
8965 return this.infixExpression(0); 8965 return this.infixExpression(0);
8966 } 8966 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
9066 9066
9067 } 9067 }
9068 } 9068 }
9069 Parser.prototype.unaryExpression = function() { 9069 Parser.prototype.unaryExpression = function() {
9070 var start = this._peekToken.start; 9070 var start = this._peekToken.start;
9071 if (this._isPrefixUnaryOperator(this._peek())) { 9071 if (this._isPrefixUnaryOperator(this._peek())) {
9072 var tok = this._next(); 9072 var tok = this._next();
9073 var expr = this.unaryExpression(); 9073 var expr = this.unaryExpression();
9074 return new UnaryExpression(tok, expr, this._makeSpan(start)); 9074 return new UnaryExpression(tok, expr, this._makeSpan(start));
9075 } 9075 }
9076 else if (this.get$enableAwait() && this._maybeEat(88/*TokenKind.AWAIT*/)) { 9076 else if (this.get$enableAwait() && this._maybeEat(86/*TokenKind.AWAIT*/)) {
9077 var expr = this.unaryExpression(); 9077 var expr = this.unaryExpression();
9078 return new AwaitExpression(expr, this._makeSpan(start)); 9078 return new AwaitExpression(expr, this._makeSpan(start));
9079 } 9079 }
9080 return this.finishPostfixExpression(this.primary()); 9080 return this.finishPostfixExpression(this.primary());
9081 } 9081 }
9082 Parser.prototype.argument = function() { 9082 Parser.prototype.argument = function() {
9083 var start = this._peekToken.start; 9083 var start = this._peekToken.start;
9084 var expr; 9084 var expr;
9085 var label = null; 9085 var label = null;
9086 if (this._maybeEat(15/*TokenKind.ELLIPSIS*/)) { 9086 if (this._maybeEat(15/*TokenKind.ELLIPSIS*/)) {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
9188 case 109/*TokenKind.THIS*/: 9188 case 109/*TokenKind.THIS*/:
9189 9189
9190 this._eat(109/*TokenKind.THIS*/); 9190 this._eat(109/*TokenKind.THIS*/);
9191 return new ThisExpression(this._makeSpan(start)); 9191 return new ThisExpression(this._makeSpan(start));
9192 9192
9193 case 107/*TokenKind.SUPER*/: 9193 case 107/*TokenKind.SUPER*/:
9194 9194
9195 this._eat(107/*TokenKind.SUPER*/); 9195 this._eat(107/*TokenKind.SUPER*/);
9196 return new SuperExpression(this._makeSpan(start)); 9196 return new SuperExpression(this._makeSpan(start));
9197 9197
9198 case 92/*TokenKind.CONST*/: 9198 case 91/*TokenKind.CONST*/:
9199 9199
9200 this._eat(92/*TokenKind.CONST*/); 9200 this._eat(91/*TokenKind.CONST*/);
9201 if (this._peekKind(4/*TokenKind.LBRACK*/) || this._peekKind(56/*TokenKind. INDEX*/)) { 9201 if (this._peekKind(4/*TokenKind.LBRACK*/) || this._peekKind(56/*TokenKind. INDEX*/)) {
9202 return this.finishListLiteral(start, true, null); 9202 return this.finishListLiteral(start, true, null);
9203 } 9203 }
9204 else if (this._peekKind(6/*TokenKind.LBRACE*/)) { 9204 else if (this._peekKind(6/*TokenKind.LBRACE*/)) {
9205 return this.finishMapLiteral(start, true, null); 9205 return this.finishMapLiteral(start, true, null);
9206 } 9206 }
9207 else if (this._peekKind(52/*TokenKind.LT*/)) { 9207 else if (this._peekKind(52/*TokenKind.LT*/)) {
9208 return this.finishTypedLiteral(start, true); 9208 return this.finishTypedLiteral(start, true);
9209 } 9209 }
9210 else { 9210 else {
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
9421 name = this.identifier().get$name(); 9421 name = this.identifier().get$name();
9422 break; 9422 break;
9423 9423
9424 case 109/*TokenKind.THIS*/: 9424 case 109/*TokenKind.THIS*/:
9425 9425
9426 this._eat(109/*TokenKind.THIS*/); 9426 this._eat(109/*TokenKind.THIS*/);
9427 this._eat(14/*TokenKind.DOT*/); 9427 this._eat(14/*TokenKind.DOT*/);
9428 name = ('this.' + this.identifier().get$name()); 9428 name = ('this.' + this.identifier().get$name());
9429 break; 9429 break;
9430 9430
9431 case 76/*TokenKind.GET*/: 9431 case 74/*TokenKind.GET*/:
9432 9432
9433 if (!includeOperators) return null; 9433 if (!includeOperators) return null;
9434 this._eat(76/*TokenKind.GET*/); 9434 this._eat(74/*TokenKind.GET*/);
9435 if (this._peekIdentifier()) { 9435 if (this._peekIdentifier()) {
9436 name = ('get:' + this.identifier().get$name()); 9436 name = ('get:' + this.identifier().get$name());
9437 } 9437 }
9438 else { 9438 else {
9439 name = 'get'; 9439 name = 'get';
9440 } 9440 }
9441 break; 9441 break;
9442 9442
9443 case 84/*TokenKind.SET*/: 9443 case 82/*TokenKind.SET*/:
9444 9444
9445 if (!includeOperators) return null; 9445 if (!includeOperators) return null;
9446 this._eat(84/*TokenKind.SET*/); 9446 this._eat(82/*TokenKind.SET*/);
9447 if (this._peekIdentifier()) { 9447 if (this._peekIdentifier()) {
9448 name = ('set:' + this.identifier().get$name()); 9448 name = ('set:' + this.identifier().get$name());
9449 } 9449 }
9450 else { 9450 else {
9451 name = 'set'; 9451 name = 'set';
9452 } 9452 }
9453 break; 9453 break;
9454 9454
9455 case 83/*TokenKind.OPERATOR*/: 9455 case 81/*TokenKind.OPERATOR*/:
9456 9456
9457 if (!includeOperators) return null; 9457 if (!includeOperators) return null;
9458 this._eat(83/*TokenKind.OPERATOR*/); 9458 this._eat(81/*TokenKind.OPERATOR*/);
9459 var kind = this._peek(); 9459 var kind = this._peek();
9460 if ($eq(kind, 82/*TokenKind.NEGATE*/)) { 9460 if ($eq(kind, 80/*TokenKind.NEGATE*/)) {
9461 name = ':negate'; 9461 name = ':negate';
9462 this._next(); 9462 this._next();
9463 } 9463 }
9464 else { 9464 else {
9465 name = TokenKind.binaryMethodName(kind); 9465 name = TokenKind.binaryMethodName(kind);
9466 if (name == null) { 9466 if (name == null) {
9467 name = 'operator'; 9467 name = 'operator';
9468 } 9468 }
9469 else { 9469 else {
9470 this._next(); 9470 this._next();
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
9589 return this.finishMapLiteral(start, isConst, genericType); 9589 return this.finishMapLiteral(start, isConst, genericType);
9590 } 9590 }
9591 else { 9591 else {
9592 this._errorExpected('array or map literal'); 9592 this._errorExpected('array or map literal');
9593 } 9593 }
9594 } 9594 }
9595 Parser.prototype._readModifiers = function() { 9595 Parser.prototype._readModifiers = function() {
9596 var modifiers = null; 9596 var modifiers = null;
9597 while (true) { 9597 while (true) {
9598 switch (this._peek()) { 9598 switch (this._peek()) {
9599 case 86/*TokenKind.STATIC*/: 9599 case 84/*TokenKind.STATIC*/:
9600 case 98/*TokenKind.FINAL*/: 9600 case 98/*TokenKind.FINAL*/:
9601 case 92/*TokenKind.CONST*/: 9601 case 91/*TokenKind.CONST*/:
9602 case 71/*TokenKind.ABSTRACT*/: 9602 case 71/*TokenKind.ABSTRACT*/:
9603 case 75/*TokenKind.FACTORY*/: 9603 case 73/*TokenKind.FACTORY*/:
9604 9604
9605 if (modifiers == null) modifiers = []; 9605 if (modifiers == null) modifiers = [];
9606 modifiers.add$1(this._next()); 9606 modifiers.add$1(this._next());
9607 break; 9607 break;
9608 9608
9609 default: 9609 default:
9610 9610
9611 return modifiers; 9611 return modifiers;
9612 9612
9613 } 9613 }
9614 } 9614 }
9615 return null; 9615 return null;
9616 } 9616 }
9617 Parser.prototype.typeParameter = function() { 9617 Parser.prototype.typeParameter = function() {
9618 var start = this._peekToken.start; 9618 var start = this._peekToken.start;
9619 var name = this.identifier(); 9619 var name = this.identifier();
9620 var myType = null; 9620 var myType = null;
9621 if (this._maybeEat(74/*TokenKind.EXTENDS*/)) { 9621 if (this._maybeEat(96/*TokenKind.EXTENDS*/)) {
9622 myType = this.type(1); 9622 myType = this.type(1);
9623 } 9623 }
9624 var tp = new TypeParameter(name, myType, this._makeSpan(start)); 9624 var tp = new TypeParameter(name, myType, this._makeSpan(start));
9625 return new ParameterType(name.get$name(), tp); 9625 return new ParameterType(name.get$name(), tp);
9626 } 9626 }
9627 Parser.prototype.get$typeParameter = function() { 9627 Parser.prototype.get$typeParameter = function() {
9628 return this.typeParameter.bind(this); 9628 return this.typeParameter.bind(this);
9629 } 9629 }
9630 Parser.prototype.typeParameters = function() { 9630 Parser.prototype.typeParameters = function() {
9631 this._eat(52/*TokenKind.LT*/); 9631 this._eat(52/*TokenKind.LT*/);
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after
11702 if (methodName == null) methodName = definition.name.name; 11702 if (methodName == null) methodName = definition.name.name;
11703 var method = new MethodMember(methodName, this, definition); 11703 var method = new MethodMember(methodName, this, definition);
11704 if (method.get$isConstructor()) { 11704 if (method.get$isConstructor()) {
11705 if (this.constructors.containsKey(method.get$constructorName())) { 11705 if (this.constructors.containsKey(method.get$constructorName())) {
11706 $globals.world.error(('duplicate constructor definition of ' + method.get$ name()), definition.span); 11706 $globals.world.error(('duplicate constructor definition of ' + method.get$ name()), definition.span);
11707 return; 11707 return;
11708 } 11708 }
11709 this.constructors.$setindex(method.get$constructorName(), method); 11709 this.constructors.$setindex(method.get$constructorName(), method);
11710 return; 11710 return;
11711 } 11711 }
11712 if (definition.modifiers != null && definition.modifiers.get$length() == 1 && $eq(definition.modifiers.$index(0).get$kind(), 75/*TokenKind.FACTORY*/)) { 11712 if (definition.modifiers != null && definition.modifiers.get$length() == 1 && $eq(definition.modifiers.$index(0).get$kind(), 73/*TokenKind.FACTORY*/)) {
11713 if (this.factories.getFactory(method.get$constructorName(), method.get$name( )) != null) { 11713 if (this.factories.getFactory(method.get$constructorName(), method.get$name( )) != null) {
11714 $globals.world.error(('duplicate factory definition of "' + method.get$nam e() + '"'), definition.span); 11714 $globals.world.error(('duplicate factory definition of "' + method.get$nam e() + '"'), definition.span);
11715 return; 11715 return;
11716 } 11716 }
11717 this.factories.addFactory(method.get$constructorName(), method.get$name(), m ethod); 11717 this.factories.addFactory(method.get$constructorName(), method.get$name(), m ethod);
11718 return; 11718 return;
11719 } 11719 }
11720 if (methodName.startsWith('get:') || methodName.startsWith('set:')) { 11720 if (methodName.startsWith('get:') || methodName.startsWith('set:')) {
11721 var propName = methodName.substring(4); 11721 var propName = methodName.substring(4);
11722 var prop = this.members.$index(propName); 11722 var prop = this.members.$index(propName);
(...skipping 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after
13464 } 13464 }
13465 var const$0 = new EnvMap()/*const EnvMap()*/; 13465 var const$0 = new EnvMap()/*const EnvMap()*/;
13466 var const$127 = new IllegalAccessException()/*const IllegalAccessException()*/; 13466 var const$127 = new IllegalAccessException()/*const IllegalAccessException()*/;
13467 var const$128 = ImmutableList.ImmutableList$from$factory([])/*const []*/; 13467 var const$128 = ImmutableList.ImmutableList$from$factory([])/*const []*/;
13468 var const$2 = new EmptyQueueException()/*const EmptyQueueException()*/; 13468 var const$2 = new EmptyQueueException()/*const EmptyQueueException()*/;
13469 var const$3 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/; 13469 var const$3 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/;
13470 var const$8 = new NoMoreElementsException()/*const NoMoreElementsException()*/; 13470 var const$8 = new NoMoreElementsException()/*const NoMoreElementsException()*/;
13471 var $globals = {}; 13471 var $globals = {};
13472 $static_init(); 13472 $static_init();
13473 main(); 13473 main();
OLDNEW
« no previous file with comments | « no previous file | frog/scripts/token_info.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698