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

Side by Side Diff: frog/frogsh

Issue 8591026: Roll DOM APIs forward on IDL & update Frog DOM (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Switch frog to pull dart/client/dom/frog/frog_dom.dart. Created 9 years, 1 month 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
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) { this($0, $1, true, capture); } 7 * function($0, $1, capture) { 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 2229 matching lines...) Expand 10 before | Expand all | Expand 10 after
2240 } 2240 }
2241 Collections.filter = function(source, destination, f) { 2241 Collections.filter = function(source, destination, f) {
2242 for (var $i = source.iterator(); $i.hasNext$0(); ) { 2242 for (var $i = source.iterator(); $i.hasNext$0(); ) {
2243 var e = $i.next$0(); 2243 var e = $i.next$0();
2244 if (f(e)) destination.add(e); 2244 if (f(e)) destination.add(e);
2245 } 2245 }
2246 return destination; 2246 return destination;
2247 } 2247 }
2248 // ********** Code for DateImplementation ************** 2248 // ********** Code for DateImplementation **************
2249 function DateImplementation() {} 2249 function DateImplementation() {}
2250 DateImplementation.fromEpoch$ctor = function(value, timeZone) {
2251 this.value = value;
2252 this.timeZone = timeZone;
2253 // Initializers done
2254 }
2255 DateImplementation.fromEpoch$ctor.prototype = DateImplementation.prototype;
2250 DateImplementation.now$ctor = function() { 2256 DateImplementation.now$ctor = function() {
2251 this.timeZone = new TimeZoneImplementation.local$ctor(); 2257 this.timeZone = new TimeZoneImplementation.local$ctor();
2252 this.value = DateImplementation._now(); 2258 this.value = DateImplementation._now();
2253 // Initializers done 2259 // Initializers done
2254 this._asJs(); 2260 this._asJs();
2255 } 2261 }
2256 DateImplementation.now$ctor.prototype = DateImplementation.prototype; 2262 DateImplementation.now$ctor.prototype = DateImplementation.prototype;
2257 DateImplementation.fromEpoch$ctor = function(value, timeZone) {
2258 this.value = value;
2259 this.timeZone = timeZone;
2260 // Initializers done
2261 }
2262 DateImplementation.fromEpoch$ctor.prototype = DateImplementation.prototype;
2263 DateImplementation.prototype.is$Date = function(){return this;}; 2263 DateImplementation.prototype.is$Date = function(){return this;};
2264 DateImplementation.prototype.is$Comparable = function(){return this;}; 2264 DateImplementation.prototype.is$Comparable = function(){return this;};
2265 DateImplementation.prototype.get$value = function() { return this.value; }; 2265 DateImplementation.prototype.get$value = function() { return this.value; };
2266 DateImplementation.prototype.$eq = function(other) { 2266 DateImplementation.prototype.$eq = function(other) {
2267 if (!((other instanceof DateImplementation))) return false; 2267 if (!((other instanceof DateImplementation))) return false;
2268 return (this.value == other.get$value()) && ($eq(this.timeZone, other.timeZone )); 2268 return (this.value == other.get$value()) && ($eq(this.timeZone, other.timeZone ));
2269 } 2269 }
2270 DateImplementation.prototype.compareTo = function(other) { 2270 DateImplementation.prototype.compareTo = function(other) {
2271 var $0; 2271 var $0;
2272 return $assert_num(this.value.compareTo$1(other.value)); 2272 return $assert_num(this.value.compareTo$1(other.value));
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
2636 // ********** Code for top level ************** 2636 // ********** Code for top level **************
2637 // ********** Library util ************** 2637 // ********** Library util **************
2638 // ********** Code for top level ************** 2638 // ********** Code for top level **************
2639 // ********** Library scanner_implementation ************** 2639 // ********** Library scanner_implementation **************
2640 // ********** Code for ArrayBasedScanner ************** 2640 // ********** Code for ArrayBasedScanner **************
2641 function ArrayBasedScanner() { 2641 function ArrayBasedScanner() {
2642 this.groupingStack = const$14/*const EmptyLink()*/ 2642 this.groupingStack = const$14/*const EmptyLink()*/
2643 this.extraCharOffset = 0; 2643 this.extraCharOffset = 0;
2644 this.tokenStart = -1; 2644 this.tokenStart = -1;
2645 this.byteOffset = -1; 2645 this.byteOffset = -1;
2646 this.tokens = new scanner_Token(0/*null.EOF_TOKEN*/, -1); 2646 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1);
2647 // Initializers done 2647 // Initializers done
2648 AbstractScanner$S.call(this); 2648 AbstractScanner$S.call(this);
2649 this.tail = this.tokens; 2649 this.tail = this.tokens;
2650 } 2650 }
2651 $inherits(ArrayBasedScanner, AbstractScanner$S); 2651 $inherits(ArrayBasedScanner, AbstractScanner$S);
2652 ArrayBasedScanner.prototype.get$charOffset = function() { 2652 ArrayBasedScanner.prototype.get$charOffset = function() {
2653 return this.byteOffset + this.extraCharOffset; 2653 return this.byteOffset + this.extraCharOffset;
2654 } 2654 }
2655 ArrayBasedScanner.prototype.get$tail = function() { return this.tail; }; 2655 ArrayBasedScanner.prototype.get$tail = function() { return this.tail; };
2656 ArrayBasedScanner.prototype.set$tail = function(value) { return this.tail = valu e; }; 2656 ArrayBasedScanner.prototype.set$tail = function(value) { return this.tail = valu e; };
(...skipping 16 matching lines...) Expand all
2673 } 2673 }
2674 ArrayBasedScanner.prototype.appendStringToken = function(kind, value) { 2674 ArrayBasedScanner.prototype.appendStringToken = function(kind, value) {
2675 this.tail.next = new StringToken(kind, value, this.tokenStart); 2675 this.tail.next = new StringToken(kind, value, this.tokenStart);
2676 this.tail = this.tail.next; 2676 this.tail = this.tail.next;
2677 } 2677 }
2678 ArrayBasedScanner.prototype.appendKeywordToken = function(keyword) { 2678 ArrayBasedScanner.prototype.appendKeywordToken = function(keyword) {
2679 this.tail.next = new KeywordToken(keyword, this.tokenStart); 2679 this.tail.next = new KeywordToken(keyword, this.tokenStart);
2680 this.tail = this.tail.next; 2680 this.tail = this.tail.next;
2681 } 2681 }
2682 ArrayBasedScanner.prototype.appendEofToken = function() { 2682 ArrayBasedScanner.prototype.appendEofToken = function() {
2683 this.tail.next = new scanner_Token(0/*null.EOF_TOKEN*/, this.get$charOffset()) ; 2683 this.tail.next = new Token(0/*null.EOF_TOKEN*/, this.get$charOffset());
2684 this.tail = this.tail.next; 2684 this.tail = this.tail.next;
2685 } 2685 }
2686 ArrayBasedScanner.prototype.beginToken = function() { 2686 ArrayBasedScanner.prototype.beginToken = function() {
2687 this.tokenStart = this.get$charOffset(); 2687 this.tokenStart = this.get$charOffset();
2688 } 2688 }
2689 ArrayBasedScanner.prototype.firstToken = function() { 2689 ArrayBasedScanner.prototype.firstToken = function() {
2690 return this.tokens.next; 2690 return this.tokens.next;
2691 } 2691 }
2692 ArrayBasedScanner.prototype.addToCharOffset = function(offset) { 2692 ArrayBasedScanner.prototype.addToCharOffset = function(offset) {
2693 this.extraCharOffset += offset; 2693 this.extraCharOffset += offset;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
2754 this.groupingStack.get$head().endGroup = oldTail.next; 2754 this.groupingStack.get$head().endGroup = oldTail.next;
2755 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Tok en()); 2755 this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Tok en());
2756 } 2756 }
2757 } 2757 }
2758 // ********** Code for ArrayBasedScanner$SourceString ************** 2758 // ********** Code for ArrayBasedScanner$SourceString **************
2759 function ArrayBasedScanner$SourceString() { 2759 function ArrayBasedScanner$SourceString() {
2760 this.groupingStack = const$14/*const EmptyLink()*/ 2760 this.groupingStack = const$14/*const EmptyLink()*/
2761 this.extraCharOffset = 0; 2761 this.extraCharOffset = 0;
2762 this.tokenStart = -1; 2762 this.tokenStart = -1;
2763 this.byteOffset = -1; 2763 this.byteOffset = -1;
2764 this.tokens = new scanner_Token(0/*null.EOF_TOKEN*/, -1); 2764 this.tokens = new Token(0/*null.EOF_TOKEN*/, -1);
2765 // Initializers done 2765 // Initializers done
2766 AbstractScanner$S.call(this); 2766 AbstractScanner$S.call(this);
2767 this.tail = this.tokens; 2767 this.tail = this.tokens;
2768 } 2768 }
2769 $inherits(ArrayBasedScanner$SourceString, ArrayBasedScanner); 2769 $inherits(ArrayBasedScanner$SourceString, ArrayBasedScanner);
2770 // ********** Code for top level ************** 2770 // ********** Code for top level **************
2771 // ********** Library scanner ************** 2771 // ********** Library scanner **************
2772 // ********** Code for AbstractScanner ************** 2772 // ********** Code for AbstractScanner **************
2773 function AbstractScanner() { 2773 function AbstractScanner() {
2774 // Initializers done 2774 // Initializers done
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
3977 // ********** Code for PartialParser ************** 3977 // ********** Code for PartialParser **************
3978 function PartialParser(listener) { 3978 function PartialParser(listener) {
3979 var $this = this; // closure support 3979 var $this = this; // closure support
3980 this.listener = listener; 3980 this.listener = listener;
3981 // Initializers done 3981 // Initializers done
3982 this.beginTypeArguments = (function (t) { 3982 this.beginTypeArguments = (function (t) {
3983 return $this.listener.beginTypeArguments$1(t); 3983 return $this.listener.beginTypeArguments$1(t);
3984 }) 3984 })
3985 ; 3985 ;
3986 this.parseTypeFunction = (function (t) { 3986 this.parseTypeFunction = (function (t) {
3987 return $this.parseType((t && t.is$scanner_Token())); 3987 return $this.parseType((t && t.is$Token()));
3988 }) 3988 })
3989 ; 3989 ;
3990 this.endTypeArguments = (function (c, bt, et) { 3990 this.endTypeArguments = (function (c, bt, et) {
3991 return $this.listener.endTypeArguments$3(c, bt, et); 3991 return $this.listener.endTypeArguments$3(c, bt, et);
3992 }) 3992 })
3993 ; 3993 ;
3994 this.handleNoTypeArguments = (function (t) { 3994 this.handleNoTypeArguments = (function (t) {
3995 return $this.listener.handleNoTypeArguments$1(t); 3995 return $this.listener.handleNoTypeArguments$1(t);
3996 }) 3996 })
3997 ; 3997 ;
3998 this.beginTypeVariables = (function (t) { 3998 this.beginTypeVariables = (function (t) {
3999 return $this.listener.beginTypeVariables$1(t); 3999 return $this.listener.beginTypeVariables$1(t);
4000 }) 4000 })
4001 ; 4001 ;
4002 this.parseTypeVariableFunction = (function (t) { 4002 this.parseTypeVariableFunction = (function (t) {
4003 return $this.parseTypeVariable((t && t.is$scanner_Token())); 4003 return $this.parseTypeVariable((t && t.is$Token()));
4004 }) 4004 })
4005 ; 4005 ;
4006 this.endTypeVariables = (function (c, bt, et) { 4006 this.endTypeVariables = (function (c, bt, et) {
4007 return $this.listener.endTypeVariables$3(c, bt, et); 4007 return $this.listener.endTypeVariables$3(c, bt, et);
4008 }) 4008 })
4009 ; 4009 ;
4010 this.handleNoTypeVariables = (function (t) { 4010 this.handleNoTypeVariables = (function (t) {
4011 return $this.listener.handleNoTypeVariables$1(t); 4011 return $this.listener.handleNoTypeVariables$1(t);
4012 }) 4012 })
4013 ; 4013 ;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
4197 return this.parseString(this.next(token)); 4197 return this.parseString(this.next(token));
4198 } 4198 }
4199 return token; 4199 return token;
4200 } 4200 }
4201 PartialParser.prototype.parseString = function(token) { 4201 PartialParser.prototype.parseString = function(token) {
4202 var $0; 4202 var $0;
4203 if (token.kind === 39/*null.STRING_TOKEN*/) { 4203 if (token.kind === 39/*null.STRING_TOKEN*/) {
4204 return this.next(token); 4204 return this.next(token);
4205 } 4205 }
4206 else { 4206 else {
4207 return (($0 = this.listener.expected$2('string', token)) && $0.is$scanner_To ken()); 4207 return (($0 = this.listener.expected$2('string', token)) && $0.is$Token());
4208 } 4208 }
4209 } 4209 }
4210 PartialParser.prototype.parseIdentifier = function(token) { 4210 PartialParser.prototype.parseIdentifier = function(token) {
4211 if ($notnull_bool(this.isIdentifier(token))) { 4211 if ($notnull_bool(this.isIdentifier(token))) {
4212 this.listener.handleIdentifier$1(token); 4212 this.listener.handleIdentifier$1(token);
4213 } 4213 }
4214 else { 4214 else {
4215 this.listener.expectedIdentifier$1(token); 4215 this.listener.expectedIdentifier$1(token);
4216 } 4216 }
4217 return this.next(token); 4217 return this.next(token);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
4282 this.listener.handleNoTypeVariables$1(token); 4282 this.listener.handleNoTypeVariables$1(token);
4283 return token; 4283 return token;
4284 } 4284 }
4285 PartialParser.prototype.parseStuff = function(token, beginStuff, stuffParser, en dStuff, handleNoStuff) { 4285 PartialParser.prototype.parseStuff = function(token, beginStuff, stuffParser, en dStuff, handleNoStuff) {
4286 var $0; 4286 var $0;
4287 if ($notnull_bool(this.optional('<', token))) { 4287 if ($notnull_bool(this.optional('<', token))) {
4288 var begin = token; 4288 var begin = token;
4289 beginStuff.call$1(begin); 4289 beginStuff.call$1(begin);
4290 var count = 0; 4290 var count = 0;
4291 do { 4291 do {
4292 token = (($0 = stuffParser.call$1(this.next(token))) && $0.is$scanner_Toke n()); 4292 token = (($0 = stuffParser.call$1(this.next(token))) && $0.is$Token());
4293 ++count; 4293 ++count;
4294 } 4294 }
4295 while ($notnull_bool(this.optional(',', token))) 4295 while ($notnull_bool(this.optional(',', token)))
4296 endStuff.call$3(count, begin, token); 4296 endStuff.call$3(count, begin, token);
4297 return this.expect('>', token); 4297 return this.expect('>', token);
4298 } 4298 }
4299 handleNoStuff.call$1(token); 4299 handleNoStuff.call$1(token);
4300 return token; 4300 return token;
4301 } 4301 }
4302 PartialParser.prototype.parseClassBody = function(token) { 4302 PartialParser.prototype.parseClassBody = function(token) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
4379 PartialParser.prototype.endTypeVariables$3 = function($0, $1, $2) { 4379 PartialParser.prototype.endTypeVariables$3 = function($0, $1, $2) {
4380 return this.endTypeVariables.call$3($0, $1, $2); 4380 return this.endTypeVariables.call$3($0, $1, $2);
4381 }; 4381 };
4382 PartialParser.prototype.handleNoTypeArguments$1 = function($0) { 4382 PartialParser.prototype.handleNoTypeArguments$1 = function($0) {
4383 return this.handleNoTypeArguments.call$1($0); 4383 return this.handleNoTypeArguments.call$1($0);
4384 }; 4384 };
4385 PartialParser.prototype.handleNoTypeVariables$1 = function($0) { 4385 PartialParser.prototype.handleNoTypeVariables$1 = function($0) {
4386 return this.handleNoTypeVariables.call$1($0); 4386 return this.handleNoTypeVariables.call$1($0);
4387 }; 4387 };
4388 PartialParser.prototype.parseClass$1 = function($0) { 4388 PartialParser.prototype.parseClass$1 = function($0) {
4389 return this.parseClass(($0 && $0.is$scanner_Token())); 4389 return this.parseClass(($0 && $0.is$Token()));
4390 }; 4390 };
4391 // ********** Code for scanner_Parser ************** 4391 // ********** Code for Parser **************
4392 function scanner_Parser(listener) { 4392 function Parser(listener) {
4393 // Initializers done 4393 // Initializers done
4394 PartialParser.call(this, listener); 4394 PartialParser.call(this, listener);
4395 } 4395 }
4396 $inherits(scanner_Parser, PartialParser); 4396 $inherits(Parser, PartialParser);
4397 scanner_Parser.prototype.parseFunction = function(token) { 4397 Parser.prototype.parseFunction = function(token) {
4398 this.listener.beginFunction$1(token); 4398 this.listener.beginFunction$1(token);
4399 token = this.parseReturnTypeOpt(token); 4399 token = this.parseReturnTypeOpt(token);
4400 this.listener.beginFunctionName$1(token); 4400 this.listener.beginFunctionName$1(token);
4401 token = this.parseIdentifier(token); 4401 token = this.parseIdentifier(token);
4402 this.listener.endFunctionName$1(token); 4402 this.listener.endFunctionName$1(token);
4403 token = this.parseFormalParameters(token); 4403 token = this.parseFormalParameters(token);
4404 return this.parseFunctionBody(token); 4404 return this.parseFunctionBody(token);
4405 } 4405 }
4406 scanner_Parser.prototype.parseFunctionBody = function(token) { 4406 Parser.prototype.parseFunctionBody = function(token) {
4407 if ($notnull_bool(this.optional(';', token))) { 4407 if ($notnull_bool(this.optional(';', token))) {
4408 this.listener.endFunctionBody$3(0, null, token); 4408 this.listener.endFunctionBody$3(0, null, token);
4409 return token.next; 4409 return token.next;
4410 } 4410 }
4411 var begin = token; 4411 var begin = token;
4412 var statementCount = 0; 4412 var statementCount = 0;
4413 this.listener.beginFunctionBody$1(begin); 4413 this.listener.beginFunctionBody$1(begin);
4414 token = this.checkEof(this.expect('{', token)); 4414 token = this.checkEof(this.expect('{', token));
4415 while (!$notnull_bool(this.optional('}', token))) { 4415 while (!$notnull_bool(this.optional('}', token))) {
4416 token = this.parseStatement(token); 4416 token = this.parseStatement(token);
4417 ++statementCount; 4417 ++statementCount;
4418 } 4418 }
4419 this.listener.endFunctionBody$3(statementCount, begin, token); 4419 this.listener.endFunctionBody$3(statementCount, begin, token);
4420 return this.expect('}', token); 4420 return this.expect('}', token);
4421 } 4421 }
4422 scanner_Parser.prototype.parseStatement = function(token) { 4422 Parser.prototype.parseStatement = function(token) {
4423 this.checkEof(token); 4423 this.checkEof(token);
4424 var value = token.get$stringValue(); 4424 var value = token.get$stringValue();
4425 switch (true) { 4425 switch (true) {
4426 case token.kind === 97/*null.IDENTIFIER_TOKEN*/: 4426 case token.kind === 97/*null.IDENTIFIER_TOKEN*/:
4427 4427
4428 return this.parseExpressionStatementOrDeclaration(token); 4428 return this.parseExpressionStatementOrDeclaration(token);
4429 4429
4430 case value === '{': 4430 case value === '{':
4431 4431
4432 return this.parseBlock(token); 4432 return this.parseBlock(token);
(...skipping 17 matching lines...) Expand all
4450 case value === 'throw': 4450 case value === 'throw':
4451 4451
4452 return this.parseThrowStatement(token); 4452 return this.parseThrowStatement(token);
4453 4453
4454 default: 4454 default:
4455 4455
4456 return this.parseExpressionStatement(token); 4456 return this.parseExpressionStatement(token);
4457 4457
4458 } 4458 }
4459 } 4459 }
4460 scanner_Parser.prototype.expectSemicolon = function(token) { 4460 Parser.prototype.expectSemicolon = function(token) {
4461 return this.expect(';', token); 4461 return this.expect(';', token);
4462 } 4462 }
4463 scanner_Parser.prototype.parseReturnStatement = function(token) { 4463 Parser.prototype.parseReturnStatement = function(token) {
4464 var begin = token; 4464 var begin = token;
4465 this.listener.beginReturnStatement$1(begin); 4465 this.listener.beginReturnStatement$1(begin);
4466 $assert('return' === token.get$stringValue(), "'return' === token.stringValue" , "parser.dart", 455, 12); 4466 $assert('return' === token.get$stringValue(), "'return' === token.stringValue" , "parser.dart", 455, 12);
4467 token = this.next(token); 4467 token = this.next(token);
4468 if ($notnull_bool(this.optional(';', token))) { 4468 if ($notnull_bool(this.optional(';', token))) {
4469 this.listener.endReturnStatement$3(false, begin, token); 4469 this.listener.endReturnStatement$3(false, begin, token);
4470 } 4470 }
4471 else { 4471 else {
4472 token = this.parseExpression(token); 4472 token = this.parseExpression(token);
4473 this.listener.endReturnStatement$3(true, begin, token); 4473 this.listener.endReturnStatement$3(true, begin, token);
4474 } 4474 }
4475 return this.expectSemicolon(token); 4475 return this.expectSemicolon(token);
4476 } 4476 }
4477 scanner_Parser.prototype.peekAfterType = function(token) { 4477 Parser.prototype.peekAfterType = function(token) {
4478 $assert(token.kind === 97/*null.IDENTIFIER_TOKEN*/, "token.kind === IDENTIFIER _TOKEN", "parser.dart", 468, 12); 4478 $assert(token.kind === 97/*null.IDENTIFIER_TOKEN*/, "token.kind === IDENTIFIER _TOKEN", "parser.dart", 468, 12);
4479 var peek = token.next; 4479 var peek = token.next;
4480 if (peek.kind === 46/*null.PERIOD_TOKEN*/) { 4480 if (peek.kind === 46/*null.PERIOD_TOKEN*/) {
4481 if (peek.next.kind === 97/*null.IDENTIFIER_TOKEN*/) { 4481 if (peek.next.kind === 97/*null.IDENTIFIER_TOKEN*/) {
4482 peek = peek.next.next; 4482 peek = peek.next.next;
4483 } 4483 }
4484 } 4484 }
4485 if (peek.kind === 60/*null.LT_TOKEN*/) { 4485 if (peek.kind === 60/*null.LT_TOKEN*/) {
4486 var beginGroupToken = (peek && peek.is$BeginGroupToken()); 4486 var beginGroupToken = (peek && peek.is$BeginGroupToken());
4487 var gtToken = beginGroupToken.endGroup; 4487 var gtToken = beginGroupToken.endGroup;
4488 if (gtToken != null) { 4488 if (gtToken != null) {
4489 return gtToken.next; 4489 return gtToken.next;
4490 } 4490 }
4491 } 4491 }
4492 return peek; 4492 return peek;
4493 } 4493 }
4494 scanner_Parser.prototype.peekIdentifierAfterType = function(token) { 4494 Parser.prototype.peekIdentifierAfterType = function(token) {
4495 var peek = this.peekAfterType(token); 4495 var peek = this.peekAfterType(token);
4496 if (peek != null && peek.kind === 97/*null.IDENTIFIER_TOKEN*/) { 4496 if (peek != null && peek.kind === 97/*null.IDENTIFIER_TOKEN*/) {
4497 return peek; 4497 return peek;
4498 } 4498 }
4499 else { 4499 else {
4500 return null; 4500 return null;
4501 } 4501 }
4502 } 4502 }
4503 scanner_Parser.prototype.parseExpressionStatementOrDeclaration = function(token) { 4503 Parser.prototype.parseExpressionStatementOrDeclaration = function(token) {
4504 var identifier = this.peekIdentifierAfterType(token); 4504 var identifier = this.peekIdentifierAfterType(token);
4505 if (identifier != null) { 4505 if (identifier != null) {
4506 $assert(identifier.kind === 97/*null.IDENTIFIER_TOKEN*/, "identifier.kind == = IDENTIFIER_TOKEN", "parser.dart", 504, 14); 4506 $assert(identifier.kind === 97/*null.IDENTIFIER_TOKEN*/, "identifier.kind == = IDENTIFIER_TOKEN", "parser.dart", 504, 14);
4507 var afterId = identifier.next; 4507 var afterId = identifier.next;
4508 var afterIdKind = afterId.kind; 4508 var afterIdKind = afterId.kind;
4509 if (afterIdKind === 61/*null.EQ_TOKEN*/ || afterIdKind === 59/*null.SEMICOLO N_TOKEN*/) { 4509 if (afterIdKind === 61/*null.EQ_TOKEN*/ || afterIdKind === 59/*null.SEMICOLO N_TOKEN*/) {
4510 return this.parseVariablesDeclaration(token); 4510 return this.parseVariablesDeclaration(token);
4511 } 4511 }
4512 else if (afterIdKind === 41/*null.RPAREN_TOKEN*/) { 4512 else if (afterIdKind === 41/*null.RPAREN_TOKEN*/) {
4513 var beginParen = (afterId && afterId.is$BeginGroupToken()); 4513 var beginParen = (afterId && afterId.is$BeginGroupToken());
4514 var endParen = beginParen.endGroup; 4514 var endParen = beginParen.endGroup;
4515 var afterParens = endParen.next; 4515 var afterParens = endParen.next;
4516 if ($notnull_bool(this.optional('{', afterParens)) || $notnull_bool(this.o ptional('=>', afterParens))) { 4516 if ($notnull_bool(this.optional('{', afterParens)) || $notnull_bool(this.o ptional('=>', afterParens))) {
4517 return this.parseFunction(token); 4517 return this.parseFunction(token);
4518 } 4518 }
4519 } 4519 }
4520 } 4520 }
4521 return this.parseExpressionStatement(token); 4521 return this.parseExpressionStatement(token);
4522 } 4522 }
4523 scanner_Parser.prototype.parseExpressionStatement = function(token) { 4523 Parser.prototype.parseExpressionStatement = function(token) {
4524 this.listener.beginExpressionStatement$1(token); 4524 this.listener.beginExpressionStatement$1(token);
4525 token = this.parseExpression(token); 4525 token = this.parseExpression(token);
4526 this.listener.endExpressionStatement$1(token); 4526 this.listener.endExpressionStatement$1(token);
4527 return this.expectSemicolon(token); 4527 return this.expectSemicolon(token);
4528 } 4528 }
4529 scanner_Parser.prototype.parseExpression = function(token) { 4529 Parser.prototype.parseExpression = function(token) {
4530 token = this.parseConditionalExpression(token); 4530 token = this.parseConditionalExpression(token);
4531 if ($notnull_bool(this.isAssignmentOperator(token))) { 4531 if ($notnull_bool(this.isAssignmentOperator(token))) {
4532 var operator = token; 4532 var operator = token;
4533 token = this.parseExpression(this.next(token)); 4533 token = this.parseExpression(this.next(token));
4534 this.listener.handleAssignmentExpression$1(operator); 4534 this.listener.handleAssignmentExpression$1(operator);
4535 } 4535 }
4536 return token; 4536 return token;
4537 } 4537 }
4538 scanner_Parser.prototype.isAssignmentOperator = function(token) { 4538 Parser.prototype.isAssignmentOperator = function(token) {
4539 return 2 === this.getPrecedence(token); 4539 return 2 === this.getPrecedence(token);
4540 } 4540 }
4541 scanner_Parser.prototype.parseConditionalExpression = function(token) { 4541 Parser.prototype.parseConditionalExpression = function(token) {
4542 token = this.parseBinaryExpression(token, 4); 4542 token = this.parseBinaryExpression(token, 4);
4543 if ($notnull_bool(this.optional('?', token))) { 4543 if ($notnull_bool(this.optional('?', token))) {
4544 var question = token; 4544 var question = token;
4545 token = this.parseExpression(this.next(token)); 4545 token = this.parseExpression(this.next(token));
4546 var colon = token; 4546 var colon = token;
4547 token = this.expect(':', token); 4547 token = this.expect(':', token);
4548 token = this.parseExpression(token); 4548 token = this.parseExpression(token);
4549 this.listener.handleConditionalExpression$2(question, colon); 4549 this.listener.handleConditionalExpression$2(question, colon);
4550 } 4550 }
4551 return token; 4551 return token;
4552 } 4552 }
4553 scanner_Parser.prototype.parseBinaryExpression = function(token, precedence) { 4553 Parser.prototype.parseBinaryExpression = function(token, precedence) {
4554 $assert(precedence >= 4, "precedence >= 4", "parser.dart", 561, 12); 4554 $assert(precedence >= 4, "precedence >= 4", "parser.dart", 561, 12);
4555 token = this.parseUnaryExpression(token); 4555 token = this.parseUnaryExpression(token);
4556 var tokenLevel = this.getPrecedence(token); 4556 var tokenLevel = this.getPrecedence(token);
4557 for (var level = $assert_num(tokenLevel); 4557 for (var level = $assert_num(tokenLevel);
4558 level >= precedence; --level) { 4558 level >= precedence; --level) {
4559 while (tokenLevel === level) { 4559 while (tokenLevel === level) {
4560 var operator = token; 4560 var operator = token;
4561 token = this.parseBinaryExpression(this.next(token), level + 1); 4561 token = this.parseBinaryExpression(this.next(token), level + 1);
4562 this.listener.handleBinaryExpression$1(operator); 4562 this.listener.handleBinaryExpression$1(operator);
4563 tokenLevel = this.getPrecedence(token); 4563 tokenLevel = this.getPrecedence(token);
4564 } 4564 }
4565 } 4565 }
4566 return token; 4566 return token;
4567 } 4567 }
4568 scanner_Parser.prototype.getPrecedence = function(token) { 4568 Parser.prototype.getPrecedence = function(token) {
4569 if (token == null) return 0; 4569 if (token == null) return 0;
4570 var value = token.get$stringValue(); 4570 var value = token.get$stringValue();
4571 if (value == null) return 0; 4571 if (value == null) return 0;
4572 switch (true) { 4572 switch (true) {
4573 case value === '(': 4573 case value === '(':
4574 4574
4575 return 0; 4575 return 0;
4576 4576
4577 case value === '+': 4577 case value === '+':
4578 4578
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
4729 case value === '~/': 4729 case value === '~/':
4730 4730
4731 return 13; 4731 return 13;
4732 4732
4733 default: 4733 default:
4734 4734
4735 return 0; 4735 return 0;
4736 4736
4737 } 4737 }
4738 } 4738 }
4739 scanner_Parser.prototype.parseUnaryExpression = function(token) { 4739 Parser.prototype.parseUnaryExpression = function(token) {
4740 var value = token.get$stringValue(); 4740 var value = token.get$stringValue();
4741 switch (true) { 4741 switch (true) {
4742 case value === '!': 4742 case value === '!':
4743 case value === '+': 4743 case value === '+':
4744 case value === '-': 4744 case value === '-':
4745 case value === '++': 4745 case value === '++':
4746 case value === '--': 4746 case value === '--':
4747 case value === '~': 4747 case value === '~':
4748 4748
4749 { 4749 {
(...skipping 15 matching lines...) Expand all
4765 this.listener.handleUnaryPostfixExpression$1(token); 4765 this.listener.handleUnaryPostfixExpression$1(token);
4766 token = this.next(token); 4766 token = this.next(token);
4767 break; 4767 break;
4768 4768
4769 } 4769 }
4770 break; 4770 break;
4771 4771
4772 } 4772 }
4773 return token; 4773 return token;
4774 } 4774 }
4775 scanner_Parser.prototype.parsePrimary = function(token) { 4775 Parser.prototype.parsePrimary = function(token) {
4776 var kind = token.kind; 4776 var kind = token.kind;
4777 switch (true) { 4777 switch (true) {
4778 case kind === 97/*null.IDENTIFIER_TOKEN*/: 4778 case kind === 97/*null.IDENTIFIER_TOKEN*/:
4779 4779
4780 return this.parseSend(token); 4780 return this.parseSend(token);
4781 4781
4782 case kind === 105/*null.INT_TOKEN*/: 4782 case kind === 105/*null.INT_TOKEN*/:
4783 4783
4784 return this.parseLiteralInt(token); 4784 return this.parseLiteralInt(token);
4785 4785
(...skipping 24 matching lines...) Expand all
4810 } 4810 }
4811 $throw(new FallThroughError()); 4811 $throw(new FallThroughError());
4812 4812
4813 default: 4813 default:
4814 4814
4815 this.listener.unexpected$1(token); 4815 this.listener.unexpected$1(token);
4816 $throw('not yet implemented'); 4816 $throw('not yet implemented');
4817 4817
4818 } 4818 }
4819 } 4819 }
4820 scanner_Parser.prototype.parseLiteralInt = function(token) { 4820 Parser.prototype.parseLiteralInt = function(token) {
4821 this.listener.handleLiteralInt$1(token); 4821 this.listener.handleLiteralInt$1(token);
4822 return token.next; 4822 return token.next;
4823 } 4823 }
4824 scanner_Parser.prototype.parseLiteralDouble = function(token) { 4824 Parser.prototype.parseLiteralDouble = function(token) {
4825 this.listener.handleLiteralDouble$1(token); 4825 this.listener.handleLiteralDouble$1(token);
4826 return token.next; 4826 return token.next;
4827 } 4827 }
4828 scanner_Parser.prototype.parseLiteralString = function(token) { 4828 Parser.prototype.parseLiteralString = function(token) {
4829 this.listener.handleLiteralString$1(token); 4829 this.listener.handleLiteralString$1(token);
4830 return token.next; 4830 return token.next;
4831 } 4831 }
4832 scanner_Parser.prototype.parseLiteralBool = function(token) { 4832 Parser.prototype.parseLiteralBool = function(token) {
4833 this.listener.handleLiteralBool$1(token); 4833 this.listener.handleLiteralBool$1(token);
4834 return token.next; 4834 return token.next;
4835 } 4835 }
4836 scanner_Parser.prototype.parseSend = function(token) { 4836 Parser.prototype.parseSend = function(token) {
4837 this.listener.beginSend$1(token); 4837 this.listener.beginSend$1(token);
4838 token = this.parseIdentifier(token); 4838 token = this.parseIdentifier(token);
4839 token = this.parseArgumentsOpt(token); 4839 token = this.parseArgumentsOpt(token);
4840 this.listener.endSend$1(token); 4840 this.listener.endSend$1(token);
4841 return token; 4841 return token;
4842 } 4842 }
4843 scanner_Parser.prototype.parseArgumentsOpt = function(token) { 4843 Parser.prototype.parseArgumentsOpt = function(token) {
4844 if (!$notnull_bool(this.optional('(', token))) { 4844 if (!$notnull_bool(this.optional('(', token))) {
4845 this.listener.handleNoArguments$1(token); 4845 this.listener.handleNoArguments$1(token);
4846 return token; 4846 return token;
4847 } 4847 }
4848 else { 4848 else {
4849 return this.parseArguments(token); 4849 return this.parseArguments(token);
4850 } 4850 }
4851 } 4851 }
4852 scanner_Parser.prototype.parseArguments = function(token) { 4852 Parser.prototype.parseArguments = function(token) {
4853 var begin = token; 4853 var begin = token;
4854 this.listener.beginArguments$1(begin); 4854 this.listener.beginArguments$1(begin);
4855 $assert('(' === token.get$stringValue(), "'(' === token.stringValue", "parser. dart", 726, 12); 4855 $assert('(' === token.get$stringValue(), "'(' === token.stringValue", "parser. dart", 726, 12);
4856 var argumentCount = 0; 4856 var argumentCount = 0;
4857 if ($notnull_bool(this.optional(')', token.next))) { 4857 if ($notnull_bool(this.optional(')', token.next))) {
4858 this.listener.endArguments$3(argumentCount, begin, token.next); 4858 this.listener.endArguments$3(argumentCount, begin, token.next);
4859 return token.next.next; 4859 return token.next.next;
4860 } 4860 }
4861 do { 4861 do {
4862 token = this.parseExpression(this.next(token)); 4862 token = this.parseExpression(this.next(token));
4863 ++argumentCount; 4863 ++argumentCount;
4864 } 4864 }
4865 while ($notnull_bool(this.optional(',', token))) 4865 while ($notnull_bool(this.optional(',', token)))
4866 this.listener.endArguments$3(argumentCount, begin, token); 4866 this.listener.endArguments$3(argumentCount, begin, token);
4867 return this.expect(')', token); 4867 return this.expect(')', token);
4868 } 4868 }
4869 scanner_Parser.prototype.parseVariablesDeclaration = function(token) { 4869 Parser.prototype.parseVariablesDeclaration = function(token) {
4870 var count = 1; 4870 var count = 1;
4871 this.listener.beginVariablesDeclaration$1(token); 4871 this.listener.beginVariablesDeclaration$1(token);
4872 token = this.parseFinalVarOrType(token); 4872 token = this.parseFinalVarOrType(token);
4873 token = this.parseOptionallyInitializedIdentifier(token); 4873 token = this.parseOptionallyInitializedIdentifier(token);
4874 while ($notnull_bool(this.optional(',', token))) { 4874 while ($notnull_bool(this.optional(',', token))) {
4875 token = this.parseOptionallyInitializedIdentifier(this.next(token)); 4875 token = this.parseOptionallyInitializedIdentifier(this.next(token));
4876 ++count; 4876 ++count;
4877 } 4877 }
4878 this.listener.endVariablesDeclaration$2(count, token); 4878 this.listener.endVariablesDeclaration$2(count, token);
4879 return this.expectSemicolon(token); 4879 return this.expectSemicolon(token);
4880 } 4880 }
4881 scanner_Parser.prototype.parseOptionallyInitializedIdentifier = function(token) { 4881 Parser.prototype.parseOptionallyInitializedIdentifier = function(token) {
4882 this.listener.beginInitializedIdentifier$1(token); 4882 this.listener.beginInitializedIdentifier$1(token);
4883 token = this.parseIdentifier(token); 4883 token = this.parseIdentifier(token);
4884 if ($notnull_bool(this.optional('=', token))) { 4884 if ($notnull_bool(this.optional('=', token))) {
4885 var assignment = token; 4885 var assignment = token;
4886 this.listener.beginInitializer$1(token); 4886 this.listener.beginInitializer$1(token);
4887 token = this.parseExpression(this.next(token)); 4887 token = this.parseExpression(this.next(token));
4888 this.listener.endInitializer$1(assignment); 4888 this.listener.endInitializer$1(assignment);
4889 } 4889 }
4890 this.listener.endInitializedIdentifier$0(); 4890 this.listener.endInitializedIdentifier$0();
4891 return token; 4891 return token;
4892 } 4892 }
4893 scanner_Parser.prototype.parseFinalVarOrType = function(token) { 4893 Parser.prototype.parseFinalVarOrType = function(token) {
4894 var value = token.get$stringValue(); 4894 var value = token.get$stringValue();
4895 switch (true) { 4895 switch (true) {
4896 case 'final' === value: 4896 case 'final' === value:
4897 4897
4898 this.listener.handleFinalKeyword$1(token); 4898 this.listener.handleFinalKeyword$1(token);
4899 return this.next(token); 4899 return this.next(token);
4900 4900
4901 default: 4901 default:
4902 4902
4903 return this.parseType(token); 4903 return this.parseType(token);
4904 4904
4905 } 4905 }
4906 } 4906 }
4907 scanner_Parser.prototype.parseIfStatement = function(token) { 4907 Parser.prototype.parseIfStatement = function(token) {
4908 var ifToken = token; 4908 var ifToken = token;
4909 this.listener.beginIfStatement$1(ifToken); 4909 this.listener.beginIfStatement$1(ifToken);
4910 token = this.expect('if', token); 4910 token = this.expect('if', token);
4911 this.expect('(', token); 4911 this.expect('(', token);
4912 token = this.parseArguments(token); 4912 token = this.parseArguments(token);
4913 token = this.parseStatement(token); 4913 token = this.parseStatement(token);
4914 var elseToken = null; 4914 var elseToken = null;
4915 if ($notnull_bool(this.optional('else', token))) { 4915 if ($notnull_bool(this.optional('else', token))) {
4916 elseToken = token; 4916 elseToken = token;
4917 token = this.parseStatement(token.next); 4917 token = this.parseStatement(token.next);
4918 } 4918 }
4919 this.listener.endIfStatement$2(ifToken, elseToken); 4919 this.listener.endIfStatement$2(ifToken, elseToken);
4920 return token; 4920 return token;
4921 } 4921 }
4922 scanner_Parser.prototype.parseForStatement = function(token) { 4922 Parser.prototype.parseForStatement = function(token) {
4923 var forToken = token; 4923 var forToken = token;
4924 this.listener.beginForStatement$1(forToken); 4924 this.listener.beginForStatement$1(forToken);
4925 token = this.expect('for', token); 4925 token = this.expect('for', token);
4926 token = this.expect('(', token); 4926 token = this.expect('(', token);
4927 token = this.parseVariablesDeclaration(token); 4927 token = this.parseVariablesDeclaration(token);
4928 token = this.parseExpressionStatement(token); 4928 token = this.parseExpressionStatement(token);
4929 token = this.parseExpression(token); 4929 token = this.parseExpression(token);
4930 token = this.expect(')', token); 4930 token = this.expect(')', token);
4931 token = this.parseStatement(token); 4931 token = this.parseStatement(token);
4932 this.listener.endForStatement$2(forToken, token); 4932 this.listener.endForStatement$2(forToken, token);
4933 return token; 4933 return token;
4934 } 4934 }
4935 scanner_Parser.prototype.parseBlock = function(token) { 4935 Parser.prototype.parseBlock = function(token) {
4936 var begin = token; 4936 var begin = token;
4937 this.listener.beginBlock$1(begin); 4937 this.listener.beginBlock$1(begin);
4938 var statementCount = 0; 4938 var statementCount = 0;
4939 token = this.expect('{', token); 4939 token = this.expect('{', token);
4940 while (!$notnull_bool(this.optional('}', token))) { 4940 while (!$notnull_bool(this.optional('}', token))) {
4941 token = this.parseStatement(token); 4941 token = this.parseStatement(token);
4942 ++statementCount; 4942 ++statementCount;
4943 } 4943 }
4944 this.listener.endBlock$3(statementCount, begin, token); 4944 this.listener.endBlock$3(statementCount, begin, token);
4945 return this.expect('}', token); 4945 return this.expect('}', token);
4946 } 4946 }
4947 scanner_Parser.prototype.parseThrowStatement = function(token) { 4947 Parser.prototype.parseThrowStatement = function(token) {
4948 var throwToken = token; 4948 var throwToken = token;
4949 this.listener.beginThrowStatement$1(throwToken); 4949 this.listener.beginThrowStatement$1(throwToken);
4950 token = this.expect('throw', token); 4950 token = this.expect('throw', token);
4951 if ($notnull_bool(this.optional(';', token))) { 4951 if ($notnull_bool(this.optional(';', token))) {
4952 this.listener.endRethrowStatement$2(throwToken, token); 4952 this.listener.endRethrowStatement$2(throwToken, token);
4953 return token.next; 4953 return token.next;
4954 } 4954 }
4955 else { 4955 else {
4956 token = this.parseExpression(token); 4956 token = this.parseExpression(token);
4957 this.listener.endThrowStatement$2(throwToken, token); 4957 this.listener.endThrowStatement$2(throwToken, token);
4958 return this.expectSemicolon(token); 4958 return this.expectSemicolon(token);
4959 } 4959 }
4960 } 4960 }
4961 scanner_Parser.prototype.parseFunction$1 = function($0) { 4961 Parser.prototype.parseFunction$1 = function($0) {
4962 return this.parseFunction(($0 && $0.is$scanner_Token())); 4962 return this.parseFunction(($0 && $0.is$Token()));
4963 }; 4963 };
4964 // ********** Code for ParserTask ************** 4964 // ********** Code for ParserTask **************
4965 function ParserTask(compiler) { 4965 function ParserTask(compiler) {
4966 // Initializers done 4966 // Initializers done
4967 CompilerTask.call(this, compiler); 4967 CompilerTask.call(this, compiler);
4968 } 4968 }
4969 $inherits(ParserTask, CompilerTask); 4969 $inherits(ParserTask, CompilerTask);
4970 ParserTask.prototype.get$name = function() { 4970 ParserTask.prototype.get$name = function() {
4971 return 'Parser'; 4971 return 'Parser';
4972 } 4972 }
4973 ParserTask.prototype.parse = function(element) { 4973 ParserTask.prototype.parse = function(element) {
4974 var $this = this; // closure support 4974 var $this = this; // closure support
4975 var $0; 4975 var $0;
4976 return (($0 = this.measure((function () { 4976 return (($0 = this.measure((function () {
4977 return element.parseNode($this.compiler, $this.compiler); 4977 return element.parseNode($this.compiler, $this.compiler);
4978 }) 4978 })
4979 )) && $0.is$tree_Node()); 4979 )) && $0.is$Node());
4980 } 4980 }
4981 // ********** Code for Listener ************** 4981 // ********** Code for Listener **************
4982 function Listener() { 4982 function Listener() {
4983 // Initializers done 4983 // Initializers done
4984 } 4984 }
4985 Listener.prototype.beginArguments = function(token) { 4985 Listener.prototype.beginArguments = function(token) {
4986 4986
4987 } 4987 }
4988 Listener.prototype.endArguments = function(count, beginToken, endToken) { 4988 Listener.prototype.endArguments = function(count, beginToken, endToken) {
4989 4989
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
5189 Listener.prototype.expectedType = function(token) { 5189 Listener.prototype.expectedType = function(token) {
5190 $throw(new ParserError(("Expected a type, but got '" + token + "' @ ") + ("" + token.charOffset + ""))); 5190 $throw(new ParserError(("Expected a type, but got '" + token + "' @ ") + ("" + token.charOffset + "")));
5191 } 5191 }
5192 Listener.prototype.expectedBlock = function(token) { 5192 Listener.prototype.expectedBlock = function(token) {
5193 $throw(new ParserError(("Expected a block, but got '" + token + "' @ ") + ("" + token.charOffset + ""))); 5193 $throw(new ParserError(("Expected a block, but got '" + token + "' @ ") + ("" + token.charOffset + "")));
5194 } 5194 }
5195 Listener.prototype.unexpected = function(token) { 5195 Listener.prototype.unexpected = function(token) {
5196 $throw(new ParserError(("Unexpected token '" + token + "' @ " + token.charOffs et + ""))); 5196 $throw(new ParserError(("Unexpected token '" + token + "' @ " + token.charOffs et + "")));
5197 } 5197 }
5198 Listener.prototype.beginArguments$1 = function($0) { 5198 Listener.prototype.beginArguments$1 = function($0) {
5199 return this.beginArguments(($0 && $0.is$scanner_Token())); 5199 return this.beginArguments(($0 && $0.is$Token()));
5200 }; 5200 };
5201 Listener.prototype.beginBlock$1 = function($0) { 5201 Listener.prototype.beginBlock$1 = function($0) {
5202 return this.beginBlock(($0 && $0.is$scanner_Token())); 5202 return this.beginBlock(($0 && $0.is$Token()));
5203 }; 5203 };
5204 Listener.prototype.beginClass$1 = function($0) { 5204 Listener.prototype.beginClass$1 = function($0) {
5205 return this.beginClass(($0 && $0.is$scanner_Token())); 5205 return this.beginClass(($0 && $0.is$Token()));
5206 }; 5206 };
5207 Listener.prototype.beginExpressionStatement$1 = function($0) { 5207 Listener.prototype.beginExpressionStatement$1 = function($0) {
5208 return this.beginExpressionStatement(($0 && $0.is$scanner_Token())); 5208 return this.beginExpressionStatement(($0 && $0.is$Token()));
5209 }; 5209 };
5210 Listener.prototype.beginForStatement$1 = function($0) { 5210 Listener.prototype.beginForStatement$1 = function($0) {
5211 return this.beginForStatement(($0 && $0.is$scanner_Token())); 5211 return this.beginForStatement(($0 && $0.is$Token()));
5212 }; 5212 };
5213 Listener.prototype.beginFormalParameter$1 = function($0) { 5213 Listener.prototype.beginFormalParameter$1 = function($0) {
5214 return this.beginFormalParameter(($0 && $0.is$scanner_Token())); 5214 return this.beginFormalParameter(($0 && $0.is$Token()));
5215 }; 5215 };
5216 Listener.prototype.beginFormalParameters$1 = function($0) { 5216 Listener.prototype.beginFormalParameters$1 = function($0) {
5217 return this.beginFormalParameters(($0 && $0.is$scanner_Token())); 5217 return this.beginFormalParameters(($0 && $0.is$Token()));
5218 }; 5218 };
5219 Listener.prototype.beginFunction$1 = function($0) { 5219 Listener.prototype.beginFunction$1 = function($0) {
5220 return this.beginFunction(($0 && $0.is$scanner_Token())); 5220 return this.beginFunction(($0 && $0.is$Token()));
5221 }; 5221 };
5222 Listener.prototype.beginFunctionBody$1 = function($0) { 5222 Listener.prototype.beginFunctionBody$1 = function($0) {
5223 return this.beginFunctionBody(($0 && $0.is$scanner_Token())); 5223 return this.beginFunctionBody(($0 && $0.is$Token()));
5224 }; 5224 };
5225 Listener.prototype.beginFunctionName$1 = function($0) { 5225 Listener.prototype.beginFunctionName$1 = function($0) {
5226 return this.beginFunctionName(($0 && $0.is$scanner_Token())); 5226 return this.beginFunctionName(($0 && $0.is$Token()));
5227 }; 5227 };
5228 Listener.prototype.beginFunctionTypeAlias$1 = function($0) { 5228 Listener.prototype.beginFunctionTypeAlias$1 = function($0) {
5229 return this.beginFunctionTypeAlias(($0 && $0.is$scanner_Token())); 5229 return this.beginFunctionTypeAlias(($0 && $0.is$Token()));
5230 }; 5230 };
5231 Listener.prototype.beginIfStatement$1 = function($0) { 5231 Listener.prototype.beginIfStatement$1 = function($0) {
5232 return this.beginIfStatement(($0 && $0.is$scanner_Token())); 5232 return this.beginIfStatement(($0 && $0.is$Token()));
5233 }; 5233 };
5234 Listener.prototype.beginInitializedIdentifier$1 = function($0) { 5234 Listener.prototype.beginInitializedIdentifier$1 = function($0) {
5235 return this.beginInitializedIdentifier(($0 && $0.is$scanner_Token())); 5235 return this.beginInitializedIdentifier(($0 && $0.is$Token()));
5236 }; 5236 };
5237 Listener.prototype.beginInitializer$1 = function($0) { 5237 Listener.prototype.beginInitializer$1 = function($0) {
5238 return this.beginInitializer(($0 && $0.is$scanner_Token())); 5238 return this.beginInitializer(($0 && $0.is$Token()));
5239 }; 5239 };
5240 Listener.prototype.beginInterface$1 = function($0) { 5240 Listener.prototype.beginInterface$1 = function($0) {
5241 return this.beginInterface(($0 && $0.is$scanner_Token())); 5241 return this.beginInterface(($0 && $0.is$Token()));
5242 }; 5242 };
5243 Listener.prototype.beginLibraryTag$1 = function($0) { 5243 Listener.prototype.beginLibraryTag$1 = function($0) {
5244 return this.beginLibraryTag(($0 && $0.is$scanner_Token())); 5244 return this.beginLibraryTag(($0 && $0.is$Token()));
5245 }; 5245 };
5246 Listener.prototype.beginReturnStatement$1 = function($0) { 5246 Listener.prototype.beginReturnStatement$1 = function($0) {
5247 return this.beginReturnStatement(($0 && $0.is$scanner_Token())); 5247 return this.beginReturnStatement(($0 && $0.is$Token()));
5248 }; 5248 };
5249 Listener.prototype.beginSend$1 = function($0) { 5249 Listener.prototype.beginSend$1 = function($0) {
5250 return this.beginSend(($0 && $0.is$scanner_Token())); 5250 return this.beginSend(($0 && $0.is$Token()));
5251 }; 5251 };
5252 Listener.prototype.beginThrowStatement$1 = function($0) { 5252 Listener.prototype.beginThrowStatement$1 = function($0) {
5253 return this.beginThrowStatement(($0 && $0.is$scanner_Token())); 5253 return this.beginThrowStatement(($0 && $0.is$Token()));
5254 }; 5254 };
5255 Listener.prototype.beginTopLevelMember$1 = function($0) { 5255 Listener.prototype.beginTopLevelMember$1 = function($0) {
5256 return this.beginTopLevelMember(($0 && $0.is$scanner_Token())); 5256 return this.beginTopLevelMember(($0 && $0.is$Token()));
5257 }; 5257 };
5258 Listener.prototype.beginTypeArguments$1 = function($0) { 5258 Listener.prototype.beginTypeArguments$1 = function($0) {
5259 return this.beginTypeArguments(($0 && $0.is$scanner_Token())); 5259 return this.beginTypeArguments(($0 && $0.is$Token()));
5260 }; 5260 };
5261 Listener.prototype.beginTypeVariable$1 = function($0) { 5261 Listener.prototype.beginTypeVariable$1 = function($0) {
5262 return this.beginTypeVariable(($0 && $0.is$scanner_Token())); 5262 return this.beginTypeVariable(($0 && $0.is$Token()));
5263 }; 5263 };
5264 Listener.prototype.beginTypeVariables$1 = function($0) { 5264 Listener.prototype.beginTypeVariables$1 = function($0) {
5265 return this.beginTypeVariables(($0 && $0.is$scanner_Token())); 5265 return this.beginTypeVariables(($0 && $0.is$Token()));
5266 }; 5266 };
5267 Listener.prototype.beginVariablesDeclaration$1 = function($0) { 5267 Listener.prototype.beginVariablesDeclaration$1 = function($0) {
5268 return this.beginVariablesDeclaration(($0 && $0.is$scanner_Token())); 5268 return this.beginVariablesDeclaration(($0 && $0.is$Token()));
5269 }; 5269 };
5270 Listener.prototype.endArguments$3 = function($0, $1, $2) { 5270 Listener.prototype.endArguments$3 = function($0, $1, $2) {
5271 return this.endArguments($assert_num($0), ($1 && $1.is$scanner_Token()), ($2 & & $2.is$scanner_Token())); 5271 return this.endArguments($assert_num($0), ($1 && $1.is$Token()), ($2 && $2.is$ Token()));
5272 }; 5272 };
5273 Listener.prototype.endBlock$3 = function($0, $1, $2) { 5273 Listener.prototype.endBlock$3 = function($0, $1, $2) {
5274 return this.endBlock($assert_num($0), ($1 && $1.is$scanner_Token()), ($2 && $2 .is$scanner_Token())); 5274 return this.endBlock($assert_num($0), ($1 && $1.is$Token()), ($2 && $2.is$Toke n()));
5275 }; 5275 };
5276 Listener.prototype.endClass$5 = function($0, $1, $2, $3, $4) { 5276 Listener.prototype.endClass$5 = function($0, $1, $2, $3, $4) {
5277 return this.endClass($assert_num($0), ($1 && $1.is$scanner_Token()), ($2 && $2 .is$scanner_Token()), ($3 && $3.is$scanner_Token()), ($4 && $4.is$scanner_Token( ))); 5277 return this.endClass($assert_num($0), ($1 && $1.is$Token()), ($2 && $2.is$Toke n()), ($3 && $3.is$Token()), ($4 && $4.is$Token()));
5278 }; 5278 };
5279 Listener.prototype.endExpressionStatement$1 = function($0) { 5279 Listener.prototype.endExpressionStatement$1 = function($0) {
5280 return this.endExpressionStatement(($0 && $0.is$scanner_Token())); 5280 return this.endExpressionStatement(($0 && $0.is$Token()));
5281 }; 5281 };
5282 Listener.prototype.endForStatement$2 = function($0, $1) { 5282 Listener.prototype.endForStatement$2 = function($0, $1) {
5283 return this.endForStatement(($0 && $0.is$scanner_Token()), ($1 && $1.is$scanne r_Token())); 5283 return this.endForStatement(($0 && $0.is$Token()), ($1 && $1.is$Token()));
5284 }; 5284 };
5285 Listener.prototype.endFormalParameter$1 = function($0) { 5285 Listener.prototype.endFormalParameter$1 = function($0) {
5286 return this.endFormalParameter(($0 && $0.is$scanner_Token())); 5286 return this.endFormalParameter(($0 && $0.is$Token()));
5287 }; 5287 };
5288 Listener.prototype.endFormalParameters$3 = function($0, $1, $2) { 5288 Listener.prototype.endFormalParameters$3 = function($0, $1, $2) {
5289 return this.endFormalParameters($assert_num($0), ($1 && $1.is$scanner_Token()) , ($2 && $2.is$scanner_Token())); 5289 return this.endFormalParameters($assert_num($0), ($1 && $1.is$Token()), ($2 && $2.is$Token()));
5290 }; 5290 };
5291 Listener.prototype.endFunctionBody$3 = function($0, $1, $2) { 5291 Listener.prototype.endFunctionBody$3 = function($0, $1, $2) {
5292 return this.endFunctionBody($assert_num($0), ($1 && $1.is$scanner_Token()), ($ 2 && $2.is$scanner_Token())); 5292 return this.endFunctionBody($assert_num($0), ($1 && $1.is$Token()), ($2 && $2. is$Token()));
5293 }; 5293 };
5294 Listener.prototype.endFunctionName$1 = function($0) { 5294 Listener.prototype.endFunctionName$1 = function($0) {
5295 return this.endFunctionName(($0 && $0.is$scanner_Token())); 5295 return this.endFunctionName(($0 && $0.is$Token()));
5296 }; 5296 };
5297 Listener.prototype.endFunctionTypeAlias$1 = function($0) { 5297 Listener.prototype.endFunctionTypeAlias$1 = function($0) {
5298 return this.endFunctionTypeAlias(($0 && $0.is$scanner_Token())); 5298 return this.endFunctionTypeAlias(($0 && $0.is$Token()));
5299 }; 5299 };
5300 Listener.prototype.endIfStatement$2 = function($0, $1) { 5300 Listener.prototype.endIfStatement$2 = function($0, $1) {
5301 return this.endIfStatement(($0 && $0.is$scanner_Token()), ($1 && $1.is$scanner _Token())); 5301 return this.endIfStatement(($0 && $0.is$Token()), ($1 && $1.is$Token()));
5302 }; 5302 };
5303 Listener.prototype.endInitializedIdentifier$0 = function() { 5303 Listener.prototype.endInitializedIdentifier$0 = function() {
5304 return this.endInitializedIdentifier(); 5304 return this.endInitializedIdentifier();
5305 }; 5305 };
5306 Listener.prototype.endInitializer$1 = function($0) { 5306 Listener.prototype.endInitializer$1 = function($0) {
5307 return this.endInitializer(($0 && $0.is$scanner_Token())); 5307 return this.endInitializer(($0 && $0.is$Token()));
5308 }; 5308 };
5309 Listener.prototype.endInterface$1 = function($0) { 5309 Listener.prototype.endInterface$1 = function($0) {
5310 return this.endInterface(($0 && $0.is$scanner_Token())); 5310 return this.endInterface(($0 && $0.is$Token()));
5311 }; 5311 };
5312 Listener.prototype.endRethrowStatement$2 = function($0, $1) { 5312 Listener.prototype.endRethrowStatement$2 = function($0, $1) {
5313 return this.endRethrowStatement(($0 && $0.is$scanner_Token()), ($1 && $1.is$sc anner_Token())); 5313 return this.endRethrowStatement(($0 && $0.is$Token()), ($1 && $1.is$Token()));
5314 }; 5314 };
5315 Listener.prototype.endReturnStatement$3 = function($0, $1, $2) { 5315 Listener.prototype.endReturnStatement$3 = function($0, $1, $2) {
5316 return this.endReturnStatement($assert_bool($0), ($1 && $1.is$scanner_Token()) , ($2 && $2.is$scanner_Token())); 5316 return this.endReturnStatement($assert_bool($0), ($1 && $1.is$Token()), ($2 && $2.is$Token()));
5317 }; 5317 };
5318 Listener.prototype.endSend$1 = function($0) { 5318 Listener.prototype.endSend$1 = function($0) {
5319 return this.endSend(($0 && $0.is$scanner_Token())); 5319 return this.endSend(($0 && $0.is$Token()));
5320 }; 5320 };
5321 Listener.prototype.endThrowStatement$2 = function($0, $1) { 5321 Listener.prototype.endThrowStatement$2 = function($0, $1) {
5322 return this.endThrowStatement(($0 && $0.is$scanner_Token()), ($1 && $1.is$scan ner_Token())); 5322 return this.endThrowStatement(($0 && $0.is$Token()), ($1 && $1.is$Token()));
5323 }; 5323 };
5324 Listener.prototype.endTopLevelField$2 = function($0, $1) { 5324 Listener.prototype.endTopLevelField$2 = function($0, $1) {
5325 return this.endTopLevelField(($0 && $0.is$scanner_Token()), ($1 && $1.is$scann er_Token())); 5325 return this.endTopLevelField(($0 && $0.is$Token()), ($1 && $1.is$Token()));
5326 }; 5326 };
5327 Listener.prototype.endTopLevelMethod$2 = function($0, $1) { 5327 Listener.prototype.endTopLevelMethod$2 = function($0, $1) {
5328 return this.endTopLevelMethod(($0 && $0.is$scanner_Token()), ($1 && $1.is$scan ner_Token())); 5328 return this.endTopLevelMethod(($0 && $0.is$Token()), ($1 && $1.is$Token()));
5329 }; 5329 };
5330 Listener.prototype.endType$3 = function($0, $1, $2) { 5330 Listener.prototype.endType$3 = function($0, $1, $2) {
5331 return this.endType($assert_num($0), ($1 && $1.is$scanner_Token()), ($2 && $2. is$scanner_Token())); 5331 return this.endType($assert_num($0), ($1 && $1.is$Token()), ($2 && $2.is$Token ()));
5332 }; 5332 };
5333 Listener.prototype.endTypeArguments$3 = function($0, $1, $2) { 5333 Listener.prototype.endTypeArguments$3 = function($0, $1, $2) {
5334 return this.endTypeArguments($assert_num($0), ($1 && $1.is$scanner_Token()), ( $2 && $2.is$scanner_Token())); 5334 return this.endTypeArguments($assert_num($0), ($1 && $1.is$Token()), ($2 && $2 .is$Token()));
5335 }; 5335 };
5336 Listener.prototype.endTypeVariable$1 = function($0) { 5336 Listener.prototype.endTypeVariable$1 = function($0) {
5337 return this.endTypeVariable(($0 && $0.is$scanner_Token())); 5337 return this.endTypeVariable(($0 && $0.is$Token()));
5338 }; 5338 };
5339 Listener.prototype.endTypeVariables$3 = function($0, $1, $2) { 5339 Listener.prototype.endTypeVariables$3 = function($0, $1, $2) {
5340 return this.endTypeVariables($assert_num($0), ($1 && $1.is$scanner_Token()), ( $2 && $2.is$scanner_Token())); 5340 return this.endTypeVariables($assert_num($0), ($1 && $1.is$Token()), ($2 && $2 .is$Token()));
5341 }; 5341 };
5342 Listener.prototype.endVariablesDeclaration$2 = function($0, $1) { 5342 Listener.prototype.endVariablesDeclaration$2 = function($0, $1) {
5343 return this.endVariablesDeclaration($assert_num($0), ($1 && $1.is$scanner_Toke n())); 5343 return this.endVariablesDeclaration($assert_num($0), ($1 && $1.is$Token()));
5344 }; 5344 };
5345 Listener.prototype.expected$2 = function($0, $1) { 5345 Listener.prototype.expected$2 = function($0, $1) {
5346 return this.expected($assert_String($0), ($1 && $1.is$scanner_Token())); 5346 return this.expected($assert_String($0), ($1 && $1.is$Token()));
5347 }; 5347 };
5348 Listener.prototype.expectedBlock$1 = function($0) { 5348 Listener.prototype.expectedBlock$1 = function($0) {
5349 return this.expectedBlock(($0 && $0.is$scanner_Token())); 5349 return this.expectedBlock(($0 && $0.is$Token()));
5350 }; 5350 };
5351 Listener.prototype.expectedIdentifier$1 = function($0) { 5351 Listener.prototype.expectedIdentifier$1 = function($0) {
5352 return this.expectedIdentifier(($0 && $0.is$scanner_Token())); 5352 return this.expectedIdentifier(($0 && $0.is$Token()));
5353 }; 5353 };
5354 Listener.prototype.expectedType$1 = function($0) { 5354 Listener.prototype.expectedType$1 = function($0) {
5355 return this.expectedType(($0 && $0.is$scanner_Token())); 5355 return this.expectedType(($0 && $0.is$Token()));
5356 }; 5356 };
5357 Listener.prototype.handleAssignmentExpression$1 = function($0) { 5357 Listener.prototype.handleAssignmentExpression$1 = function($0) {
5358 return this.handleAssignmentExpression(($0 && $0.is$scanner_Token())); 5358 return this.handleAssignmentExpression(($0 && $0.is$Token()));
5359 }; 5359 };
5360 Listener.prototype.handleBinaryExpression$1 = function($0) { 5360 Listener.prototype.handleBinaryExpression$1 = function($0) {
5361 return this.handleBinaryExpression(($0 && $0.is$scanner_Token())); 5361 return this.handleBinaryExpression(($0 && $0.is$Token()));
5362 }; 5362 };
5363 Listener.prototype.handleConditionalExpression$2 = function($0, $1) { 5363 Listener.prototype.handleConditionalExpression$2 = function($0, $1) {
5364 return this.handleConditionalExpression(($0 && $0.is$scanner_Token()), ($1 && $1.is$scanner_Token())); 5364 return this.handleConditionalExpression(($0 && $0.is$Token()), ($1 && $1.is$To ken()));
5365 }; 5365 };
5366 Listener.prototype.handleIdentifier$1 = function($0) { 5366 Listener.prototype.handleIdentifier$1 = function($0) {
5367 return this.handleIdentifier(($0 && $0.is$scanner_Token())); 5367 return this.handleIdentifier(($0 && $0.is$Token()));
5368 }; 5368 };
5369 Listener.prototype.handleLiteralBool$1 = function($0) { 5369 Listener.prototype.handleLiteralBool$1 = function($0) {
5370 return this.handleLiteralBool(($0 && $0.is$scanner_Token())); 5370 return this.handleLiteralBool(($0 && $0.is$Token()));
5371 }; 5371 };
5372 Listener.prototype.handleLiteralDouble$1 = function($0) { 5372 Listener.prototype.handleLiteralDouble$1 = function($0) {
5373 return this.handleLiteralDouble(($0 && $0.is$scanner_Token())); 5373 return this.handleLiteralDouble(($0 && $0.is$Token()));
5374 }; 5374 };
5375 Listener.prototype.handleLiteralInt$1 = function($0) { 5375 Listener.prototype.handleLiteralInt$1 = function($0) {
5376 return this.handleLiteralInt(($0 && $0.is$scanner_Token())); 5376 return this.handleLiteralInt(($0 && $0.is$Token()));
5377 }; 5377 };
5378 Listener.prototype.handleLiteralString$1 = function($0) { 5378 Listener.prototype.handleLiteralString$1 = function($0) {
5379 return this.handleLiteralString(($0 && $0.is$scanner_Token())); 5379 return this.handleLiteralString(($0 && $0.is$Token()));
5380 }; 5380 };
5381 Listener.prototype.handleNoArguments$1 = function($0) { 5381 Listener.prototype.handleNoArguments$1 = function($0) {
5382 return this.handleNoArguments(($0 && $0.is$scanner_Token())); 5382 return this.handleNoArguments(($0 && $0.is$Token()));
5383 }; 5383 };
5384 Listener.prototype.handleNoType$1 = function($0) { 5384 Listener.prototype.handleNoType$1 = function($0) {
5385 return this.handleNoType(($0 && $0.is$scanner_Token())); 5385 return this.handleNoType(($0 && $0.is$Token()));
5386 }; 5386 };
5387 Listener.prototype.handleNoTypeArguments$1 = function($0) { 5387 Listener.prototype.handleNoTypeArguments$1 = function($0) {
5388 return this.handleNoTypeArguments(($0 && $0.is$scanner_Token())); 5388 return this.handleNoTypeArguments(($0 && $0.is$Token()));
5389 }; 5389 };
5390 Listener.prototype.handleNoTypeVariables$1 = function($0) { 5390 Listener.prototype.handleNoTypeVariables$1 = function($0) {
5391 return this.handleNoTypeVariables(($0 && $0.is$scanner_Token())); 5391 return this.handleNoTypeVariables(($0 && $0.is$Token()));
5392 }; 5392 };
5393 Listener.prototype.handleUnaryPostfixExpression$1 = function($0) { 5393 Listener.prototype.handleUnaryPostfixExpression$1 = function($0) {
5394 return this.handleUnaryPostfixExpression(($0 && $0.is$scanner_Token())); 5394 return this.handleUnaryPostfixExpression(($0 && $0.is$Token()));
5395 }; 5395 };
5396 Listener.prototype.handleUnaryPrefixExpression$1 = function($0) { 5396 Listener.prototype.handleUnaryPrefixExpression$1 = function($0) {
5397 return this.handleUnaryPrefixExpression(($0 && $0.is$scanner_Token())); 5397 return this.handleUnaryPrefixExpression(($0 && $0.is$Token()));
5398 }; 5398 };
5399 Listener.prototype.handleVarKeyword$1 = function($0) { 5399 Listener.prototype.handleVarKeyword$1 = function($0) {
5400 return this.handleVarKeyword(($0 && $0.is$scanner_Token())); 5400 return this.handleVarKeyword(($0 && $0.is$Token()));
5401 }; 5401 };
5402 Listener.prototype.handleVoidKeyword$1 = function($0) { 5402 Listener.prototype.handleVoidKeyword$1 = function($0) {
5403 return this.handleVoidKeyword(($0 && $0.is$scanner_Token())); 5403 return this.handleVoidKeyword(($0 && $0.is$Token()));
5404 }; 5404 };
5405 Listener.prototype.unexpected$1 = function($0) { 5405 Listener.prototype.unexpected$1 = function($0) {
5406 return this.unexpected(($0 && $0.is$scanner_Token())); 5406 return this.unexpected(($0 && $0.is$Token()));
5407 }; 5407 };
5408 Listener.prototype.unexpectedEof$0 = function() { 5408 Listener.prototype.unexpectedEof$0 = function() {
5409 return this.unexpectedEof(); 5409 return this.unexpectedEof();
5410 }; 5410 };
5411 // ********** Code for ParserError ************** 5411 // ********** Code for ParserError **************
5412 function ParserError(reason) { 5412 function ParserError(reason) {
5413 this.reason = reason; 5413 this.reason = reason;
5414 // Initializers done 5414 // Initializers done
5415 } 5415 }
5416 ParserError.prototype.toString = function() { 5416 ParserError.prototype.toString = function() {
(...skipping 13 matching lines...) Expand all
5430 } 5430 }
5431 $inherits(ElementListener, Listener); 5431 $inherits(ElementListener, Listener);
5432 ElementListener.prototype.beginLibraryTag = function(token) { 5432 ElementListener.prototype.beginLibraryTag = function(token) {
5433 this.canceler.cancel("Cannot handle library tags"); 5433 this.canceler.cancel("Cannot handle library tags");
5434 } 5434 }
5435 ElementListener.prototype.endClass = function(interfacesCount, beginToken, exten dsKeyword, implementsKeyword, endToken) { 5435 ElementListener.prototype.endClass = function(interfacesCount, beginToken, exten dsKeyword, implementsKeyword, endToken) {
5436 var $0; 5436 var $0;
5437 for (; interfacesCount > 0; --interfacesCount) { 5437 for (; interfacesCount > 0; --interfacesCount) {
5438 this.popNode(); 5438 this.popNode();
5439 } 5439 }
5440 var supertype = (($0 = this.popNode()) && $0.is$tree_Identifier()); 5440 var supertype = (($0 = this.popNode()) && $0.is$Identifier());
5441 var name = (($0 = this.popNode()) && $0.is$tree_Identifier()); 5441 var name = (($0 = this.popNode()) && $0.is$Identifier());
5442 this.pushElement(new PartialClassElement(name.get$source(), beginToken, endTok en)); 5442 this.pushElement(new PartialClassElement(name.get$source(), beginToken, endTok en));
5443 } 5443 }
5444 ElementListener.prototype.endInterface = function(token) { 5444 ElementListener.prototype.endInterface = function(token) {
5445 this.canceler.cancel("Cannot handle interfaces"); 5445 this.canceler.cancel("Cannot handle interfaces");
5446 } 5446 }
5447 ElementListener.prototype.endFunctionTypeAlias = function(token) { 5447 ElementListener.prototype.endFunctionTypeAlias = function(token) {
5448 this.canceler.cancel("Cannot handle typedefs"); 5448 this.canceler.cancel("Cannot handle typedefs");
5449 } 5449 }
5450 ElementListener.prototype.endTopLevelMethod = function(beginToken, endToken) { 5450 ElementListener.prototype.endTopLevelMethod = function(beginToken, endToken) {
5451 var $0; 5451 var $0;
5452 var name = (($0 = this.popNode()) && $0.is$tree_Identifier()); 5452 var name = (($0 = this.popNode()) && $0.is$Identifier());
5453 this.pushElement(new PartialFunctionElement(name.get$source(), beginToken, end Token)); 5453 this.pushElement(new PartialFunctionElement(name.get$source(), beginToken, end Token));
5454 } 5454 }
5455 ElementListener.prototype.endTopLevelField = function(beginToken, endToken) { 5455 ElementListener.prototype.endTopLevelField = function(beginToken, endToken) {
5456 this.canceler.cancel("Cannot handle fields"); 5456 this.canceler.cancel("Cannot handle fields");
5457 } 5457 }
5458 ElementListener.prototype.handleIdentifier = function(token) { 5458 ElementListener.prototype.handleIdentifier = function(token) {
5459 this.pushNode(new tree_Identifier(token)); 5459 this.pushNode(new Identifier(token));
5460 } 5460 }
5461 ElementListener.prototype.handleNoType = function(token) { 5461 ElementListener.prototype.handleNoType = function(token) {
5462 this.pushNode(null); 5462 this.pushNode(null);
5463 } 5463 }
5464 ElementListener.prototype.endTypeVariable = function(token) { 5464 ElementListener.prototype.endTypeVariable = function(token) {
5465 var $0; 5465 var $0;
5466 var bound = (($0 = this.popNode()) && $0.is$TypeAnnotation()); 5466 var bound = (($0 = this.popNode()) && $0.is$TypeAnnotation());
5467 var name = (($0 = this.popNode()) && $0.is$tree_Identifier()); 5467 var name = (($0 = this.popNode()) && $0.is$Identifier());
5468 } 5468 }
5469 ElementListener.prototype.endTypeArguments = function(count, beginToken, endToke n) { 5469 ElementListener.prototype.endTypeArguments = function(count, beginToken, endToke n) {
5470 for (; count > 0; --count) { 5470 for (; count > 0; --count) {
5471 this.popNode(); 5471 this.popNode();
5472 } 5472 }
5473 } 5473 }
5474 ElementListener.prototype.expected = function(string, token) { 5474 ElementListener.prototype.expected = function(string, token) {
5475 this.canceler.cancel(("Expected '" + string + "', but got '" + token + "' ") + ("@ " + token.charOffset + "")); 5475 this.canceler.cancel(("Expected '" + string + "', but got '" + token + "' ") + ("@ " + token.charOffset + ""));
5476 } 5476 }
5477 ElementListener.prototype.unexpectedEof = function() { 5477 ElementListener.prototype.unexpectedEof = function() {
(...skipping 16 matching lines...) Expand all
5494 this.topLevelElements = (($0 = this.topLevelElements.prepend(element)) && $0.i s$Link$Element()); 5494 this.topLevelElements = (($0 = this.topLevelElements.prepend(element)) && $0.i s$Link$Element());
5495 } 5495 }
5496 ElementListener.prototype.pushNode = function(node) { 5496 ElementListener.prototype.pushNode = function(node) {
5497 var $0; 5497 var $0;
5498 this.nodes = (($0 = this.nodes.prepend(node)) && $0.is$Link$Node()); 5498 this.nodes = (($0 = this.nodes.prepend(node)) && $0.is$Link$Node());
5499 this.log(("push " + this.nodes + "")); 5499 this.log(("push " + this.nodes + ""));
5500 } 5500 }
5501 ElementListener.prototype.popNode = function() { 5501 ElementListener.prototype.popNode = function() {
5502 var $0; 5502 var $0;
5503 $assert(!$notnull_bool(this.nodes.isEmpty()), "!nodes.isEmpty()", "listener.da rt", 343, 12); 5503 $assert(!$notnull_bool(this.nodes.isEmpty()), "!nodes.isEmpty()", "listener.da rt", 343, 12);
5504 var node = (($0 = this.nodes.get$head()) && $0.is$tree_Node()); 5504 var node = (($0 = this.nodes.get$head()) && $0.is$Node());
5505 this.nodes = (($0 = this.nodes.get$tail()) && $0.is$Link$Node()); 5505 this.nodes = (($0 = this.nodes.get$tail()) && $0.is$Link$Node());
5506 this.log(("pop " + this.nodes + "")); 5506 this.log(("pop " + this.nodes + ""));
5507 return node; 5507 return node;
5508 } 5508 }
5509 ElementListener.prototype.log = function(message) { 5509 ElementListener.prototype.log = function(message) {
5510 5510
5511 } 5511 }
5512 ElementListener.prototype.beginLibraryTag$1 = function($0) { 5512 ElementListener.prototype.beginLibraryTag$1 = function($0) {
5513 return this.beginLibraryTag(($0 && $0.is$scanner_Token())); 5513 return this.beginLibraryTag(($0 && $0.is$Token()));
5514 }; 5514 };
5515 ElementListener.prototype.endClass$5 = function($0, $1, $2, $3, $4) { 5515 ElementListener.prototype.endClass$5 = function($0, $1, $2, $3, $4) {
5516 return this.endClass($assert_num($0), ($1 && $1.is$scanner_Token()), ($2 && $2 .is$scanner_Token()), ($3 && $3.is$scanner_Token()), ($4 && $4.is$scanner_Token( ))); 5516 return this.endClass($assert_num($0), ($1 && $1.is$Token()), ($2 && $2.is$Toke n()), ($3 && $3.is$Token()), ($4 && $4.is$Token()));
5517 }; 5517 };
5518 ElementListener.prototype.endFunctionTypeAlias$1 = function($0) { 5518 ElementListener.prototype.endFunctionTypeAlias$1 = function($0) {
5519 return this.endFunctionTypeAlias(($0 && $0.is$scanner_Token())); 5519 return this.endFunctionTypeAlias(($0 && $0.is$Token()));
5520 }; 5520 };
5521 ElementListener.prototype.endInterface$1 = function($0) { 5521 ElementListener.prototype.endInterface$1 = function($0) {
5522 return this.endInterface(($0 && $0.is$scanner_Token())); 5522 return this.endInterface(($0 && $0.is$Token()));
5523 }; 5523 };
5524 ElementListener.prototype.endTopLevelField$2 = function($0, $1) { 5524 ElementListener.prototype.endTopLevelField$2 = function($0, $1) {
5525 return this.endTopLevelField(($0 && $0.is$scanner_Token()), ($1 && $1.is$scann er_Token())); 5525 return this.endTopLevelField(($0 && $0.is$Token()), ($1 && $1.is$Token()));
5526 }; 5526 };
5527 ElementListener.prototype.endTopLevelMethod$2 = function($0, $1) { 5527 ElementListener.prototype.endTopLevelMethod$2 = function($0, $1) {
5528 return this.endTopLevelMethod(($0 && $0.is$scanner_Token()), ($1 && $1.is$scan ner_Token())); 5528 return this.endTopLevelMethod(($0 && $0.is$Token()), ($1 && $1.is$Token()));
5529 }; 5529 };
5530 ElementListener.prototype.endTypeArguments$3 = function($0, $1, $2) { 5530 ElementListener.prototype.endTypeArguments$3 = function($0, $1, $2) {
5531 return this.endTypeArguments($assert_num($0), ($1 && $1.is$scanner_Token()), ( $2 && $2.is$scanner_Token())); 5531 return this.endTypeArguments($assert_num($0), ($1 && $1.is$Token()), ($2 && $2 .is$Token()));
5532 }; 5532 };
5533 ElementListener.prototype.endTypeVariable$1 = function($0) { 5533 ElementListener.prototype.endTypeVariable$1 = function($0) {
5534 return this.endTypeVariable(($0 && $0.is$scanner_Token())); 5534 return this.endTypeVariable(($0 && $0.is$Token()));
5535 }; 5535 };
5536 ElementListener.prototype.expected$2 = function($0, $1) { 5536 ElementListener.prototype.expected$2 = function($0, $1) {
5537 return this.expected($assert_String($0), ($1 && $1.is$scanner_Token())); 5537 return this.expected($assert_String($0), ($1 && $1.is$Token()));
5538 }; 5538 };
5539 ElementListener.prototype.expectedBlock$1 = function($0) { 5539 ElementListener.prototype.expectedBlock$1 = function($0) {
5540 return this.expectedBlock(($0 && $0.is$scanner_Token())); 5540 return this.expectedBlock(($0 && $0.is$Token()));
5541 }; 5541 };
5542 ElementListener.prototype.expectedIdentifier$1 = function($0) { 5542 ElementListener.prototype.expectedIdentifier$1 = function($0) {
5543 return this.expectedIdentifier(($0 && $0.is$scanner_Token())); 5543 return this.expectedIdentifier(($0 && $0.is$Token()));
5544 }; 5544 };
5545 ElementListener.prototype.expectedType$1 = function($0) { 5545 ElementListener.prototype.expectedType$1 = function($0) {
5546 return this.expectedType(($0 && $0.is$scanner_Token())); 5546 return this.expectedType(($0 && $0.is$Token()));
5547 }; 5547 };
5548 ElementListener.prototype.handleIdentifier$1 = function($0) { 5548 ElementListener.prototype.handleIdentifier$1 = function($0) {
5549 return this.handleIdentifier(($0 && $0.is$scanner_Token())); 5549 return this.handleIdentifier(($0 && $0.is$Token()));
5550 }; 5550 };
5551 ElementListener.prototype.handleNoType$1 = function($0) { 5551 ElementListener.prototype.handleNoType$1 = function($0) {
5552 return this.handleNoType(($0 && $0.is$scanner_Token())); 5552 return this.handleNoType(($0 && $0.is$Token()));
5553 }; 5553 };
5554 ElementListener.prototype.unexpected$1 = function($0) { 5554 ElementListener.prototype.unexpected$1 = function($0) {
5555 return this.unexpected(($0 && $0.is$scanner_Token())); 5555 return this.unexpected(($0 && $0.is$Token()));
5556 }; 5556 };
5557 ElementListener.prototype.unexpectedEof$0 = function() { 5557 ElementListener.prototype.unexpectedEof$0 = function() {
5558 return this.unexpectedEof(); 5558 return this.unexpectedEof();
5559 }; 5559 };
5560 // ********** Code for NodeListener ************** 5560 // ********** Code for NodeListener **************
5561 function NodeListener(canceler, logger) { 5561 function NodeListener(canceler, logger) {
5562 this.logger = logger; 5562 this.logger = logger;
5563 // Initializers done 5563 // Initializers done
5564 ElementListener.call(this, canceler); 5564 ElementListener.call(this, canceler);
5565 this.onError = this.get$handleOnError(); 5565 this.onError = this.get$handleOnError();
5566 } 5566 }
5567 $inherits(NodeListener, ElementListener); 5567 $inherits(NodeListener, ElementListener);
5568 NodeListener.prototype.endClass = function(interfacesCount, beginToken, extendsK eyword, implementsKeyword, endToken) { 5568 NodeListener.prototype.endClass = function(interfacesCount, beginToken, extendsK eyword, implementsKeyword, endToken) {
5569 var $0; 5569 var $0;
5570 var interfaces = this.makeNodeList(interfacesCount, implementsKeyword, null, " ,"); 5570 var interfaces = this.makeNodeList(interfacesCount, implementsKeyword, null, " ,");
5571 var supertype = (($0 = this.popNode()) && $0.is$TypeAnnotation()); 5571 var supertype = (($0 = this.popNode()) && $0.is$TypeAnnotation());
5572 var name = (($0 = this.popNode()) && $0.is$tree_Identifier()); 5572 var name = (($0 = this.popNode()) && $0.is$Identifier());
5573 this.pushNode(new ClassNode(name, supertype, interfaces, beginToken, extendsKe yword, endToken)); 5573 this.pushNode(new ClassNode(name, supertype, interfaces, beginToken, extendsKe yword, endToken));
5574 } 5574 }
5575 NodeListener.prototype.endFormalParameter = function(token) { 5575 NodeListener.prototype.endFormalParameter = function(token) {
5576 var $0; 5576 var $0;
5577 var name = new NodeList.singleton$ctor(this.popNode()); 5577 var name = new NodeList.singleton$ctor(this.popNode());
5578 var type = (($0 = this.popNode()) && $0.is$TypeAnnotation()); 5578 var type = (($0 = this.popNode()) && $0.is$TypeAnnotation());
5579 this.pushNode(new VariableDefinitions(type, null, name, token)); 5579 this.pushNode(new VariableDefinitions(type, null, name, token));
5580 } 5580 }
5581 NodeListener.prototype.endFormalParameters = function(count, beginToken, endToke n) { 5581 NodeListener.prototype.endFormalParameters = function(count, beginToken, endToke n) {
5582 this.pushNode(this.makeNodeList(count, beginToken, endToken, ",")); 5582 this.pushNode(this.makeNodeList(count, beginToken, endToken, ","));
5583 } 5583 }
5584 NodeListener.prototype.endArguments = function(count, beginToken, endToken) { 5584 NodeListener.prototype.endArguments = function(count, beginToken, endToken) {
5585 this.pushNode(this.makeNodeList(count, beginToken, endToken, ",")); 5585 this.pushNode(this.makeNodeList(count, beginToken, endToken, ","));
5586 } 5586 }
5587 NodeListener.prototype.handleNoArguments = function(token) { 5587 NodeListener.prototype.handleNoArguments = function(token) {
5588 this.pushNode(null); 5588 this.pushNode(null);
5589 } 5589 }
5590 NodeListener.prototype.endReturnStatement = function(hasExpression, beginToken, endToken) { 5590 NodeListener.prototype.endReturnStatement = function(hasExpression, beginToken, endToken) {
5591 var $0; 5591 var $0;
5592 var expression = (($0 = $notnull_bool(hasExpression) ? this.popNode() : null) && $0.is$tree_Expression()); 5592 var expression = (($0 = $notnull_bool(hasExpression) ? this.popNode() : null) && $0.is$Expression());
5593 this.pushNode(new Return(beginToken, endToken, expression)); 5593 this.pushNode(new Return(beginToken, endToken, expression));
5594 } 5594 }
5595 NodeListener.prototype.endExpressionStatement = function(token) { 5595 NodeListener.prototype.endExpressionStatement = function(token) {
5596 this.pushNode(new tree_ExpressionStatement(this.popNode(), token)); 5596 this.pushNode(new ExpressionStatement(this.popNode(), token));
5597 } 5597 }
5598 NodeListener.prototype.handleOnError = function(token, error) { 5598 NodeListener.prototype.handleOnError = function(token, error) {
5599 this.canceler.cancel(("internal error @ " + token.charOffset + ": '" + token.g et$value() + "'") + (": " + error + "")); 5599 this.canceler.cancel(("internal error @ " + token.charOffset + ": '" + token.g et$value() + "'") + (": " + error + ""));
5600 } 5600 }
5601 NodeListener.prototype.get$handleOnError = function() { 5601 NodeListener.prototype.get$handleOnError = function() {
5602 return NodeListener.prototype.handleOnError.bind(this); 5602 return NodeListener.prototype.handleOnError.bind(this);
5603 } 5603 }
5604 NodeListener.prototype.handleLiteralInt = function(token) { 5604 NodeListener.prototype.handleLiteralInt = function(token) {
5605 this.pushNode(new LiteralInt(token, to$call$2(this.onError))); 5605 this.pushNode(new LiteralInt(token, to$call$2(this.onError)));
5606 } 5606 }
(...skipping 25 matching lines...) Expand all
5632 var condition = this.popNode(); 5632 var condition = this.popNode();
5633 this.canceler.cancel('conditional expression not implemented yet'); 5633 this.canceler.cancel('conditional expression not implemented yet');
5634 } 5634 }
5635 NodeListener.prototype.endSend = function(token) { 5635 NodeListener.prototype.endSend = function(token) {
5636 var $0; 5636 var $0;
5637 var arguments = (($0 = this.popNode()) && $0.is$NodeList()); 5637 var arguments = (($0 = this.popNode()) && $0.is$NodeList());
5638 var selector = this.popNode(); 5638 var selector = this.popNode();
5639 this.pushNode(new Send(null, selector, arguments)); 5639 this.pushNode(new Send(null, selector, arguments));
5640 } 5640 }
5641 NodeListener.prototype.handleVoidKeyword = function(token) { 5641 NodeListener.prototype.handleVoidKeyword = function(token) {
5642 this.pushNode(new TypeAnnotation(new tree_Identifier(token))); 5642 this.pushNode(new TypeAnnotation(new Identifier(token)));
5643 } 5643 }
5644 NodeListener.prototype.endFunctionBody = function(count, beginToken, endToken) { 5644 NodeListener.prototype.endFunctionBody = function(count, beginToken, endToken) {
5645 var $0; 5645 var $0;
5646 var block = new Block(this.makeNodeList(count, beginToken, endToken, null)); 5646 var block = new Block(this.makeNodeList(count, beginToken, endToken, null));
5647 var formals = this.popNode(); 5647 var formals = this.popNode();
5648 var name = this.popNode(); 5648 var name = this.popNode();
5649 var type = (($0 = this.popNode()) && $0.is$TypeAnnotation()); 5649 var type = (($0 = this.popNode()) && $0.is$TypeAnnotation());
5650 this.pushNode(new FunctionExpression(name, formals, block, type)); 5650 this.pushNode(new FunctionExpression(name, formals, block, type));
5651 } 5651 }
5652 NodeListener.prototype.handleVarKeyword = function(token) { 5652 NodeListener.prototype.handleVarKeyword = function(token) {
5653 this.pushNode(new tree_Identifier(token)); 5653 this.pushNode(new Identifier(token));
5654 } 5654 }
5655 NodeListener.prototype.handleFinalKeyword = function(token) { 5655 NodeListener.prototype.handleFinalKeyword = function(token) {
5656 this.pushNode(new tree_Identifier(token)); 5656 this.pushNode(new Identifier(token));
5657 } 5657 }
5658 NodeListener.prototype.endVariablesDeclaration = function(count, endToken) { 5658 NodeListener.prototype.endVariablesDeclaration = function(count, endToken) {
5659 var $0; 5659 var $0;
5660 var variables = this.makeNodeList(count, null, null, ","); 5660 var variables = this.makeNodeList(count, null, null, ",");
5661 var type = (($0 = this.popNode()) && $0.is$TypeAnnotation()); 5661 var type = (($0 = this.popNode()) && $0.is$TypeAnnotation());
5662 this.pushNode(new VariableDefinitions(type, null, variables, endToken)); 5662 this.pushNode(new VariableDefinitions(type, null, variables, endToken));
5663 } 5663 }
5664 NodeListener.prototype.endInitializer = function(assignmentOperator) { 5664 NodeListener.prototype.endInitializer = function(assignmentOperator) {
5665 var $0; 5665 var $0;
5666 var initializer = (($0 = this.popNode()) && $0.is$tree_Expression()); 5666 var initializer = (($0 = this.popNode()) && $0.is$Expression());
5667 var arguments = new NodeList.singleton$ctor(initializer); 5667 var arguments = new NodeList.singleton$ctor(initializer);
5668 var name = (($0 = this.popNode()) && $0.is$tree_Expression()); 5668 var name = (($0 = this.popNode()) && $0.is$Expression());
5669 this.pushNode(new SendSet(null, name, assignmentOperator, arguments)); 5669 this.pushNode(new SendSet(null, name, assignmentOperator, arguments));
5670 } 5670 }
5671 NodeListener.prototype.endIfStatement = function(ifToken, elseToken) { 5671 NodeListener.prototype.endIfStatement = function(ifToken, elseToken) {
5672 var $0; 5672 var $0;
5673 var elsePart = (($0 = (elseToken == null) ? null : this.popNode()) && $0.is$tr ee_Statement()); 5673 var elsePart = (($0 = (elseToken == null) ? null : this.popNode()) && $0.is$St atement());
5674 var thenPart = (($0 = this.popNode()) && $0.is$tree_Statement()); 5674 var thenPart = (($0 = this.popNode()) && $0.is$Statement());
5675 var condition = (($0 = this.popNode()) && $0.is$NodeList()); 5675 var condition = (($0 = this.popNode()) && $0.is$NodeList());
5676 this.pushNode(new If(condition, thenPart, elsePart, ifToken, elseToken)); 5676 this.pushNode(new If(condition, thenPart, elsePart, ifToken, elseToken));
5677 } 5677 }
5678 NodeListener.prototype.endForStatement = function(beginToken, endToken) { 5678 NodeListener.prototype.endForStatement = function(beginToken, endToken) {
5679 var $0; 5679 var $0;
5680 var body = (($0 = this.popNode()) && $0.is$tree_Statement()); 5680 var body = (($0 = this.popNode()) && $0.is$Statement());
5681 var update = (($0 = this.popNode()) && $0.is$tree_Expression()); 5681 var update = (($0 = this.popNode()) && $0.is$Expression());
5682 var condition = (($0 = this.popNode()) && $0.is$tree_ExpressionStatement()); 5682 var condition = (($0 = this.popNode()) && $0.is$ExpressionStatement());
5683 var initializer = (($0 = this.popNode()) && $0.is$VariableDefinitions()); 5683 var initializer = (($0 = this.popNode()) && $0.is$VariableDefinitions());
5684 this.pushNode(new For(initializer, condition, update, body, beginToken)); 5684 this.pushNode(new For(initializer, condition, update, body, beginToken));
5685 } 5685 }
5686 NodeListener.prototype.endBlock = function(count, beginToken, endToken) { 5686 NodeListener.prototype.endBlock = function(count, beginToken, endToken) {
5687 this.pushNode(new Block(this.makeNodeList(count, beginToken, endToken, null))) ; 5687 this.pushNode(new Block(this.makeNodeList(count, beginToken, endToken, null))) ;
5688 } 5688 }
5689 NodeListener.prototype.endType = function(count, beginToken, endToken) { 5689 NodeListener.prototype.endType = function(count, beginToken, endToken) {
5690 var $0; 5690 var $0;
5691 var type = new TypeAnnotation((($0 = this.popNode()) && $0.is$tree_Identifier( ))); 5691 var type = new TypeAnnotation((($0 = this.popNode()) && $0.is$Identifier()));
5692 for (; count > 1; --count) { 5692 for (; count > 1; --count) {
5693 this.popNode(); 5693 this.popNode();
5694 } 5694 }
5695 this.pushNode(type); 5695 this.pushNode(type);
5696 } 5696 }
5697 NodeListener.prototype.endThrowStatement = function(throwToken, endToken) { 5697 NodeListener.prototype.endThrowStatement = function(throwToken, endToken) {
5698 var $0; 5698 var $0;
5699 var expression = (($0 = this.popNode()) && $0.is$tree_Expression()); 5699 var expression = (($0 = this.popNode()) && $0.is$Expression());
5700 this.pushNode(new Throw(expression, throwToken, endToken)); 5700 this.pushNode(new Throw(expression, throwToken, endToken));
5701 } 5701 }
5702 NodeListener.prototype.endRethrowStatement = function(throwToken, endToken) { 5702 NodeListener.prototype.endRethrowStatement = function(throwToken, endToken) {
5703 this.pushNode(new Throw(null, throwToken, endToken)); 5703 this.pushNode(new Throw(null, throwToken, endToken));
5704 } 5704 }
5705 NodeListener.prototype.handleUnaryPostfixExpression = function(token) { 5705 NodeListener.prototype.handleUnaryPostfixExpression = function(token) {
5706 this.pushNode(new Send.postfix$ctor(this.popNode(), new Operator(token))); 5706 this.pushNode(new Send.postfix$ctor(this.popNode(), new Operator(token)));
5707 } 5707 }
5708 NodeListener.prototype.handleUnaryPrefixExpression = function(token) { 5708 NodeListener.prototype.handleUnaryPrefixExpression = function(token) {
5709 this.pushNode(new Send.prefix$ctor(this.popNode(), new Operator(token))); 5709 this.pushNode(new Send.prefix$ctor(this.popNode(), new Operator(token)));
5710 } 5710 }
5711 NodeListener.prototype.makeNodeList = function(count, beginToken, endToken, deli miter) { 5711 NodeListener.prototype.makeNodeList = function(count, beginToken, endToken, deli miter) {
5712 var $0; 5712 var $0;
5713 var nodes = const$14/*const EmptyLink()*/; 5713 var nodes = const$14/*const EmptyLink()*/;
5714 for (; count > 0; --count) { 5714 for (; count > 0; --count) {
5715 nodes = (($0 = nodes.prepend(this.popNode())) && $0.is$Link$Node()); 5715 nodes = (($0 = nodes.prepend(this.popNode())) && $0.is$Link$Node());
5716 } 5716 }
5717 var sourceDelimiter = (($0 = (delimiter == null) ? null : new StringWrapper(de limiter)) && $0.is$SourceString()); 5717 var sourceDelimiter = (($0 = (delimiter == null) ? null : new StringWrapper(de limiter)) && $0.is$SourceString());
5718 return new NodeList(beginToken, nodes, endToken, sourceDelimiter); 5718 return new NodeList(beginToken, nodes, endToken, sourceDelimiter);
5719 } 5719 }
5720 NodeListener.prototype.log = function(message) { 5720 NodeListener.prototype.log = function(message) {
5721 this.logger.log(message); 5721 this.logger.log(message);
5722 } 5722 }
5723 NodeListener.prototype.endArguments$3 = function($0, $1, $2) { 5723 NodeListener.prototype.endArguments$3 = function($0, $1, $2) {
5724 return this.endArguments($assert_num($0), ($1 && $1.is$scanner_Token()), ($2 & & $2.is$scanner_Token())); 5724 return this.endArguments($assert_num($0), ($1 && $1.is$Token()), ($2 && $2.is$ Token()));
5725 }; 5725 };
5726 NodeListener.prototype.endBlock$3 = function($0, $1, $2) { 5726 NodeListener.prototype.endBlock$3 = function($0, $1, $2) {
5727 return this.endBlock($assert_num($0), ($1 && $1.is$scanner_Token()), ($2 && $2 .is$scanner_Token())); 5727 return this.endBlock($assert_num($0), ($1 && $1.is$Token()), ($2 && $2.is$Toke n()));
5728 }; 5728 };
5729 NodeListener.prototype.endClass$5 = function($0, $1, $2, $3, $4) { 5729 NodeListener.prototype.endClass$5 = function($0, $1, $2, $3, $4) {
5730 return this.endClass($assert_num($0), ($1 && $1.is$scanner_Token()), ($2 && $2 .is$scanner_Token()), ($3 && $3.is$scanner_Token()), ($4 && $4.is$scanner_Token( ))); 5730 return this.endClass($assert_num($0), ($1 && $1.is$Token()), ($2 && $2.is$Toke n()), ($3 && $3.is$Token()), ($4 && $4.is$Token()));
5731 }; 5731 };
5732 NodeListener.prototype.endExpressionStatement$1 = function($0) { 5732 NodeListener.prototype.endExpressionStatement$1 = function($0) {
5733 return this.endExpressionStatement(($0 && $0.is$scanner_Token())); 5733 return this.endExpressionStatement(($0 && $0.is$Token()));
5734 }; 5734 };
5735 NodeListener.prototype.endForStatement$2 = function($0, $1) { 5735 NodeListener.prototype.endForStatement$2 = function($0, $1) {
5736 return this.endForStatement(($0 && $0.is$scanner_Token()), ($1 && $1.is$scanne r_Token())); 5736 return this.endForStatement(($0 && $0.is$Token()), ($1 && $1.is$Token()));
5737 }; 5737 };
5738 NodeListener.prototype.endFormalParameter$1 = function($0) { 5738 NodeListener.prototype.endFormalParameter$1 = function($0) {
5739 return this.endFormalParameter(($0 && $0.is$scanner_Token())); 5739 return this.endFormalParameter(($0 && $0.is$Token()));
5740 }; 5740 };
5741 NodeListener.prototype.endFormalParameters$3 = function($0, $1, $2) { 5741 NodeListener.prototype.endFormalParameters$3 = function($0, $1, $2) {
5742 return this.endFormalParameters($assert_num($0), ($1 && $1.is$scanner_Token()) , ($2 && $2.is$scanner_Token())); 5742 return this.endFormalParameters($assert_num($0), ($1 && $1.is$Token()), ($2 && $2.is$Token()));
5743 }; 5743 };
5744 NodeListener.prototype.endFunctionBody$3 = function($0, $1, $2) { 5744 NodeListener.prototype.endFunctionBody$3 = function($0, $1, $2) {
5745 return this.endFunctionBody($assert_num($0), ($1 && $1.is$scanner_Token()), ($ 2 && $2.is$scanner_Token())); 5745 return this.endFunctionBody($assert_num($0), ($1 && $1.is$Token()), ($2 && $2. is$Token()));
5746 }; 5746 };
5747 NodeListener.prototype.endIfStatement$2 = function($0, $1) { 5747 NodeListener.prototype.endIfStatement$2 = function($0, $1) {
5748 return this.endIfStatement(($0 && $0.is$scanner_Token()), ($1 && $1.is$scanner _Token())); 5748 return this.endIfStatement(($0 && $0.is$Token()), ($1 && $1.is$Token()));
5749 }; 5749 };
5750 NodeListener.prototype.endInitializer$1 = function($0) { 5750 NodeListener.prototype.endInitializer$1 = function($0) {
5751 return this.endInitializer(($0 && $0.is$scanner_Token())); 5751 return this.endInitializer(($0 && $0.is$Token()));
5752 }; 5752 };
5753 NodeListener.prototype.endRethrowStatement$2 = function($0, $1) { 5753 NodeListener.prototype.endRethrowStatement$2 = function($0, $1) {
5754 return this.endRethrowStatement(($0 && $0.is$scanner_Token()), ($1 && $1.is$sc anner_Token())); 5754 return this.endRethrowStatement(($0 && $0.is$Token()), ($1 && $1.is$Token()));
5755 }; 5755 };
5756 NodeListener.prototype.endReturnStatement$3 = function($0, $1, $2) { 5756 NodeListener.prototype.endReturnStatement$3 = function($0, $1, $2) {
5757 return this.endReturnStatement($assert_bool($0), ($1 && $1.is$scanner_Token()) , ($2 && $2.is$scanner_Token())); 5757 return this.endReturnStatement($assert_bool($0), ($1 && $1.is$Token()), ($2 && $2.is$Token()));
5758 }; 5758 };
5759 NodeListener.prototype.endSend$1 = function($0) { 5759 NodeListener.prototype.endSend$1 = function($0) {
5760 return this.endSend(($0 && $0.is$scanner_Token())); 5760 return this.endSend(($0 && $0.is$Token()));
5761 }; 5761 };
5762 NodeListener.prototype.endThrowStatement$2 = function($0, $1) { 5762 NodeListener.prototype.endThrowStatement$2 = function($0, $1) {
5763 return this.endThrowStatement(($0 && $0.is$scanner_Token()), ($1 && $1.is$scan ner_Token())); 5763 return this.endThrowStatement(($0 && $0.is$Token()), ($1 && $1.is$Token()));
5764 }; 5764 };
5765 NodeListener.prototype.endType$3 = function($0, $1, $2) { 5765 NodeListener.prototype.endType$3 = function($0, $1, $2) {
5766 return this.endType($assert_num($0), ($1 && $1.is$scanner_Token()), ($2 && $2. is$scanner_Token())); 5766 return this.endType($assert_num($0), ($1 && $1.is$Token()), ($2 && $2.is$Token ()));
5767 }; 5767 };
5768 NodeListener.prototype.endVariablesDeclaration$2 = function($0, $1) { 5768 NodeListener.prototype.endVariablesDeclaration$2 = function($0, $1) {
5769 return this.endVariablesDeclaration($assert_num($0), ($1 && $1.is$scanner_Toke n())); 5769 return this.endVariablesDeclaration($assert_num($0), ($1 && $1.is$Token()));
5770 }; 5770 };
5771 NodeListener.prototype.handleAssignmentExpression$1 = function($0) { 5771 NodeListener.prototype.handleAssignmentExpression$1 = function($0) {
5772 return this.handleAssignmentExpression(($0 && $0.is$scanner_Token())); 5772 return this.handleAssignmentExpression(($0 && $0.is$Token()));
5773 }; 5773 };
5774 NodeListener.prototype.handleBinaryExpression$1 = function($0) { 5774 NodeListener.prototype.handleBinaryExpression$1 = function($0) {
5775 return this.handleBinaryExpression(($0 && $0.is$scanner_Token())); 5775 return this.handleBinaryExpression(($0 && $0.is$Token()));
5776 }; 5776 };
5777 NodeListener.prototype.handleConditionalExpression$2 = function($0, $1) { 5777 NodeListener.prototype.handleConditionalExpression$2 = function($0, $1) {
5778 return this.handleConditionalExpression(($0 && $0.is$scanner_Token()), ($1 && $1.is$scanner_Token())); 5778 return this.handleConditionalExpression(($0 && $0.is$Token()), ($1 && $1.is$To ken()));
5779 }; 5779 };
5780 NodeListener.prototype.handleFinalKeyword$1 = function($0) { 5780 NodeListener.prototype.handleFinalKeyword$1 = function($0) {
5781 return this.handleFinalKeyword(($0 && $0.is$scanner_Token())); 5781 return this.handleFinalKeyword(($0 && $0.is$Token()));
5782 }; 5782 };
5783 NodeListener.prototype.handleLiteralBool$1 = function($0) { 5783 NodeListener.prototype.handleLiteralBool$1 = function($0) {
5784 return this.handleLiteralBool(($0 && $0.is$scanner_Token())); 5784 return this.handleLiteralBool(($0 && $0.is$Token()));
5785 }; 5785 };
5786 NodeListener.prototype.handleLiteralDouble$1 = function($0) { 5786 NodeListener.prototype.handleLiteralDouble$1 = function($0) {
5787 return this.handleLiteralDouble(($0 && $0.is$scanner_Token())); 5787 return this.handleLiteralDouble(($0 && $0.is$Token()));
5788 }; 5788 };
5789 NodeListener.prototype.handleLiteralInt$1 = function($0) { 5789 NodeListener.prototype.handleLiteralInt$1 = function($0) {
5790 return this.handleLiteralInt(($0 && $0.is$scanner_Token())); 5790 return this.handleLiteralInt(($0 && $0.is$Token()));
5791 }; 5791 };
5792 NodeListener.prototype.handleLiteralString$1 = function($0) { 5792 NodeListener.prototype.handleLiteralString$1 = function($0) {
5793 return this.handleLiteralString(($0 && $0.is$scanner_Token())); 5793 return this.handleLiteralString(($0 && $0.is$Token()));
5794 }; 5794 };
5795 NodeListener.prototype.handleNoArguments$1 = function($0) { 5795 NodeListener.prototype.handleNoArguments$1 = function($0) {
5796 return this.handleNoArguments(($0 && $0.is$scanner_Token())); 5796 return this.handleNoArguments(($0 && $0.is$Token()));
5797 }; 5797 };
5798 NodeListener.prototype.handleUnaryPostfixExpression$1 = function($0) { 5798 NodeListener.prototype.handleUnaryPostfixExpression$1 = function($0) {
5799 return this.handleUnaryPostfixExpression(($0 && $0.is$scanner_Token())); 5799 return this.handleUnaryPostfixExpression(($0 && $0.is$Token()));
5800 }; 5800 };
5801 NodeListener.prototype.handleUnaryPrefixExpression$1 = function($0) { 5801 NodeListener.prototype.handleUnaryPrefixExpression$1 = function($0) {
5802 return this.handleUnaryPrefixExpression(($0 && $0.is$scanner_Token())); 5802 return this.handleUnaryPrefixExpression(($0 && $0.is$Token()));
5803 }; 5803 };
5804 NodeListener.prototype.handleVarKeyword$1 = function($0) { 5804 NodeListener.prototype.handleVarKeyword$1 = function($0) {
5805 return this.handleVarKeyword(($0 && $0.is$scanner_Token())); 5805 return this.handleVarKeyword(($0 && $0.is$Token()));
5806 }; 5806 };
5807 NodeListener.prototype.handleVoidKeyword$1 = function($0) { 5807 NodeListener.prototype.handleVoidKeyword$1 = function($0) {
5808 return this.handleVoidKeyword(($0 && $0.is$scanner_Token())); 5808 return this.handleVoidKeyword(($0 && $0.is$Token()));
5809 }; 5809 };
5810 // ********** Code for PartialFunctionElement ************** 5810 // ********** Code for PartialFunctionElement **************
5811 function PartialFunctionElement(name, beginToken, endToken) { 5811 function PartialFunctionElement(name, beginToken, endToken) {
5812 this.beginToken = beginToken; 5812 this.beginToken = beginToken;
5813 this.endToken = endToken; 5813 this.endToken = endToken;
5814 // Initializers done 5814 // Initializers done
5815 FunctionElement.call(this, name); 5815 FunctionElement.call(this, name);
5816 } 5816 }
5817 $inherits(PartialFunctionElement, FunctionElement); 5817 $inherits(PartialFunctionElement, FunctionElement);
5818 PartialFunctionElement.prototype.parseNode = function(canceler, logger) { 5818 PartialFunctionElement.prototype.parseNode = function(canceler, logger) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
5897 } 5897 }
5898 SubstringWrapper.prototype.hashCode$0 = function() { 5898 SubstringWrapper.prototype.hashCode$0 = function() {
5899 return this.hashCode(); 5899 return this.hashCode();
5900 }; 5900 };
5901 SubstringWrapper.prototype.printOn$1 = function($0) { 5901 SubstringWrapper.prototype.printOn$1 = function($0) {
5902 return this.printOn(($0 && $0.is$StringBuffer())); 5902 return this.printOn(($0 && $0.is$StringBuffer()));
5903 }; 5903 };
5904 SubstringWrapper.prototype.toString$0 = function() { 5904 SubstringWrapper.prototype.toString$0 = function() {
5905 return this.toString(); 5905 return this.toString();
5906 }; 5906 };
5907 // ********** Code for scanner_Token ************** 5907 // ********** Code for Token **************
5908 function scanner_Token(kind, charOffset) { 5908 function Token(kind, charOffset) {
5909 this.kind = kind; 5909 this.kind = kind;
5910 this.charOffset = charOffset; 5910 this.charOffset = charOffset;
5911 // Initializers done 5911 // Initializers done
5912 } 5912 }
5913 scanner_Token.prototype.is$scanner_Token = function(){return this;}; 5913 Token.prototype.is$Token = function(){return this;};
5914 scanner_Token.prototype.get$charOffset = function() { return this.charOffset; }; 5914 Token.prototype.get$charOffset = function() { return this.charOffset; };
5915 scanner_Token.prototype.get$value = function() { 5915 Token.prototype.get$value = function() {
5916 return const$112/*const SourceString('EOF')*/; 5916 return const$112/*const SourceString('EOF')*/;
5917 } 5917 }
5918 scanner_Token.prototype.get$stringValue = function() { 5918 Token.prototype.get$stringValue = function() {
5919 return 'EOF'; 5919 return 'EOF';
5920 } 5920 }
5921 scanner_Token.prototype.toString = function() { 5921 Token.prototype.toString = function() {
5922 return Strings.String$fromCharCodes$factory([this.kind]); 5922 return Strings.String$fromCharCodes$factory([this.kind]);
5923 } 5923 }
5924 scanner_Token.prototype.next$0 = function() { 5924 Token.prototype.next$0 = function() {
5925 return this.next(); 5925 return this.next();
5926 }; 5926 };
5927 scanner_Token.prototype.toString$0 = function() { 5927 Token.prototype.toString$0 = function() {
5928 return this.toString(); 5928 return this.toString();
5929 }; 5929 };
5930 // ********** Code for KeywordToken ************** 5930 // ********** Code for KeywordToken **************
5931 function KeywordToken(value, charOffset) { 5931 function KeywordToken(value, charOffset) {
5932 this.value = value; 5932 this.value = value;
5933 // Initializers done 5933 // Initializers done
5934 scanner_Token.call(this, 107/*null.KEYWORD_TOKEN*/, charOffset); 5934 Token.call(this, 107/*null.KEYWORD_TOKEN*/, charOffset);
5935 } 5935 }
5936 $inherits(KeywordToken, scanner_Token); 5936 $inherits(KeywordToken, Token);
5937 KeywordToken.prototype.get$value = function() { return this.value; }; 5937 KeywordToken.prototype.get$value = function() { return this.value; };
5938 KeywordToken.prototype.get$stringValue = function() { 5938 KeywordToken.prototype.get$stringValue = function() {
5939 return this.value.syntax; 5939 return this.value.syntax;
5940 } 5940 }
5941 KeywordToken.prototype.toString = function() { 5941 KeywordToken.prototype.toString = function() {
5942 return this.value.syntax; 5942 return this.value.syntax;
5943 } 5943 }
5944 KeywordToken.prototype.toString$0 = function() { 5944 KeywordToken.prototype.toString$0 = function() {
5945 return this.toString(); 5945 return this.toString();
5946 }; 5946 };
5947 // ********** Code for StringToken ************** 5947 // ********** Code for StringToken **************
5948 function StringToken(kind, value, charOffset) { 5948 function StringToken(kind, value, charOffset) {
5949 // Initializers done 5949 // Initializers done
5950 StringToken.fromSource$ctor.call(this, kind, new StringWrapper(value), charOff set); 5950 StringToken.fromSource$ctor.call(this, kind, new StringWrapper(value), charOff set);
5951 } 5951 }
5952 StringToken.fromSource$ctor = function(kind, value, charOffset) { 5952 StringToken.fromSource$ctor = function(kind, value, charOffset) {
5953 this.value = value; 5953 this.value = value;
5954 // Initializers done 5954 // Initializers done
5955 scanner_Token.call(this, kind, charOffset); 5955 Token.call(this, kind, charOffset);
5956 } 5956 }
5957 StringToken.fromSource$ctor.prototype = StringToken.prototype; 5957 StringToken.fromSource$ctor.prototype = StringToken.prototype;
5958 $inherits(StringToken, scanner_Token); 5958 $inherits(StringToken, Token);
5959 StringToken.prototype.get$value = function() { return this.value; }; 5959 StringToken.prototype.get$value = function() { return this.value; };
5960 StringToken.prototype.get$stringValue = function() { 5960 StringToken.prototype.get$stringValue = function() {
5961 return this.value.get$stringValue(); 5961 return this.value.get$stringValue();
5962 } 5962 }
5963 StringToken.prototype.toString = function() { 5963 StringToken.prototype.toString = function() {
5964 return this.value.toString(); 5964 return this.value.toString();
5965 } 5965 }
5966 StringToken.prototype.toString$0 = function() { 5966 StringToken.prototype.toString$0 = function() {
5967 return this.toString(); 5967 return this.toString();
5968 }; 5968 };
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
6145 } 6145 }
6146 LeafKeywordState.prototype.toString = function() { 6146 LeafKeywordState.prototype.toString = function() {
6147 return this.keyword.syntax; 6147 return this.keyword.syntax;
6148 } 6148 }
6149 LeafKeywordState.prototype.toString$0 = function() { 6149 LeafKeywordState.prototype.toString$0 = function() {
6150 return this.toString(); 6150 return this.toString();
6151 }; 6151 };
6152 // ********** Code for top level ************** 6152 // ********** Code for top level **************
6153 function parse(canceler, logger, doParse) { 6153 function parse(canceler, logger, doParse) {
6154 var listener = new NodeListener(canceler, logger); 6154 var listener = new NodeListener(canceler, logger);
6155 doParse(new scanner_Parser(listener)); 6155 doParse(new Parser(listener));
6156 var node = listener.popNode(); 6156 var node = listener.popNode();
6157 logger.log(("parsed: " + node + "")); 6157 logger.log(("parsed: " + node + ""));
6158 return node; 6158 return node;
6159 } 6159 }
6160 // ********** Library tree ************** 6160 // ********** Library tree **************
6161 // ********** Code for tree_Node ************** 6161 // ********** Code for Node **************
6162 function tree_Node() { 6162 function Node() {
6163 this._hashCode = (Math.random() * 0xFFFFFFFF).toInt(); 6163 this._hashCode = (Math.random() * 0xFFFFFFFF).toInt();
6164 // Initializers done 6164 // Initializers done
6165 } 6165 }
6166 tree_Node.prototype.is$tree_Node = function(){return this;}; 6166 Node.prototype.is$Node = function(){return this;};
6167 tree_Node.prototype.hashCode = function() { 6167 Node.prototype.hashCode = function() {
6168 return this._hashCode; 6168 return this._hashCode;
6169 } 6169 }
6170 tree_Node.prototype.toString = function() { 6170 Node.prototype.toString = function() {
6171 return this.unparse(); 6171 return this.unparse();
6172 } 6172 }
6173 tree_Node.prototype.getObjectDescription = function() { 6173 Node.prototype.getObjectDescription = function() {
6174 return Object.prototype.toString.call(this); 6174 return Object.prototype.toString.call(this);
6175 } 6175 }
6176 tree_Node.prototype.unparse = function() { 6176 Node.prototype.unparse = function() {
6177 var unparser = new Unparser(false); 6177 var unparser = new Unparser(false);
6178 try { 6178 try {
6179 return unparser.unparse(this); 6179 return unparser.unparse(this);
6180 } catch (e) { 6180 } catch (e) {
6181 e = $toDartException(e); 6181 e = $toDartException(e);
6182 return ('<<unparse error: ' + this.getObjectDescription() + ': ' + unparser. sb + '>>'); 6182 return ('<<unparse error: ' + this.getObjectDescription() + ': ' + unparser. sb + '>>');
6183 } 6183 }
6184 } 6184 }
6185 tree_Node.prototype.accept$1 = function($0) { 6185 Node.prototype.accept$1 = function($0) {
6186 return this.accept(($0 && $0.is$Visitor())); 6186 return this.accept(($0 && $0.is$Visitor()));
6187 }; 6187 };
6188 tree_Node.prototype.getBeginToken$0 = function() { 6188 Node.prototype.getBeginToken$0 = function() {
6189 return this.getBeginToken(); 6189 return this.getBeginToken();
6190 }; 6190 };
6191 tree_Node.prototype.getEndToken$0 = function() { 6191 Node.prototype.getEndToken$0 = function() {
6192 return this.getEndToken(); 6192 return this.getEndToken();
6193 }; 6193 };
6194 tree_Node.prototype.hashCode$0 = function() { 6194 Node.prototype.hashCode$0 = function() {
6195 return this.hashCode(); 6195 return this.hashCode();
6196 }; 6196 };
6197 tree_Node.prototype.toString$0 = function() { 6197 Node.prototype.toString$0 = function() {
6198 return this.toString(); 6198 return this.toString();
6199 }; 6199 };
6200 // ********** Code for ClassNode ************** 6200 // ********** Code for ClassNode **************
6201 function ClassNode(name, superclass, interfaces, beginToken, extendsKeyword, end Token) { 6201 function ClassNode(name, superclass, interfaces, beginToken, extendsKeyword, end Token) {
6202 this.name = name; 6202 this.name = name;
6203 this.superclass = superclass; 6203 this.superclass = superclass;
6204 this.interfaces = interfaces; 6204 this.interfaces = interfaces;
6205 this.beginToken = beginToken; 6205 this.beginToken = beginToken;
6206 this.extendsKeyword = extendsKeyword; 6206 this.extendsKeyword = extendsKeyword;
6207 this.endToken = endToken; 6207 this.endToken = endToken;
6208 // Initializers done 6208 // Initializers done
6209 tree_Node.call(this); 6209 Node.call(this);
6210 } 6210 }
6211 $inherits(ClassNode, tree_Node); 6211 $inherits(ClassNode, Node);
6212 ClassNode.prototype.is$ClassNode = function(){return this;}; 6212 ClassNode.prototype.is$ClassNode = function(){return this;};
6213 ClassNode.prototype.get$name = function() { return this.name; }; 6213 ClassNode.prototype.get$name = function() { return this.name; };
6214 ClassNode.prototype.get$interfaces = function() { return this.interfaces; }; 6214 ClassNode.prototype.get$interfaces = function() { return this.interfaces; };
6215 ClassNode.prototype.accept = function(visitor) { 6215 ClassNode.prototype.accept = function(visitor) {
6216 return visitor.visitClassNode(this); 6216 return visitor.visitClassNode(this);
6217 } 6217 }
6218 ClassNode.prototype.get$isInterface = function() { 6218 ClassNode.prototype.get$isInterface = function() {
6219 return this.beginToken.get$stringValue() === 'interface'; 6219 return this.beginToken.get$stringValue() === 'interface';
6220 } 6220 }
6221 ClassNode.prototype.get$isClass = function() { 6221 ClassNode.prototype.get$isClass = function() {
6222 return !$notnull_bool(this.get$isInterface()); 6222 return !$notnull_bool(this.get$isInterface());
6223 } 6223 }
6224 ClassNode.prototype.getBeginToken = function() { 6224 ClassNode.prototype.getBeginToken = function() {
6225 return this.beginToken; 6225 return this.beginToken;
6226 } 6226 }
6227 ClassNode.prototype.getEndToken = function() { 6227 ClassNode.prototype.getEndToken = function() {
6228 return this.endToken; 6228 return this.endToken;
6229 } 6229 }
6230 ClassNode.prototype.accept$1 = function($0) { 6230 ClassNode.prototype.accept$1 = function($0) {
6231 return this.accept(($0 && $0.is$Visitor())); 6231 return this.accept(($0 && $0.is$Visitor()));
6232 }; 6232 };
6233 ClassNode.prototype.getBeginToken$0 = function() { 6233 ClassNode.prototype.getBeginToken$0 = function() {
6234 return this.getBeginToken(); 6234 return this.getBeginToken();
6235 }; 6235 };
6236 ClassNode.prototype.getEndToken$0 = function() { 6236 ClassNode.prototype.getEndToken$0 = function() {
6237 return this.getEndToken(); 6237 return this.getEndToken();
6238 }; 6238 };
6239 // ********** Code for tree_Expression ************** 6239 // ********** Code for Expression **************
6240 function tree_Expression() { 6240 function Expression() {
6241 // Initializers done 6241 // Initializers done
6242 tree_Node.call(this); 6242 Node.call(this);
6243 } 6243 }
6244 $inherits(tree_Expression, tree_Node); 6244 $inherits(Expression, Node);
6245 tree_Expression.prototype.is$tree_Expression = function(){return this;}; 6245 Expression.prototype.is$Expression = function(){return this;};
6246 // ********** Code for tree_Statement ************** 6246 // ********** Code for Statement **************
6247 function tree_Statement() { 6247 function Statement() {
6248 // Initializers done 6248 // Initializers done
6249 tree_Node.call(this); 6249 Node.call(this);
6250 } 6250 }
6251 $inherits(tree_Statement, tree_Node); 6251 $inherits(Statement, Node);
6252 tree_Statement.prototype.is$tree_Statement = function(){return this;}; 6252 Statement.prototype.is$Statement = function(){return this;};
6253 // ********** Code for Send ************** 6253 // ********** Code for Send **************
6254 function Send(receiver, selector, argumentsNode) { 6254 function Send(receiver, selector, argumentsNode) {
6255 this.receiver = receiver; 6255 this.receiver = receiver;
6256 this.selector = selector; 6256 this.selector = selector;
6257 this.argumentsNode = argumentsNode; 6257 this.argumentsNode = argumentsNode;
6258 // Initializers done 6258 // Initializers done
6259 tree_Expression.call(this); 6259 Expression.call(this);
6260 } 6260 }
6261 Send.postfix$ctor = function(receiver, selector) { 6261 Send.postfix$ctor = function(receiver, selector) {
6262 this.receiver = receiver; 6262 this.receiver = receiver;
6263 this.selector = selector; 6263 this.selector = selector;
6264 this.argumentsNode = const$211/*const Postfix()*/; 6264 this.argumentsNode = const$211/*const Postfix()*/;
6265 // Initializers done 6265 // Initializers done
6266 tree_Expression.call(this); 6266 Expression.call(this);
6267 } 6267 }
6268 Send.postfix$ctor.prototype = Send.prototype; 6268 Send.postfix$ctor.prototype = Send.prototype;
6269 Send.prefix$ctor = function(receiver, selector) { 6269 Send.prefix$ctor = function(receiver, selector) {
6270 this.receiver = receiver; 6270 this.receiver = receiver;
6271 this.selector = selector; 6271 this.selector = selector;
6272 this.argumentsNode = const$210/*const Prefix()*/; 6272 this.argumentsNode = const$210/*const Prefix()*/;
6273 // Initializers done 6273 // Initializers done
6274 tree_Expression.call(this); 6274 Expression.call(this);
6275 } 6275 }
6276 Send.prefix$ctor.prototype = Send.prototype; 6276 Send.prefix$ctor.prototype = Send.prototype;
6277 $inherits(Send, tree_Expression); 6277 $inherits(Send, Expression);
6278 Send.prototype.is$Send = function(){return this;}; 6278 Send.prototype.is$Send = function(){return this;};
6279 Send.prototype.get$arguments = function() { 6279 Send.prototype.get$arguments = function() {
6280 return this.argumentsNode.nodes; 6280 return this.argumentsNode.nodes;
6281 } 6281 }
6282 Send.prototype.accept = function(visitor) { 6282 Send.prototype.accept = function(visitor) {
6283 return visitor.visitSend(this); 6283 return visitor.visitSend(this);
6284 } 6284 }
6285 Send.prototype.get$isOperator = function() { 6285 Send.prototype.get$isOperator = function() {
6286 return (this.selector instanceof Operator); 6286 return (this.selector instanceof Operator);
6287 } 6287 }
6288 Send.prototype.get$isPropertyAccess = function() { 6288 Send.prototype.get$isPropertyAccess = function() {
6289 return this.argumentsNode == null; 6289 return this.argumentsNode == null;
6290 } 6290 }
6291 Send.prototype.get$isFunctionObjectInvocation = function() { 6291 Send.prototype.get$isFunctionObjectInvocation = function() {
6292 return this.selector == null; 6292 return this.selector == null;
6293 } 6293 }
6294 Send.prototype.get$isPrefix = function() { 6294 Send.prototype.get$isPrefix = function() {
6295 return (this.argumentsNode instanceof Prefix); 6295 return (this.argumentsNode instanceof Prefix);
6296 } 6296 }
6297 Send.prototype.getBeginToken = function() { 6297 Send.prototype.getBeginToken = function() {
6298 return firstBeginToken(this.receiver, this.selector); 6298 return firstBeginToken(this.receiver, this.selector);
6299 } 6299 }
6300 Send.prototype.getEndToken = function() { 6300 Send.prototype.getEndToken = function() {
6301 var $0; 6301 var $0;
6302 var token; 6302 var token;
6303 if (this.argumentsNode != null) token = this.argumentsNode.getEndToken(); 6303 if (this.argumentsNode != null) token = this.argumentsNode.getEndToken();
6304 if (token != null) return token; 6304 if (token != null) return token;
6305 if (this.selector != null) { 6305 if (this.selector != null) {
6306 return (($0 = this.selector.getEndToken()) && $0.is$scanner_Token()); 6306 return (($0 = this.selector.getEndToken()) && $0.is$Token());
6307 } 6307 }
6308 return (($0 = this.receiver.getBeginToken()) && $0.is$scanner_Token()); 6308 return (($0 = this.receiver.getBeginToken()) && $0.is$Token());
6309 } 6309 }
6310 Send.prototype.accept$1 = function($0) { 6310 Send.prototype.accept$1 = function($0) {
6311 return this.accept(($0 && $0.is$Visitor())); 6311 return this.accept(($0 && $0.is$Visitor()));
6312 }; 6312 };
6313 Send.prototype.getBeginToken$0 = function() { 6313 Send.prototype.getBeginToken$0 = function() {
6314 return this.getBeginToken(); 6314 return this.getBeginToken();
6315 }; 6315 };
6316 Send.prototype.getEndToken$0 = function() { 6316 Send.prototype.getEndToken$0 = function() {
6317 return this.getEndToken(); 6317 return this.getEndToken();
6318 }; 6318 };
(...skipping 23 matching lines...) Expand all
6342 SendSet.prototype.accept$1 = function($0) { 6342 SendSet.prototype.accept$1 = function($0) {
6343 return this.accept(($0 && $0.is$Visitor())); 6343 return this.accept(($0 && $0.is$Visitor()));
6344 }; 6344 };
6345 // ********** Code for NodeList ************** 6345 // ********** Code for NodeList **************
6346 function NodeList(beginToken, nodes, endToken, delimiter) { 6346 function NodeList(beginToken, nodes, endToken, delimiter) {
6347 this.beginToken = beginToken; 6347 this.beginToken = beginToken;
6348 this.nodes = nodes; 6348 this.nodes = nodes;
6349 this.endToken = endToken; 6349 this.endToken = endToken;
6350 this.delimiter = delimiter; 6350 this.delimiter = delimiter;
6351 // Initializers done 6351 // Initializers done
6352 tree_Node.call(this); 6352 Node.call(this);
6353 } 6353 }
6354 NodeList.singleton$ctor = function(node) { 6354 NodeList.singleton$ctor = function(node) {
6355 // Initializers done 6355 // Initializers done
6356 NodeList.call(this, null, LinkFactory.Link$factory(node)); 6356 NodeList.call(this, null, LinkFactory.Link$factory(node));
6357 } 6357 }
6358 NodeList.singleton$ctor.prototype = NodeList.prototype; 6358 NodeList.singleton$ctor.prototype = NodeList.prototype;
6359 $inherits(NodeList, tree_Node); 6359 $inherits(NodeList, Node);
6360 NodeList.prototype.is$NodeList = function(){return this;}; 6360 NodeList.prototype.is$NodeList = function(){return this;};
6361 NodeList.prototype.accept = function(visitor) { 6361 NodeList.prototype.accept = function(visitor) {
6362 return visitor.visitNodeList(this); 6362 return visitor.visitNodeList(this);
6363 } 6363 }
6364 NodeList.prototype.getBeginToken = function() { 6364 NodeList.prototype.getBeginToken = function() {
6365 var $0; 6365 var $0;
6366 if (this.beginToken != null) return this.beginToken; 6366 if (this.beginToken != null) return this.beginToken;
6367 if (this.nodes != null) { 6367 if (this.nodes != null) {
6368 for (var link = this.nodes; 6368 for (var link = this.nodes;
6369 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Lin k$Node())) { 6369 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Lin k$Node())) {
6370 if (link.get$head().getBeginToken$0() != null) { 6370 if (link.get$head().getBeginToken$0() != null) {
6371 return (($0 = link.get$head().getBeginToken$0()) && $0.is$scanner_Token( )); 6371 return (($0 = link.get$head().getBeginToken$0()) && $0.is$Token());
6372 } 6372 }
6373 if (link.get$head().getEndToken$0() != null) { 6373 if (link.get$head().getEndToken$0() != null) {
6374 return (($0 = link.get$head().getEndToken$0()) && $0.is$scanner_Token()) ; 6374 return (($0 = link.get$head().getEndToken$0()) && $0.is$Token());
6375 } 6375 }
6376 } 6376 }
6377 } 6377 }
6378 return this.endToken; 6378 return this.endToken;
6379 } 6379 }
6380 NodeList.prototype.getEndToken = function() { 6380 NodeList.prototype.getEndToken = function() {
6381 var $0; 6381 var $0;
6382 if (this.endToken != null) return this.endToken; 6382 if (this.endToken != null) return this.endToken;
6383 if (this.nodes != null) { 6383 if (this.nodes != null) {
6384 var link = this.nodes; 6384 var link = this.nodes;
6385 while (!$notnull_bool(link.get$tail().isEmpty$0())) link = (($0 = link.get$t ail()) && $0.is$Link$Node()); 6385 while (!$notnull_bool(link.get$tail().isEmpty$0())) link = (($0 = link.get$t ail()) && $0.is$Link$Node());
6386 if (link.get$head().getEndToken$0() != null) return (($0 = link.get$head().g etEndToken$0()) && $0.is$scanner_Token()); 6386 if (link.get$head().getEndToken$0() != null) return (($0 = link.get$head().g etEndToken$0()) && $0.is$Token());
6387 if (link.get$head().getBeginToken$0() != null) return (($0 = link.get$head() .getBeginToken$0()) && $0.is$scanner_Token()); 6387 if (link.get$head().getBeginToken$0() != null) return (($0 = link.get$head() .getBeginToken$0()) && $0.is$Token());
6388 } 6388 }
6389 return this.beginToken; 6389 return this.beginToken;
6390 } 6390 }
6391 NodeList.prototype.accept$1 = function($0) { 6391 NodeList.prototype.accept$1 = function($0) {
6392 return this.accept(($0 && $0.is$Visitor())); 6392 return this.accept(($0 && $0.is$Visitor()));
6393 }; 6393 };
6394 NodeList.prototype.getBeginToken$0 = function() { 6394 NodeList.prototype.getBeginToken$0 = function() {
6395 return this.getBeginToken(); 6395 return this.getBeginToken();
6396 }; 6396 };
6397 NodeList.prototype.getEndToken$0 = function() { 6397 NodeList.prototype.getEndToken$0 = function() {
6398 return this.getEndToken(); 6398 return this.getEndToken();
6399 }; 6399 };
6400 // ********** Code for Block ************** 6400 // ********** Code for Block **************
6401 function Block(statements) { 6401 function Block(statements) {
6402 this.statements = statements; 6402 this.statements = statements;
6403 // Initializers done 6403 // Initializers done
6404 tree_Statement.call(this); 6404 Statement.call(this);
6405 } 6405 }
6406 $inherits(Block, tree_Statement); 6406 $inherits(Block, Statement);
6407 Block.prototype.accept = function(visitor) { 6407 Block.prototype.accept = function(visitor) {
6408 return visitor.visitBlock(this); 6408 return visitor.visitBlock(this);
6409 } 6409 }
6410 Block.prototype.getBeginToken = function() { 6410 Block.prototype.getBeginToken = function() {
6411 return this.statements.getBeginToken(); 6411 return this.statements.getBeginToken();
6412 } 6412 }
6413 Block.prototype.getEndToken = function() { 6413 Block.prototype.getEndToken = function() {
6414 return this.statements.getEndToken(); 6414 return this.statements.getEndToken();
6415 } 6415 }
6416 Block.prototype.accept$1 = function($0) { 6416 Block.prototype.accept$1 = function($0) {
6417 return this.accept(($0 && $0.is$Visitor())); 6417 return this.accept(($0 && $0.is$Visitor()));
6418 }; 6418 };
6419 Block.prototype.getBeginToken$0 = function() { 6419 Block.prototype.getBeginToken$0 = function() {
6420 return this.getBeginToken(); 6420 return this.getBeginToken();
6421 }; 6421 };
6422 Block.prototype.getEndToken$0 = function() { 6422 Block.prototype.getEndToken$0 = function() {
6423 return this.getEndToken(); 6423 return this.getEndToken();
6424 }; 6424 };
6425 // ********** Code for If ************** 6425 // ********** Code for If **************
6426 function If(condition, thenPart, elsePart, ifToken, elseToken) { 6426 function If(condition, thenPart, elsePart, ifToken, elseToken) {
6427 this.condition = condition; 6427 this.condition = condition;
6428 this.thenPart = thenPart; 6428 this.thenPart = thenPart;
6429 this.elsePart = elsePart; 6429 this.elsePart = elsePart;
6430 this.ifToken = ifToken; 6430 this.ifToken = ifToken;
6431 this.elseToken = elseToken; 6431 this.elseToken = elseToken;
6432 // Initializers done 6432 // Initializers done
6433 tree_Statement.call(this); 6433 Statement.call(this);
6434 } 6434 }
6435 $inherits(If, tree_Statement); 6435 $inherits(If, Statement);
6436 If.prototype.get$hasElsePart = function() { 6436 If.prototype.get$hasElsePart = function() {
6437 return this.elsePart != null; 6437 return this.elsePart != null;
6438 } 6438 }
6439 If.prototype.accept = function(visitor) { 6439 If.prototype.accept = function(visitor) {
6440 return visitor.visitIf(this); 6440 return visitor.visitIf(this);
6441 } 6441 }
6442 If.prototype.getBeginToken = function() { 6442 If.prototype.getBeginToken = function() {
6443 return this.ifToken; 6443 return this.ifToken;
6444 } 6444 }
6445 If.prototype.getEndToken = function() { 6445 If.prototype.getEndToken = function() {
(...skipping 10 matching lines...) Expand all
6456 return this.getEndToken(); 6456 return this.getEndToken();
6457 }; 6457 };
6458 // ********** Code for For ************** 6458 // ********** Code for For **************
6459 function For(initializer, condition, update, body, forToken) { 6459 function For(initializer, condition, update, body, forToken) {
6460 this.initializer = initializer; 6460 this.initializer = initializer;
6461 this.condition = condition; 6461 this.condition = condition;
6462 this.update = update; 6462 this.update = update;
6463 this.body = body; 6463 this.body = body;
6464 this.forToken = forToken; 6464 this.forToken = forToken;
6465 // Initializers done 6465 // Initializers done
6466 tree_Statement.call(this); 6466 Statement.call(this);
6467 } 6467 }
6468 $inherits(For, tree_Statement); 6468 $inherits(For, Statement);
6469 For.prototype.accept = function(visitor) { 6469 For.prototype.accept = function(visitor) {
6470 return visitor.visitFor(this); 6470 return visitor.visitFor(this);
6471 } 6471 }
6472 For.prototype.getBeginToken = function() { 6472 For.prototype.getBeginToken = function() {
6473 return this.forToken; 6473 return this.forToken;
6474 } 6474 }
6475 For.prototype.getEndToken = function() { 6475 For.prototype.getEndToken = function() {
6476 return this.body.getEndToken(); 6476 return this.body.getEndToken();
6477 } 6477 }
6478 For.prototype.accept$1 = function($0) { 6478 For.prototype.accept$1 = function($0) {
6479 return this.accept(($0 && $0.is$Visitor())); 6479 return this.accept(($0 && $0.is$Visitor()));
6480 }; 6480 };
6481 For.prototype.getBeginToken$0 = function() { 6481 For.prototype.getBeginToken$0 = function() {
6482 return this.getBeginToken(); 6482 return this.getBeginToken();
6483 }; 6483 };
6484 For.prototype.getEndToken$0 = function() { 6484 For.prototype.getEndToken$0 = function() {
6485 return this.getEndToken(); 6485 return this.getEndToken();
6486 }; 6486 };
6487 // ********** Code for FunctionExpression ************** 6487 // ********** Code for FunctionExpression **************
6488 function FunctionExpression(name, parameters, body, returnType) { 6488 function FunctionExpression(name, parameters, body, returnType) {
6489 this.name = name; 6489 this.name = name;
6490 this.parameters = parameters; 6490 this.parameters = parameters;
6491 this.body = body; 6491 this.body = body;
6492 this.returnType = returnType; 6492 this.returnType = returnType;
6493 // Initializers done 6493 // Initializers done
6494 tree_Expression.call(this); 6494 Expression.call(this);
6495 } 6495 }
6496 $inherits(FunctionExpression, tree_Expression); 6496 $inherits(FunctionExpression, Expression);
6497 FunctionExpression.prototype.is$FunctionExpression = function(){return this;}; 6497 FunctionExpression.prototype.is$FunctionExpression = function(){return this;};
6498 FunctionExpression.prototype.get$name = function() { return this.name; }; 6498 FunctionExpression.prototype.get$name = function() { return this.name; };
6499 FunctionExpression.prototype.get$parameters = function() { return this.parameter s; }; 6499 FunctionExpression.prototype.get$parameters = function() { return this.parameter s; };
6500 FunctionExpression.prototype.get$returnType = function() { return this.returnTyp e; }; 6500 FunctionExpression.prototype.get$returnType = function() { return this.returnTyp e; };
6501 FunctionExpression.prototype.accept = function(visitor) { 6501 FunctionExpression.prototype.accept = function(visitor) {
6502 return visitor.visitFunctionExpression(this); 6502 return visitor.visitFunctionExpression(this);
6503 } 6503 }
6504 FunctionExpression.prototype.getBeginToken = function() { 6504 FunctionExpression.prototype.getBeginToken = function() {
6505 return firstBeginToken(this.returnType, this.name); 6505 return firstBeginToken(this.returnType, this.name);
6506 } 6506 }
6507 FunctionExpression.prototype.getEndToken = function() { 6507 FunctionExpression.prototype.getEndToken = function() {
6508 return this.body.getEndToken(); 6508 return this.body.getEndToken();
6509 } 6509 }
6510 FunctionExpression.prototype.accept$1 = function($0) { 6510 FunctionExpression.prototype.accept$1 = function($0) {
6511 return this.accept(($0 && $0.is$Visitor())); 6511 return this.accept(($0 && $0.is$Visitor()));
6512 }; 6512 };
6513 FunctionExpression.prototype.getBeginToken$0 = function() { 6513 FunctionExpression.prototype.getBeginToken$0 = function() {
6514 return this.getBeginToken(); 6514 return this.getBeginToken();
6515 }; 6515 };
6516 FunctionExpression.prototype.getEndToken$0 = function() { 6516 FunctionExpression.prototype.getEndToken$0 = function() {
6517 return this.getEndToken(); 6517 return this.getEndToken();
6518 }; 6518 };
6519 // ********** Code for Literal ************** 6519 // ********** Code for Literal **************
6520 function Literal(token, handler) { 6520 function Literal(token, handler) {
6521 this.token = token; 6521 this.token = token;
6522 this.handler = handler; 6522 this.handler = handler;
6523 // Initializers done 6523 // Initializers done
6524 tree_Expression.call(this); 6524 Expression.call(this);
6525 } 6525 }
6526 $inherits(Literal, tree_Expression); 6526 $inherits(Literal, Expression);
6527 Literal.prototype.getBeginToken = function() { 6527 Literal.prototype.getBeginToken = function() {
6528 return this.token; 6528 return this.token;
6529 } 6529 }
6530 Literal.prototype.getEndToken = function() { 6530 Literal.prototype.getEndToken = function() {
6531 return this.token; 6531 return this.token;
6532 } 6532 }
6533 Literal.prototype.getBeginToken$0 = function() { 6533 Literal.prototype.getBeginToken$0 = function() {
6534 return this.getBeginToken(); 6534 return this.getBeginToken();
6535 }; 6535 };
6536 Literal.prototype.getEndToken$0 = function() { 6536 Literal.prototype.getEndToken$0 = function() {
6537 return this.getEndToken(); 6537 return this.getEndToken();
6538 }; 6538 };
6539 // ********** Code for Literal$SourceString ************** 6539 // ********** Code for Literal$SourceString **************
6540 function Literal$SourceString(token, handler) { 6540 function Literal$SourceString(token, handler) {
6541 this.token = token; 6541 this.token = token;
6542 this.handler = handler; 6542 this.handler = handler;
6543 // Initializers done 6543 // Initializers done
6544 tree_Expression.call(this); 6544 Expression.call(this);
6545 } 6545 }
6546 $inherits(Literal$SourceString, Literal); 6546 $inherits(Literal$SourceString, Literal);
6547 // ********** Code for Literal$bool ************** 6547 // ********** Code for Literal$bool **************
6548 function Literal$bool(token, handler) { 6548 function Literal$bool(token, handler) {
6549 this.token = token; 6549 this.token = token;
6550 this.handler = handler; 6550 this.handler = handler;
6551 // Initializers done 6551 // Initializers done
6552 tree_Expression.call(this); 6552 Expression.call(this);
6553 } 6553 }
6554 $inherits(Literal$bool, Literal); 6554 $inherits(Literal$bool, Literal);
6555 // ********** Code for Literal$double ************** 6555 // ********** Code for Literal$double **************
6556 function Literal$double(token, handler) { 6556 function Literal$double(token, handler) {
6557 this.token = token; 6557 this.token = token;
6558 this.handler = handler; 6558 this.handler = handler;
6559 // Initializers done 6559 // Initializers done
6560 tree_Expression.call(this); 6560 Expression.call(this);
6561 } 6561 }
6562 $inherits(Literal$double, Literal); 6562 $inherits(Literal$double, Literal);
6563 // ********** Code for Literal$int ************** 6563 // ********** Code for Literal$int **************
6564 function Literal$int(token, handler) { 6564 function Literal$int(token, handler) {
6565 this.token = token; 6565 this.token = token;
6566 this.handler = handler; 6566 this.handler = handler;
6567 // Initializers done 6567 // Initializers done
6568 tree_Expression.call(this); 6568 Expression.call(this);
6569 } 6569 }
6570 $inherits(Literal$int, Literal); 6570 $inherits(Literal$int, Literal);
6571 // ********** Code for LiteralInt ************** 6571 // ********** Code for LiteralInt **************
6572 function LiteralInt(token, handler) { 6572 function LiteralInt(token, handler) {
6573 // Initializers done 6573 // Initializers done
6574 Literal$int.call(this, token, handler); 6574 Literal$int.call(this, token, handler);
6575 } 6575 }
6576 $inherits(LiteralInt, Literal$int); 6576 $inherits(LiteralInt, Literal$int);
6577 LiteralInt.prototype.get$value = function() { 6577 LiteralInt.prototype.get$value = function() {
6578 try { 6578 try {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
6648 LiteralString.prototype.get$value = function() { 6648 LiteralString.prototype.get$value = function() {
6649 var $0; 6649 var $0;
6650 return (($0 = this.token.get$value()) && $0.is$SourceString()); 6650 return (($0 = this.token.get$value()) && $0.is$SourceString());
6651 } 6651 }
6652 LiteralString.prototype.accept = function(visitor) { 6652 LiteralString.prototype.accept = function(visitor) {
6653 return visitor.visitLiteralString(this); 6653 return visitor.visitLiteralString(this);
6654 } 6654 }
6655 LiteralString.prototype.accept$1 = function($0) { 6655 LiteralString.prototype.accept$1 = function($0) {
6656 return this.accept(($0 && $0.is$Visitor())); 6656 return this.accept(($0 && $0.is$Visitor()));
6657 }; 6657 };
6658 // ********** Code for tree_Identifier ************** 6658 // ********** Code for Identifier **************
6659 function tree_Identifier(token) { 6659 function Identifier(token) {
6660 this.token = token; 6660 this.token = token;
6661 // Initializers done 6661 // Initializers done
6662 tree_Expression.call(this); 6662 Expression.call(this);
6663 } 6663 }
6664 $inherits(tree_Identifier, tree_Expression); 6664 $inherits(Identifier, Expression);
6665 tree_Identifier.prototype.is$tree_Identifier = function(){return this;}; 6665 Identifier.prototype.is$Identifier = function(){return this;};
6666 tree_Identifier.prototype.get$source = function() { 6666 Identifier.prototype.get$source = function() {
6667 var $0; 6667 var $0;
6668 return (($0 = this.token.get$value()) && $0.is$SourceString()); 6668 return (($0 = this.token.get$value()) && $0.is$SourceString());
6669 } 6669 }
6670 tree_Identifier.prototype.accept = function(visitor) { 6670 Identifier.prototype.accept = function(visitor) {
6671 return visitor.visitIdentifier(this); 6671 return visitor.visitIdentifier(this);
6672 } 6672 }
6673 tree_Identifier.prototype.getBeginToken = function() { 6673 Identifier.prototype.getBeginToken = function() {
6674 return this.token; 6674 return this.token;
6675 } 6675 }
6676 tree_Identifier.prototype.getEndToken = function() { 6676 Identifier.prototype.getEndToken = function() {
6677 return this.token; 6677 return this.token;
6678 } 6678 }
6679 tree_Identifier.prototype.accept$1 = function($0) { 6679 Identifier.prototype.accept$1 = function($0) {
6680 return this.accept(($0 && $0.is$Visitor())); 6680 return this.accept(($0 && $0.is$Visitor()));
6681 }; 6681 };
6682 tree_Identifier.prototype.getBeginToken$0 = function() { 6682 Identifier.prototype.getBeginToken$0 = function() {
6683 return this.getBeginToken(); 6683 return this.getBeginToken();
6684 }; 6684 };
6685 tree_Identifier.prototype.getEndToken$0 = function() { 6685 Identifier.prototype.getEndToken$0 = function() {
6686 return this.getEndToken(); 6686 return this.getEndToken();
6687 }; 6687 };
6688 // ********** Code for Operator ************** 6688 // ********** Code for Operator **************
6689 function Operator(token) { 6689 function Operator(token) {
6690 // Initializers done 6690 // Initializers done
6691 tree_Identifier.call(this, token); 6691 Identifier.call(this, token);
6692 } 6692 }
6693 $inherits(Operator, tree_Identifier); 6693 $inherits(Operator, Identifier);
6694 Operator.prototype.is$Operator = function(){return this;}; 6694 Operator.prototype.is$Operator = function(){return this;};
6695 Operator.prototype.accept = function(visitor) { 6695 Operator.prototype.accept = function(visitor) {
6696 return visitor.visitOperator(this); 6696 return visitor.visitOperator(this);
6697 } 6697 }
6698 Operator.prototype.accept$1 = function($0) { 6698 Operator.prototype.accept$1 = function($0) {
6699 return this.accept(($0 && $0.is$Visitor())); 6699 return this.accept(($0 && $0.is$Visitor()));
6700 }; 6700 };
6701 // ********** Code for Return ************** 6701 // ********** Code for Return **************
6702 function Return(beginToken, endToken, expression) { 6702 function Return(beginToken, endToken, expression) {
6703 this.beginToken = beginToken; 6703 this.beginToken = beginToken;
6704 this.endToken = endToken; 6704 this.endToken = endToken;
6705 this.expression = expression; 6705 this.expression = expression;
6706 // Initializers done 6706 // Initializers done
6707 tree_Statement.call(this); 6707 Statement.call(this);
6708 } 6708 }
6709 $inherits(Return, tree_Statement); 6709 $inherits(Return, Statement);
6710 Return.prototype.get$hasExpression = function() { 6710 Return.prototype.get$hasExpression = function() {
6711 return this.expression != null; 6711 return this.expression != null;
6712 } 6712 }
6713 Return.prototype.accept = function(visitor) { 6713 Return.prototype.accept = function(visitor) {
6714 return visitor.visitReturn(this); 6714 return visitor.visitReturn(this);
6715 } 6715 }
6716 Return.prototype.getBeginToken = function() { 6716 Return.prototype.getBeginToken = function() {
6717 return this.beginToken; 6717 return this.beginToken;
6718 } 6718 }
6719 Return.prototype.getEndToken = function() { 6719 Return.prototype.getEndToken = function() {
6720 return this.endToken; 6720 return this.endToken;
6721 } 6721 }
6722 Return.prototype.accept$1 = function($0) { 6722 Return.prototype.accept$1 = function($0) {
6723 return this.accept(($0 && $0.is$Visitor())); 6723 return this.accept(($0 && $0.is$Visitor()));
6724 }; 6724 };
6725 Return.prototype.getBeginToken$0 = function() { 6725 Return.prototype.getBeginToken$0 = function() {
6726 return this.getBeginToken(); 6726 return this.getBeginToken();
6727 }; 6727 };
6728 Return.prototype.getEndToken$0 = function() { 6728 Return.prototype.getEndToken$0 = function() {
6729 return this.getEndToken(); 6729 return this.getEndToken();
6730 }; 6730 };
6731 // ********** Code for tree_ExpressionStatement ************** 6731 // ********** Code for ExpressionStatement **************
6732 function tree_ExpressionStatement(expression, endToken) { 6732 function ExpressionStatement(expression, endToken) {
6733 this.expression = expression; 6733 this.expression = expression;
6734 this.endToken = endToken; 6734 this.endToken = endToken;
6735 // Initializers done 6735 // Initializers done
6736 tree_Statement.call(this); 6736 Statement.call(this);
6737 } 6737 }
6738 $inherits(tree_ExpressionStatement, tree_Statement); 6738 $inherits(ExpressionStatement, Statement);
6739 tree_ExpressionStatement.prototype.is$tree_ExpressionStatement = function(){retu rn this;}; 6739 ExpressionStatement.prototype.is$ExpressionStatement = function(){return this;};
6740 tree_ExpressionStatement.prototype.accept = function(visitor) { 6740 ExpressionStatement.prototype.accept = function(visitor) {
6741 return visitor.visitExpressionStatement(this); 6741 return visitor.visitExpressionStatement(this);
6742 } 6742 }
6743 tree_ExpressionStatement.prototype.getBeginToken = function() { 6743 ExpressionStatement.prototype.getBeginToken = function() {
6744 var $0; 6744 var $0;
6745 return (($0 = this.expression.getBeginToken()) && $0.is$scanner_Token()); 6745 return (($0 = this.expression.getBeginToken()) && $0.is$Token());
6746 } 6746 }
6747 tree_ExpressionStatement.prototype.getEndToken = function() { 6747 ExpressionStatement.prototype.getEndToken = function() {
6748 return this.endToken; 6748 return this.endToken;
6749 } 6749 }
6750 tree_ExpressionStatement.prototype.accept$1 = function($0) { 6750 ExpressionStatement.prototype.accept$1 = function($0) {
6751 return this.accept(($0 && $0.is$Visitor())); 6751 return this.accept(($0 && $0.is$Visitor()));
6752 }; 6752 };
6753 tree_ExpressionStatement.prototype.getBeginToken$0 = function() { 6753 ExpressionStatement.prototype.getBeginToken$0 = function() {
6754 return this.getBeginToken(); 6754 return this.getBeginToken();
6755 }; 6755 };
6756 tree_ExpressionStatement.prototype.getEndToken$0 = function() { 6756 ExpressionStatement.prototype.getEndToken$0 = function() {
6757 return this.getEndToken(); 6757 return this.getEndToken();
6758 }; 6758 };
6759 // ********** Code for Throw ************** 6759 // ********** Code for Throw **************
6760 function Throw(expression, throwToken, endToken) { 6760 function Throw(expression, throwToken, endToken) {
6761 this.expression = expression; 6761 this.expression = expression;
6762 this.throwToken = throwToken; 6762 this.throwToken = throwToken;
6763 this.endToken = endToken; 6763 this.endToken = endToken;
6764 // Initializers done 6764 // Initializers done
6765 tree_Statement.call(this); 6765 Statement.call(this);
6766 } 6766 }
6767 $inherits(Throw, tree_Statement); 6767 $inherits(Throw, Statement);
6768 Throw.prototype.accept = function(visitor) { 6768 Throw.prototype.accept = function(visitor) {
6769 return visitor.visitThrow(this); 6769 return visitor.visitThrow(this);
6770 } 6770 }
6771 Throw.prototype.getBeginToken = function() { 6771 Throw.prototype.getBeginToken = function() {
6772 return this.throwToken; 6772 return this.throwToken;
6773 } 6773 }
6774 Throw.prototype.getEndToken = function() { 6774 Throw.prototype.getEndToken = function() {
6775 return this.endToken; 6775 return this.endToken;
6776 } 6776 }
6777 Throw.prototype.accept$1 = function($0) { 6777 Throw.prototype.accept$1 = function($0) {
6778 return this.accept(($0 && $0.is$Visitor())); 6778 return this.accept(($0 && $0.is$Visitor()));
6779 }; 6779 };
6780 Throw.prototype.getBeginToken$0 = function() { 6780 Throw.prototype.getBeginToken$0 = function() {
6781 return this.getBeginToken(); 6781 return this.getBeginToken();
6782 }; 6782 };
6783 Throw.prototype.getEndToken$0 = function() { 6783 Throw.prototype.getEndToken$0 = function() {
6784 return this.getEndToken(); 6784 return this.getEndToken();
6785 }; 6785 };
6786 // ********** Code for TypeAnnotation ************** 6786 // ********** Code for TypeAnnotation **************
6787 function TypeAnnotation(typeName) { 6787 function TypeAnnotation(typeName) {
6788 this.typeName = typeName; 6788 this.typeName = typeName;
6789 // Initializers done 6789 // Initializers done
6790 tree_Node.call(this); 6790 Node.call(this);
6791 } 6791 }
6792 $inherits(TypeAnnotation, tree_Node); 6792 $inherits(TypeAnnotation, Node);
6793 TypeAnnotation.prototype.is$TypeAnnotation = function(){return this;}; 6793 TypeAnnotation.prototype.is$TypeAnnotation = function(){return this;};
6794 TypeAnnotation.prototype.get$typeName = function() { return this.typeName; }; 6794 TypeAnnotation.prototype.get$typeName = function() { return this.typeName; };
6795 TypeAnnotation.prototype.accept = function(visitor) { 6795 TypeAnnotation.prototype.accept = function(visitor) {
6796 return visitor.visitTypeAnnotation(this); 6796 return visitor.visitTypeAnnotation(this);
6797 } 6797 }
6798 TypeAnnotation.prototype.getBeginToken = function() { 6798 TypeAnnotation.prototype.getBeginToken = function() {
6799 var $0; 6799 var $0;
6800 return (($0 = this.typeName.getBeginToken()) && $0.is$scanner_Token()); 6800 return (($0 = this.typeName.getBeginToken()) && $0.is$Token());
6801 } 6801 }
6802 TypeAnnotation.prototype.getEndToken = function() { 6802 TypeAnnotation.prototype.getEndToken = function() {
6803 var $0; 6803 var $0;
6804 return (($0 = this.typeName.getEndToken()) && $0.is$scanner_Token()); 6804 return (($0 = this.typeName.getEndToken()) && $0.is$Token());
6805 } 6805 }
6806 TypeAnnotation.prototype.accept$1 = function($0) { 6806 TypeAnnotation.prototype.accept$1 = function($0) {
6807 return this.accept(($0 && $0.is$Visitor())); 6807 return this.accept(($0 && $0.is$Visitor()));
6808 }; 6808 };
6809 TypeAnnotation.prototype.getBeginToken$0 = function() { 6809 TypeAnnotation.prototype.getBeginToken$0 = function() {
6810 return this.getBeginToken(); 6810 return this.getBeginToken();
6811 }; 6811 };
6812 TypeAnnotation.prototype.getEndToken$0 = function() { 6812 TypeAnnotation.prototype.getEndToken$0 = function() {
6813 return this.getEndToken(); 6813 return this.getEndToken();
6814 }; 6814 };
6815 // ********** Code for VariableDefinitions ************** 6815 // ********** Code for VariableDefinitions **************
6816 function VariableDefinitions(type, modifiers, definitions, endToken) { 6816 function VariableDefinitions(type, modifiers, definitions, endToken) {
6817 this.type = type; 6817 this.type = type;
6818 this.modifiers = modifiers; 6818 this.modifiers = modifiers;
6819 this.definitions = definitions; 6819 this.definitions = definitions;
6820 this.endToken = endToken; 6820 this.endToken = endToken;
6821 // Initializers done 6821 // Initializers done
6822 tree_Statement.call(this); 6822 Statement.call(this);
6823 } 6823 }
6824 $inherits(VariableDefinitions, tree_Statement); 6824 $inherits(VariableDefinitions, Statement);
6825 VariableDefinitions.prototype.is$VariableDefinitions = function(){return this;}; 6825 VariableDefinitions.prototype.is$VariableDefinitions = function(){return this;};
6826 VariableDefinitions.prototype.get$type = function() { return this.type; }; 6826 VariableDefinitions.prototype.get$type = function() { return this.type; };
6827 VariableDefinitions.prototype.accept = function(visitor) { 6827 VariableDefinitions.prototype.accept = function(visitor) {
6828 return visitor.visitVariableDefinitions(this); 6828 return visitor.visitVariableDefinitions(this);
6829 } 6829 }
6830 VariableDefinitions.prototype.getBeginToken = function() { 6830 VariableDefinitions.prototype.getBeginToken = function() {
6831 return firstBeginToken(this.type, this.definitions); 6831 return firstBeginToken(this.type, this.definitions);
6832 } 6832 }
6833 VariableDefinitions.prototype.getEndToken = function() { 6833 VariableDefinitions.prototype.getEndToken = function() {
6834 return this.endToken; 6834 return this.endToken;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
6986 this.sb.add(' '); 6986 this.sb.add(' ');
6987 this.visit(node.definitions); 6987 this.visit(node.definitions);
6988 if ($notnull_bool($eq(node.endToken.get$value(), const$208/*const SourceString (';')*/))) { 6988 if ($notnull_bool($eq(node.endToken.get$value(), const$208/*const SourceString (';')*/))) {
6989 this.add((($0 = node.endToken.get$value()) && $0.is$SourceString())); 6989 this.add((($0 = node.endToken.get$value()) && $0.is$SourceString()));
6990 } 6990 }
6991 } 6991 }
6992 Unparser.prototype.add$1 = function($0) { 6992 Unparser.prototype.add$1 = function($0) {
6993 return this.add(($0 && $0.is$SourceString())); 6993 return this.add(($0 && $0.is$SourceString()));
6994 }; 6994 };
6995 Unparser.prototype.visit$1 = function($0) { 6995 Unparser.prototype.visit$1 = function($0) {
6996 return this.visit(($0 && $0.is$tree_Node())); 6996 return this.visit(($0 && $0.is$Node()));
6997 }; 6997 };
6998 // ********** Code for top level ************** 6998 // ********** Code for top level **************
6999 function firstBeginToken(first, second) { 6999 function firstBeginToken(first, second) {
7000 var $0; 7000 var $0;
7001 return (($0 = (first != null) ? first.getBeginToken() : second.getBeginToken() ) && $0.is$scanner_Token()); 7001 return (($0 = (first != null) ? first.getBeginToken() : second.getBeginToken() ) && $0.is$Token());
7002 } 7002 }
7003 // ********** Library elements ************** 7003 // ********** Library elements **************
7004 // ********** Code for ElementKind ************** 7004 // ********** Code for ElementKind **************
7005 function ElementKind(id) { 7005 function ElementKind(id) {
7006 this.id = id; 7006 this.id = id;
7007 // Initializers done 7007 // Initializers done
7008 } 7008 }
7009 // ********** Code for Element ************** 7009 // ********** Code for Element **************
7010 function Element(name, kind, enclosingElement) { 7010 function Element(name, kind, enclosingElement) {
7011 this.name = name; 7011 this.name = name;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
7104 this.isResolved = true; 7104 this.isResolved = true;
7105 } 7105 }
7106 ClassElement.prototype.computeType$2 = ClassElement.prototype.computeType; 7106 ClassElement.prototype.computeType$2 = ClassElement.prototype.computeType;
7107 ClassElement.prototype.resolve$1 = function($0) { 7107 ClassElement.prototype.resolve$1 = function($0) {
7108 return this.resolve(($0 && $0.is$Compiler())); 7108 return this.resolve(($0 && $0.is$Compiler()));
7109 }; 7109 };
7110 // ********** Code for top level ************** 7110 // ********** Code for top level **************
7111 function getType(annotation, types) { 7111 function getType(annotation, types) {
7112 var $0; 7112 var $0;
7113 if (annotation == null || annotation.typeName == null) { 7113 if (annotation == null || annotation.typeName == null) {
7114 return (($0 = types.dynamicType) && $0.is$leg_Type()); 7114 return (($0 = types.dynamicType) && $0.is$Type());
7115 } 7115 }
7116 return (($0 = types.lookup$1(annotation.typeName.get$source())) && $0.is$leg_T ype()); 7116 return (($0 = types.lookup$1(annotation.typeName.get$source())) && $0.is$Type( ));
7117 } 7117 }
7118 // ********** Library ssa ************** 7118 // ********** Library ssa **************
7119 // ********** Code for SsaBuilderTask ************** 7119 // ********** Code for SsaBuilderTask **************
7120 function SsaBuilderTask(compiler) { 7120 function SsaBuilderTask(compiler) {
7121 // Initializers done 7121 // Initializers done
7122 CompilerTask.call(this, compiler); 7122 CompilerTask.call(this, compiler);
7123 } 7123 }
7124 $inherits(SsaBuilderTask, CompilerTask); 7124 $inherits(SsaBuilderTask, CompilerTask);
7125 SsaBuilderTask.prototype.get$name = function() { 7125 SsaBuilderTask.prototype.get$name = function() {
7126 return 'SSA builder'; 7126 return 'SSA builder';
7127 } 7127 }
7128 SsaBuilderTask.prototype.build = function(tree, elements) { 7128 SsaBuilderTask.prototype.build = function(tree, elements) {
7129 var $this = this; // closure support 7129 var $this = this; // closure support
7130 var $0; 7130 var $0;
7131 return (($0 = this.measure((function () { 7131 return (($0 = this.measure((function () {
7132 var $0; 7132 var $0;
7133 var function_ = (tree && tree.is$FunctionExpression()); 7133 var function_ = (tree && tree.is$FunctionExpression());
7134 var graph = $this.compileMethod(function_.parameters, function_.body, elemen ts); 7134 var graph = $this.compileMethod(function_.parameters, function_.body, elemen ts);
7135 $assert(graph.isValid(), "graph.isValid()", "builder.dart", 14, 14); 7135 $assert(graph.isValid(), "graph.isValid()", "builder.dart", 14, 14);
7136 if (false/*null.GENERATE_SSA_TRACE*/) { 7136 if (false/*null.GENERATE_SSA_TRACE*/) {
7137 var name = (($0 = function_.name) && $0.is$tree_Identifier()); 7137 var name = (($0 = function_.name) && $0.is$Identifier());
7138 HTracer.HTracer$singleton$factory().traceCompilation(name.get$source().toS tring()); 7138 HTracer.HTracer$singleton$factory().traceCompilation(name.get$source().toS tring());
7139 HTracer.HTracer$singleton$factory().traceGraph('builder', graph); 7139 HTracer.HTracer$singleton$factory().traceGraph('builder', graph);
7140 } 7140 }
7141 return graph; 7141 return graph;
7142 }) 7142 })
7143 )) && $0.is$HGraph()); 7143 )) && $0.is$HGraph());
7144 } 7144 }
7145 SsaBuilderTask.prototype.compileMethod = function(parameters, body, elements) { 7145 SsaBuilderTask.prototype.compileMethod = function(parameters, body, elements) {
7146 var builder = new SsaBuilder(this.compiler, elements); 7146 var builder = new SsaBuilder(this.compiler, elements);
7147 var graph = builder.build(parameters, body); 7147 var graph = builder.build(parameters, body);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
7200 if (node != null) node.accept(this); 7200 if (node != null) node.accept(this);
7201 } 7201 }
7202 SsaBuilder.prototype.visitParameters = function(parameters) { 7202 SsaBuilder.prototype.visitParameters = function(parameters) {
7203 var $0; 7203 var $0;
7204 var parameterIndex = 0; 7204 var parameterIndex = 0;
7205 for (var link = parameters.nodes; 7205 for (var link = parameters.nodes;
7206 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) { 7206 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) {
7207 var container = (($0 = link.get$head()) && $0.is$VariableDefinitions()); 7207 var container = (($0 = link.get$head()) && $0.is$VariableDefinitions());
7208 var identifierLink = container.definitions.nodes; 7208 var identifierLink = container.definitions.nodes;
7209 $assert(!$notnull_bool(identifierLink.isEmpty()) && $notnull_bool(identifier Link.get$tail().isEmpty$0()), "!identifierLink.isEmpty() && identifierLink.tail. isEmpty()", "builder.dart", 115, 14); 7209 $assert(!$notnull_bool(identifierLink.isEmpty()) && $notnull_bool(identifier Link.get$tail().isEmpty$0()), "!identifierLink.isEmpty() && identifierLink.tail. isEmpty()", "builder.dart", 115, 14);
7210 if (!(identifierLink.get$head() instanceof tree_Identifier)) { 7210 if (!(identifierLink.get$head() instanceof Identifier)) {
7211 this.compiler.unimplemented("SsaBuilder.visitParameters non-identifier"); 7211 this.compiler.unimplemented("SsaBuilder.visitParameters non-identifier");
7212 } 7212 }
7213 var parameterId = (($0 = identifierLink.get$head()) && $0.is$tree_Identifier ()); 7213 var parameterId = (($0 = identifierLink.get$head()) && $0.is$Identifier());
7214 var element = (($0 = this.elements.$index(parameterId)) && $0.is$Element()); 7214 var element = (($0 = this.elements.$index(parameterId)) && $0.is$Element());
7215 var parameterInstruction = new HParameter(parameterIndex++); 7215 var parameterInstruction = new HParameter(parameterIndex++);
7216 this.definitions.$setindex(element, parameterInstruction); 7216 this.definitions.$setindex(element, parameterInstruction);
7217 this.add(parameterInstruction); 7217 this.add(parameterInstruction);
7218 } 7218 }
7219 } 7219 }
7220 SsaBuilder.prototype.visitBlock = function(node) { 7220 SsaBuilder.prototype.visitBlock = function(node) {
7221 var $0; 7221 var $0;
7222 for (var link = node.statements.nodes; 7222 for (var link = node.statements.nodes;
7223 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) { 7223 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) {
7224 this.visit((($0 = link.get$head()) && $0.is$tree_Node())); 7224 this.visit((($0 = link.get$head()) && $0.is$Node()));
7225 if ($notnull_bool(this.isAborted())) { 7225 if ($notnull_bool(this.isAborted())) {
7226 if (!this.stack.isEmpty()) this.compiler.cancel('non-empty instruction sta ck'); 7226 if (!this.stack.isEmpty()) this.compiler.cancel('non-empty instruction sta ck');
7227 return; 7227 return;
7228 } 7228 }
7229 } 7229 }
7230 $assert(!$notnull_bool(this.current.isClosed()), "!current.isClosed()", "build er.dart", 138, 12); 7230 $assert(!$notnull_bool(this.current.isClosed()), "!current.isClosed()", "build er.dart", 138, 12);
7231 if (!this.stack.isEmpty()) this.compiler.cancel('non-empty instruction stack') ; 7231 if (!this.stack.isEmpty()) this.compiler.cancel('non-empty instruction stack') ;
7232 } 7232 }
7233 SsaBuilder.prototype.visitClassNode = function(node) { 7233 SsaBuilder.prototype.visitClassNode = function(node) {
7234 this.compiler.unimplemented("SsaBuilder.visitClassNode"); 7234 this.compiler.unimplemented("SsaBuilder.visitClassNode");
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
7401 } 7401 }
7402 this.stack.add(this.definitions.$index(element)); 7402 this.stack.add(this.definitions.$index(element));
7403 } 7403 }
7404 else { 7404 else {
7405 var link = node.get$arguments(); 7405 var link = node.get$arguments();
7406 if (element.kind === const$204/*ElementKind.FOREIGN*/) { 7406 if (element.kind === const$204/*ElementKind.FOREIGN*/) {
7407 link = (($0 = link.get$tail()) && $0.is$Link$Node()); 7407 link = (($0 = link.get$tail()) && $0.is$Link$Node());
7408 } 7408 }
7409 var arguments = []; 7409 var arguments = [];
7410 for (; !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0. is$Link$Node())) { 7410 for (; !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0. is$Link$Node())) {
7411 this.visit((($0 = link.get$head()) && $0.is$tree_Node())); 7411 this.visit((($0 = link.get$head()) && $0.is$Node()));
7412 arguments.add$1(this.pop()); 7412 arguments.add$1(this.pop());
7413 } 7413 }
7414 if (element.kind === const$204/*ElementKind.FOREIGN*/) { 7414 if (element.kind === const$204/*ElementKind.FOREIGN*/) {
7415 var literal = (($0 = node.get$arguments().get$head()) && $0.is$LiteralStri ng()); 7415 var literal = (($0 = node.get$arguments().get$head()) && $0.is$LiteralStri ng());
7416 this.compiler.ensure((literal instanceof LiteralString)); 7416 this.compiler.ensure((literal instanceof LiteralString));
7417 this.push(new HInvokeForeign(element, arguments, this.unquote(literal))); 7417 this.push(new HInvokeForeign(element, arguments, this.unquote(literal)));
7418 } 7418 }
7419 else { 7419 else {
7420 var selector = (($0 = node.selector) && $0.is$tree_Identifier()); 7420 var selector = (($0 = node.selector) && $0.is$Identifier());
7421 this.push(new HInvoke(element, arguments)); 7421 this.push(new HInvoke(element, arguments));
7422 } 7422 }
7423 } 7423 }
7424 } 7424 }
7425 SsaBuilder.prototype.visitSendSet = function(node) { 7425 SsaBuilder.prototype.visitSendSet = function(node) {
7426 this.stack.add(this.updateDefinition(node)); 7426 this.stack.add(this.updateDefinition(node));
7427 } 7427 }
7428 SsaBuilder.prototype.visitLiteralInt = function(node) { 7428 SsaBuilder.prototype.visitLiteralInt = function(node) {
7429 this.push(new HLiteral(node.get$value())); 7429 this.push(new HLiteral(node.get$value()));
7430 } 7430 }
7431 SsaBuilder.prototype.visitLiteralDouble = function(node) { 7431 SsaBuilder.prototype.visitLiteralDouble = function(node) {
7432 this.push(new HLiteral(node.get$value())); 7432 this.push(new HLiteral(node.get$value()));
7433 } 7433 }
7434 SsaBuilder.prototype.visitLiteralBool = function(node) { 7434 SsaBuilder.prototype.visitLiteralBool = function(node) {
7435 this.push(new HLiteral(node.get$value())); 7435 this.push(new HLiteral(node.get$value()));
7436 } 7436 }
7437 SsaBuilder.prototype.visitLiteralString = function(node) { 7437 SsaBuilder.prototype.visitLiteralString = function(node) {
7438 this.push(new HLiteral(node.get$value())); 7438 this.push(new HLiteral(node.get$value()));
7439 } 7439 }
7440 SsaBuilder.prototype.visitNodeList = function(node) { 7440 SsaBuilder.prototype.visitNodeList = function(node) {
7441 var $0; 7441 var $0;
7442 for (var link = node.nodes; 7442 for (var link = node.nodes;
7443 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) { 7443 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) {
7444 this.visit((($0 = link.get$head()) && $0.is$tree_Node())); 7444 this.visit((($0 = link.get$head()) && $0.is$Node()));
7445 } 7445 }
7446 } 7446 }
7447 SsaBuilder.prototype.visitOperator = function(node) { 7447 SsaBuilder.prototype.visitOperator = function(node) {
7448 this.compiler.unimplemented("SsaBuilder.visitOperator"); 7448 this.compiler.unimplemented("SsaBuilder.visitOperator");
7449 } 7449 }
7450 SsaBuilder.prototype.visitReturn = function(node) { 7450 SsaBuilder.prototype.visitReturn = function(node) {
7451 if (node.expression == null) { 7451 if (node.expression == null) {
7452 this.compiler.unimplemented("SsaBuilder: return without expression"); 7452 this.compiler.unimplemented("SsaBuilder: return without expression");
7453 } 7453 }
7454 this.visit(node.expression); 7454 this.visit(node.expression);
(...skipping 10 matching lines...) Expand all
7465 SsaBuilder.prototype.visitTypeAnnotation = function(node) { 7465 SsaBuilder.prototype.visitTypeAnnotation = function(node) {
7466 7466
7467 } 7467 }
7468 SsaBuilder.prototype.updateDefinition = function(node) { 7468 SsaBuilder.prototype.updateDefinition = function(node) {
7469 var $0; 7469 var $0;
7470 if (node.receiver != null) { 7470 if (node.receiver != null) {
7471 this.compiler.unimplemented("SsaBuilder: property access"); 7471 this.compiler.unimplemented("SsaBuilder: property access");
7472 } 7472 }
7473 var link = node.get$arguments(); 7473 var link = node.get$arguments();
7474 $assert(!$notnull_bool(link.isEmpty()) && $notnull_bool(link.get$tail().isEmpt y$0()), "!link.isEmpty() && link.tail.isEmpty()", "builder.dart", 438, 12); 7474 $assert(!$notnull_bool(link.isEmpty()) && $notnull_bool(link.get$tail().isEmpt y$0()), "!link.isEmpty() && link.tail.isEmpty()", "builder.dart", 438, 12);
7475 this.visit((($0 = link.get$head()) && $0.is$tree_Node())); 7475 this.visit((($0 = link.get$head()) && $0.is$Node()));
7476 var value = this.pop(); 7476 var value = this.pop();
7477 this.definitions.$setindex(this.elements.$index(node), value); 7477 this.definitions.$setindex(this.elements.$index(node), value);
7478 return value; 7478 return value;
7479 } 7479 }
7480 SsaBuilder.prototype.visitVariableDefinitions = function(node) { 7480 SsaBuilder.prototype.visitVariableDefinitions = function(node) {
7481 var $0; 7481 var $0;
7482 for (var link = node.definitions.nodes; 7482 for (var link = node.definitions.nodes;
7483 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) { 7483 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) {
7484 var definition = (($0 = link.get$head()) && $0.is$tree_Node()); 7484 var definition = (($0 = link.get$head()) && $0.is$Node());
7485 if ((definition instanceof tree_Identifier)) { 7485 if ((definition instanceof Identifier)) {
7486 this.compiler.unimplemented("SsaBuilder.visitVariableDefinitions without i nitial value"); 7486 this.compiler.unimplemented("SsaBuilder.visitVariableDefinitions without i nitial value");
7487 } 7487 }
7488 else { 7488 else {
7489 $assert((definition instanceof SendSet), "definition is SendSet", "builder .dart", 454, 16); 7489 $assert((definition instanceof SendSet), "definition is SendSet", "builder .dart", 454, 16);
7490 this.updateDefinition((definition && definition.is$SendSet())); 7490 this.updateDefinition((definition && definition.is$SendSet()));
7491 } 7491 }
7492 } 7492 }
7493 } 7493 }
7494 SsaBuilder.prototype.add$1 = function($0) { 7494 SsaBuilder.prototype.add$1 = function($0) {
7495 return this.add(($0 && $0.is$HInstruction())); 7495 return this.add(($0 && $0.is$HInstruction()));
7496 }; 7496 };
7497 SsaBuilder.prototype.visit$1 = function($0) { 7497 SsaBuilder.prototype.visit$1 = function($0) {
7498 return this.visit(($0 && $0.is$tree_Node())); 7498 return this.visit(($0 && $0.is$Node()));
7499 }; 7499 };
7500 // ********** Code for SsaCodeGeneratorTask ************** 7500 // ********** Code for SsaCodeGeneratorTask **************
7501 function SsaCodeGeneratorTask(compiler) { 7501 function SsaCodeGeneratorTask(compiler) {
7502 // Initializers done 7502 // Initializers done
7503 CompilerTask.call(this, compiler); 7503 CompilerTask.call(this, compiler);
7504 } 7504 }
7505 $inherits(SsaCodeGeneratorTask, CompilerTask); 7505 $inherits(SsaCodeGeneratorTask, CompilerTask);
7506 SsaCodeGeneratorTask.prototype.get$name = function() { 7506 SsaCodeGeneratorTask.prototype.get$name = function() {
7507 return 'SSA code generator'; 7507 return 'SSA code generator';
7508 } 7508 }
7509 SsaCodeGeneratorTask.prototype.generate = function(tree, graph) { 7509 SsaCodeGeneratorTask.prototype.generate = function(tree, graph) {
7510 var $this = this; // closure support 7510 var $this = this; // closure support
7511 return $assert_String(this.measure((function () { 7511 return $assert_String(this.measure((function () {
7512 var $0; 7512 var $0;
7513 var function_ = (tree && tree.is$FunctionExpression()); 7513 var function_ = (tree && tree.is$FunctionExpression());
7514 var parameters = function_.parameters; 7514 var parameters = function_.parameters;
7515 var parameterNames = []; 7515 var parameterNames = [];
7516 for (var link = parameters.nodes; 7516 for (var link = parameters.nodes;
7517 !$notnull_bool(link.isEmpty$0()); link = link.get$tail()) { 7517 !$notnull_bool(link.isEmpty$0()); link = link.get$tail()) {
7518 var parameter = (($0 = link.get$head()) && $0.is$VariableDefinitions()); 7518 var parameter = (($0 = link.get$head()) && $0.is$VariableDefinitions());
7519 var name = (($0 = parameter.definitions.nodes.get$head().get$source()) && $0.is$SourceString()); 7519 var name = (($0 = parameter.definitions.nodes.get$head().get$source()) && $0.is$SourceString());
7520 parameterNames.add(JsNames.getValid(('' + name + ''))); 7520 parameterNames.add(JsNames.getValid(('' + name + '')));
7521 } 7521 }
7522 var name = (($0 = function_.name) && $0.is$tree_Identifier()); 7522 var name = (($0 = function_.name) && $0.is$Identifier());
7523 if (false/*null.GENERATE_SSA_TRACE*/) { 7523 if (false/*null.GENERATE_SSA_TRACE*/) {
7524 HTracer.HTracer$singleton$factory().traceGraph("codegen", graph); 7524 HTracer.HTracer$singleton$factory().traceGraph("codegen", graph);
7525 } 7525 }
7526 var code = $this.generateMethod(name.get$source(), parameterNames, graph); 7526 var code = $this.generateMethod(name.get$source(), parameterNames, graph);
7527 return code; 7527 return code;
7528 }) 7528 })
7529 )); 7529 ));
7530 } 7530 }
7531 SsaCodeGeneratorTask.prototype.generateMethod = function(methodName, parameterNa mes, graph) { 7531 SsaCodeGeneratorTask.prototype.generateMethod = function(methodName, parameterNa mes, graph) {
7532 new SsaPhiEliminator().visitGraph(graph); 7532 new SsaPhiEliminator().visitGraph(graph);
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
8278 HInstruction.prototype.getFlag = function(position) { 8278 HInstruction.prototype.getFlag = function(position) {
8279 return (this.flags & (1 << position)) != 0; 8279 return (this.flags & (1 << position)) != 0;
8280 } 8280 }
8281 HInstruction.prototype.setFlag = function(position) { 8281 HInstruction.prototype.setFlag = function(position) {
8282 this.flags |= (1 << position); 8282 this.flags |= (1 << position);
8283 } 8283 }
8284 HInstruction.computeDependsOnFlags = function(flags) { 8284 HInstruction.computeDependsOnFlags = function(flags) {
8285 return flags << 1/*HInstruction.FLAG_CHANGES_COUNT*/; 8285 return flags << 1/*HInstruction.FLAG_CHANGES_COUNT*/;
8286 } 8286 }
8287 HInstruction.prototype.getChangesFlags = function() { 8287 HInstruction.prototype.getChangesFlags = function() {
8288 return this.flags & (1.0)/*((1 << FLAG_CHANGES_COUNT) - 1)*/; 8288 return this.flags & (1)/*((1 << FLAG_CHANGES_COUNT) - 1)*/;
8289 } 8289 }
8290 HInstruction.prototype.hasSideEffects = function() { 8290 HInstruction.prototype.hasSideEffects = function() {
8291 return this.getChangesFlags() != 0; 8291 return this.getChangesFlags() != 0;
8292 } 8292 }
8293 HInstruction.prototype.prepareGvn = function() { 8293 HInstruction.prototype.prepareGvn = function() {
8294 this.setAllSideEffects(); 8294 this.setAllSideEffects();
8295 } 8295 }
8296 HInstruction.prototype.setAllSideEffects = function() { 8296 HInstruction.prototype.setAllSideEffects = function() {
8297 this.flags |= (1.0)/*((1 << FLAG_CHANGES_COUNT) - 1)*/; 8297 this.flags |= (1)/*((1 << FLAG_CHANGES_COUNT) - 1)*/;
8298 } 8298 }
8299 HInstruction.prototype.clearAllSideEffects = function() { 8299 HInstruction.prototype.clearAllSideEffects = function() {
8300 this.flags &= -2.0/*~((1 << FLAG_CHANGES_COUNT) - 1)*/; 8300 this.flags &= -2/*~((1 << FLAG_CHANGES_COUNT) - 1)*/;
8301 } 8301 }
8302 HInstruction.prototype.generateAtUseSite = function() { 8302 HInstruction.prototype.generateAtUseSite = function() {
8303 return this.getFlag(2/*HInstruction.FLAG_GENERATE_AT_USE_SITE*/); 8303 return this.getFlag(2/*HInstruction.FLAG_GENERATE_AT_USE_SITE*/);
8304 } 8304 }
8305 HInstruction.prototype.setGenerateAtUseSite = function() { 8305 HInstruction.prototype.setGenerateAtUseSite = function() {
8306 this.setFlag(2/*HInstruction.FLAG_GENERATE_AT_USE_SITE*/); 8306 this.setFlag(2/*HInstruction.FLAG_GENERATE_AT_USE_SITE*/);
8307 } 8307 }
8308 HInstruction.prototype.useGvn = function() { 8308 HInstruction.prototype.useGvn = function() {
8309 return this.getFlag(3/*HInstruction.FLAG_USE_GVN*/); 8309 return this.getFlag(3/*HInstruction.FLAG_USE_GVN*/);
8310 } 8310 }
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after
9748 } 9748 }
9749 ResolverTask.prototype.resolveType = function(tree) { 9749 ResolverTask.prototype.resolveType = function(tree) {
9750 var $this = this; // closure support 9750 var $this = this; // closure support
9751 this.measure((function () { 9751 this.measure((function () {
9752 var visitor = new ClassResolverVisitor($this.compiler); 9752 var visitor = new ClassResolverVisitor($this.compiler);
9753 visitor.visit(tree); 9753 visitor.visit(tree);
9754 }) 9754 })
9755 ); 9755 );
9756 } 9756 }
9757 ResolverTask.prototype.resolve$1 = function($0) { 9757 ResolverTask.prototype.resolve$1 = function($0) {
9758 return this.resolve(($0 && $0.is$tree_Node())); 9758 return this.resolve(($0 && $0.is$Node()));
9759 }; 9759 };
9760 // ********** Code for ErrorMessages ************** 9760 // ********** Code for ErrorMessages **************
9761 function ErrorMessages() {} 9761 function ErrorMessages() {}
9762 ErrorMessages.cannotResolve = function(id) { 9762 ErrorMessages.cannotResolve = function(id) {
9763 return ("cannot resolve " + id + ""); 9763 return ("cannot resolve " + id + "");
9764 } 9764 }
9765 ErrorMessages.cannotResolveType = function(id) { 9765 ErrorMessages.cannotResolveType = function(id) {
9766 return ("cannot resolve type " + id + ""); 9766 return ("cannot resolve type " + id + "");
9767 } 9767 }
9768 ErrorMessages.duplicateDefinition = function(id) { 9768 ErrorMessages.duplicateDefinition = function(id) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
9834 if ($notnull_bool($eq(name, const$217/*const SourceString('*')*/))) return con st$218/*const SourceString('mul')*/; 9834 if ($notnull_bool($eq(name, const$217/*const SourceString('*')*/))) return con st$218/*const SourceString('mul')*/;
9835 if ($notnull_bool($eq(name, const$219/*const SourceString('/')*/))) return con st$220/*const SourceString('div')*/; 9835 if ($notnull_bool($eq(name, const$219/*const SourceString('/')*/))) return con st$220/*const SourceString('div')*/;
9836 if ($notnull_bool($eq(name, const$221/*const SourceString('~/')*/))) return co nst$222/*const SourceString('tdiv')*/; 9836 if ($notnull_bool($eq(name, const$221/*const SourceString('~/')*/))) return co nst$222/*const SourceString('tdiv')*/;
9837 if ($notnull_bool($eq(name, const$223/*const SourceString('==')*/))) return co nst$224/*const SourceString('eq')*/; 9837 if ($notnull_bool($eq(name, const$223/*const SourceString('==')*/))) return co nst$224/*const SourceString('eq')*/;
9838 if ($notnull_bool($eq(name, const$225/*const SourceString('<')*/))) return con st$226/*const SourceString('lt')*/; 9838 if ($notnull_bool($eq(name, const$225/*const SourceString('<')*/))) return con st$226/*const SourceString('lt')*/;
9839 return name; 9839 return name;
9840 } 9840 }
9841 ResolverVisitor.prototype.visitSend = function(node) { 9841 ResolverVisitor.prototype.visitSend = function(node) {
9842 var $0; 9842 var $0;
9843 this.visit(node.receiver); 9843 this.visit(node.receiver);
9844 var identifier = (($0 = node.selector) && $0.is$tree_Identifier()); 9844 var identifier = (($0 = node.selector) && $0.is$Identifier());
9845 var name = this.potentiallyMapOperatorToMethodName(identifier.get$source()); 9845 var name = this.potentiallyMapOperatorToMethodName(identifier.get$source());
9846 var target = this.context.lookup(name); 9846 var target = this.context.lookup(name);
9847 if (target == null) this.fail(node, ErrorMessages.cannotResolve(name)); 9847 if (target == null) this.fail(node, ErrorMessages.cannotResolve(name));
9848 this.visit(node.argumentsNode); 9848 this.visit(node.argumentsNode);
9849 return this.useElement(node, target); 9849 return this.useElement(node, target);
9850 } 9850 }
9851 ResolverVisitor.prototype.visitSendSet = function(node) { 9851 ResolverVisitor.prototype.visitSendSet = function(node) {
9852 var $0; 9852 var $0;
9853 var receiver = (($0 = this.visit(node.receiver)) && $0.is$Element()); 9853 var receiver = (($0 = this.visit(node.receiver)) && $0.is$Element());
9854 var selector = (($0 = node.selector) && $0.is$tree_Identifier()); 9854 var selector = (($0 = node.selector) && $0.is$Identifier());
9855 if (receiver != null) { 9855 if (receiver != null) {
9856 this.compiler.unimplemented('Resolver: property access'); 9856 this.compiler.unimplemented('Resolver: property access');
9857 } 9857 }
9858 var target = this.context.lookup(selector.get$source()); 9858 var target = this.context.lookup(selector.get$source());
9859 if (target == null) this.fail(node, ErrorMessages.cannotResolve(node)); 9859 if (target == null) this.fail(node, ErrorMessages.cannotResolve(node));
9860 this.visit(node.argumentsNode); 9860 this.visit(node.argumentsNode);
9861 return this.useElement(node, target); 9861 return this.useElement(node, target);
9862 } 9862 }
9863 ResolverVisitor.prototype.visitLiteralInt = function(node) { 9863 ResolverVisitor.prototype.visitLiteralInt = function(node) {
9864 9864
9865 } 9865 }
9866 ResolverVisitor.prototype.visitLiteralDouble = function(node) { 9866 ResolverVisitor.prototype.visitLiteralDouble = function(node) {
9867 9867
9868 } 9868 }
9869 ResolverVisitor.prototype.visitLiteralBool = function(node) { 9869 ResolverVisitor.prototype.visitLiteralBool = function(node) {
9870 9870
9871 } 9871 }
9872 ResolverVisitor.prototype.visitLiteralString = function(node) { 9872 ResolverVisitor.prototype.visitLiteralString = function(node) {
9873 9873
9874 } 9874 }
9875 ResolverVisitor.prototype.visitNodeList = function(node) { 9875 ResolverVisitor.prototype.visitNodeList = function(node) {
9876 var $0; 9876 var $0;
9877 for (var link = node.nodes; 9877 for (var link = node.nodes;
9878 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) { 9878 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) {
9879 this.visit((($0 = link.get$head()) && $0.is$tree_Node())); 9879 this.visit((($0 = link.get$head()) && $0.is$Node()));
9880 } 9880 }
9881 } 9881 }
9882 ResolverVisitor.prototype.visitOperator = function(node) { 9882 ResolverVisitor.prototype.visitOperator = function(node) {
9883 this.fail(node, "Unimplemented in the resolver"); 9883 this.fail(node, "Unimplemented in the resolver");
9884 } 9884 }
9885 ResolverVisitor.prototype.visitReturn = function(node) { 9885 ResolverVisitor.prototype.visitReturn = function(node) {
9886 this.visit(node.expression); 9886 this.visit(node.expression);
9887 } 9887 }
9888 ResolverVisitor.prototype.visitThrow = function(node) { 9888 ResolverVisitor.prototype.visitThrow = function(node) {
9889 this.visit(node.expression); 9889 this.visit(node.expression);
(...skipping 25 matching lines...) Expand all
9915 this.compiler.ensure(element != null); 9915 this.compiler.ensure(element != null);
9916 this.mapping.$setindex(node, element); 9916 this.mapping.$setindex(node, element);
9917 return (($0 = this.context.add(element)) && $0.is$Element()); 9917 return (($0 = this.context.add(element)) && $0.is$Element());
9918 } 9918 }
9919 ResolverVisitor.prototype.useElement = function(node, element) { 9919 ResolverVisitor.prototype.useElement = function(node, element) {
9920 if (element == null) return null; 9920 if (element == null) return null;
9921 this.mapping.$setindex(node, element); 9921 this.mapping.$setindex(node, element);
9922 return element; 9922 return element;
9923 } 9923 }
9924 ResolverVisitor.prototype.visit$1 = function($0) { 9924 ResolverVisitor.prototype.visit$1 = function($0) {
9925 return this.visit(($0 && $0.is$tree_Node())); 9925 return this.visit(($0 && $0.is$Node()));
9926 }; 9926 };
9927 // ********** Code for ClassResolverVisitor ************** 9927 // ********** Code for ClassResolverVisitor **************
9928 function ClassResolverVisitor(compiler) { 9928 function ClassResolverVisitor(compiler) {
9929 this.compiler = compiler; 9929 this.compiler = compiler;
9930 this.context = new TopScope(compiler.universe); 9930 this.context = new TopScope(compiler.universe);
9931 // Initializers done 9931 // Initializers done
9932 } 9932 }
9933 ClassResolverVisitor.prototype.is$Visitor = function(){return this;}; 9933 ClassResolverVisitor.prototype.is$Visitor = function(){return this;};
9934 ClassResolverVisitor.prototype.visitClassNode = function(node) { 9934 ClassResolverVisitor.prototype.visitClassNode = function(node) {
9935 var $0; 9935 var $0;
9936 var element = (($0 = this.context.lookup(node.name.get$source())) && $0.is$Cla ssElement()); 9936 var element = (($0 = this.context.lookup(node.name.get$source())) && $0.is$Cla ssElement());
9937 this.compiler.ensure(element != null); 9937 this.compiler.ensure(element != null);
9938 this.compiler.ensure(!$notnull_bool(element.isResolved)); 9938 this.compiler.ensure(!$notnull_bool(element.isResolved));
9939 element.supertype = this.visit(node.superclass); 9939 element.supertype = this.visit(node.superclass);
9940 for (var link = node.interfaces.nodes; 9940 for (var link = node.interfaces.nodes;
9941 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) { 9941 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) {
9942 element.interfaces = (($0 = element.interfaces.prepend(this.visit((($0 = lin k.get$head()) && $0.is$tree_Node())))) && $0.is$Link$Type()); 9942 element.interfaces = (($0 = element.interfaces.prepend(this.visit((($0 = lin k.get$head()) && $0.is$Node())))) && $0.is$Link$Type());
9943 } 9943 }
9944 return element.computeType(this.compiler, null); 9944 return element.computeType(this.compiler, null);
9945 } 9945 }
9946 ClassResolverVisitor.prototype.visitTypeAnnotation = function(node) { 9946 ClassResolverVisitor.prototype.visitTypeAnnotation = function(node) {
9947 var $0; 9947 var $0;
9948 var name = node.typeName; 9948 var name = node.typeName;
9949 var element = this.context.lookup(name.get$source()); 9949 var element = this.context.lookup(name.get$source());
9950 if (element == null) { 9950 if (element == null) {
9951 this.compiler.cancel(ErrorMessages.cannotResolveType(name)); 9951 this.compiler.cancel(ErrorMessages.cannotResolveType(name));
9952 } 9952 }
9953 else if (element.kind !== const$199/*ElementKind.CLASS*/) { 9953 else if (element.kind !== const$199/*ElementKind.CLASS*/) {
9954 this.compiler.cancel(ErrorMessages.notAType(name)); 9954 this.compiler.cancel(ErrorMessages.notAType(name));
9955 } 9955 }
9956 else { 9956 else {
9957 this.compiler.resolver.toResolve.add(element); 9957 this.compiler.resolver.toResolve.add(element);
9958 return (($0 = element.computeType(this.compiler, null)) && $0.is$leg_Type()) ; 9958 return (($0 = element.computeType(this.compiler, null)) && $0.is$Type());
9959 } 9959 }
9960 return null; 9960 return null;
9961 } 9961 }
9962 ClassResolverVisitor.prototype.visit = function(node) { 9962 ClassResolverVisitor.prototype.visit = function(node) {
9963 var $0; 9963 var $0;
9964 if (node == null) return null; 9964 if (node == null) return null;
9965 return (($0 = node.accept(this)) && $0.is$leg_Type()); 9965 return (($0 = node.accept(this)) && $0.is$Type());
9966 } 9966 }
9967 ClassResolverVisitor.prototype.visit$1 = function($0) { 9967 ClassResolverVisitor.prototype.visit$1 = function($0) {
9968 return this.visit(($0 && $0.is$tree_Node())); 9968 return this.visit(($0 && $0.is$Node()));
9969 }; 9969 };
9970 // ********** Code for VariableDefinitionsVisitor ************** 9970 // ********** Code for VariableDefinitionsVisitor **************
9971 function VariableDefinitionsVisitor(definitions, resolver) { 9971 function VariableDefinitionsVisitor(definitions, resolver) {
9972 this.definitions = definitions; 9972 this.definitions = definitions;
9973 this.resolver = resolver; 9973 this.resolver = resolver;
9974 // Initializers done 9974 // Initializers done
9975 } 9975 }
9976 VariableDefinitionsVisitor.prototype.is$Visitor = function(){return this;}; 9976 VariableDefinitionsVisitor.prototype.is$Visitor = function(){return this;};
9977 VariableDefinitionsVisitor.prototype.visitSendSet = function(node) { 9977 VariableDefinitionsVisitor.prototype.visitSendSet = function(node) {
9978 var $0; 9978 var $0;
9979 $assert(node.get$arguments().get$tail().isEmpty$0(), "node.arguments.tail.isEm pty()", "resolver.dart", 269, 12); 9979 $assert(node.get$arguments().get$tail().isEmpty$0(), "node.arguments.tail.isEm pty()", "resolver.dart", 269, 12);
9980 if (node.receiver != null) { 9980 if (node.receiver != null) {
9981 this.resolver.compiler.unimplemented("receiver on a variable definition"); 9981 this.resolver.compiler.unimplemented("receiver on a variable definition");
9982 } 9982 }
9983 var selector = (($0 = node.selector) && $0.is$tree_Identifier()); 9983 var selector = (($0 = node.selector) && $0.is$Identifier());
9984 this.resolver.visit((($0 = node.get$arguments().get$head()) && $0.is$tree_Node ())); 9984 this.resolver.visit((($0 = node.get$arguments().get$head()) && $0.is$Node()));
9985 return (($0 = this.visit(node.selector)) && $0.is$SourceString()); 9985 return (($0 = this.visit(node.selector)) && $0.is$SourceString());
9986 } 9986 }
9987 VariableDefinitionsVisitor.prototype.visitIdentifier = function(node) { 9987 VariableDefinitionsVisitor.prototype.visitIdentifier = function(node) {
9988 return node.get$source(); 9988 return node.get$source();
9989 } 9989 }
9990 VariableDefinitionsVisitor.prototype.visitNodeList = function(node) { 9990 VariableDefinitionsVisitor.prototype.visitNodeList = function(node) {
9991 var $0; 9991 var $0;
9992 for (var link = node.nodes; 9992 for (var link = node.nodes;
9993 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) { 9993 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) {
9994 var name = (($0 = this.visit((($0 = link.get$head()) && $0.is$tree_Node()))) && $0.is$SourceString()); 9994 var name = (($0 = this.visit((($0 = link.get$head()) && $0.is$Node()))) && $ 0.is$SourceString());
9995 var element = new VariableElement((($0 = link.get$head()) && $0.is$tree_Node ()), this.definitions.type, name, this.resolver.context.enclosingElement); 9995 var element = new VariableElement((($0 = link.get$head()) && $0.is$Node()), this.definitions.type, name, this.resolver.context.enclosingElement);
9996 var existing = this.resolver.defineElement((($0 = link.get$head()) && $0.is$ tree_Node()), element); 9996 var existing = this.resolver.defineElement((($0 = link.get$head()) && $0.is$ Node()), element);
9997 if ($ne(existing, element)) { 9997 if ($ne(existing, element)) {
9998 this.resolver.fail(node, ErrorMessages.duplicateDefinition(link.get$head() )); 9998 this.resolver.fail(node, ErrorMessages.duplicateDefinition(link.get$head() ));
9999 } 9999 }
10000 } 10000 }
10001 } 10001 }
10002 VariableDefinitionsVisitor.prototype.visit = function(node) { 10002 VariableDefinitionsVisitor.prototype.visit = function(node) {
10003 return node.accept(this); 10003 return node.accept(this);
10004 } 10004 }
10005 VariableDefinitionsVisitor.prototype.visit$1 = function($0) { 10005 VariableDefinitionsVisitor.prototype.visit$1 = function($0) {
10006 return this.visit(($0 && $0.is$tree_Node())); 10006 return this.visit(($0 && $0.is$Node()));
10007 }; 10007 };
10008 // ********** Code for Scope ************** 10008 // ********** Code for Scope **************
10009 function Scope(parent) { 10009 function Scope(parent) {
10010 // Initializers done 10010 // Initializers done
10011 Scope.enclosing$ctor.call(this, parent, parent.enclosingElement); 10011 Scope.enclosing$ctor.call(this, parent, parent.enclosingElement);
10012 } 10012 }
10013 Scope.enclosing$ctor = function(parent, enclosingElement) {
10014 this.parent = parent;
10015 this.enclosingElement = enclosingElement;
10016 this.elements = $map([]);
10017 // Initializers done
10018 }
10019 Scope.enclosing$ctor.prototype = Scope.prototype;
10020 Scope.top$ctor = function() { 10013 Scope.top$ctor = function() {
10021 this.parent = null; 10014 this.parent = null;
10022 this.elements = const$212/*const {}*/; 10015 this.elements = const$212/*const {}*/;
10023 this.enclosingElement = null; 10016 this.enclosingElement = null;
10024 // Initializers done 10017 // Initializers done
10025 } 10018 }
10026 Scope.top$ctor.prototype = Scope.prototype; 10019 Scope.top$ctor.prototype = Scope.prototype;
10020 Scope.enclosing$ctor = function(parent, enclosingElement) {
10021 this.parent = parent;
10022 this.enclosingElement = enclosingElement;
10023 this.elements = $map([]);
10024 // Initializers done
10025 }
10026 Scope.enclosing$ctor.prototype = Scope.prototype;
10027 Scope.prototype.get$parent = function() { return this.parent; }; 10027 Scope.prototype.get$parent = function() { return this.parent; };
10028 Scope.prototype.lookup = function(name) { 10028 Scope.prototype.lookup = function(name) {
10029 var $0; 10029 var $0;
10030 var element = (($0 = this.elements.$index(name)) && $0.is$Element()); 10030 var element = (($0 = this.elements.$index(name)) && $0.is$Element());
10031 if (element != null) return element; 10031 if (element != null) return element;
10032 return this.parent.lookup(name); 10032 return this.parent.lookup(name);
10033 } 10033 }
10034 Scope.prototype.add = function(element) { 10034 Scope.prototype.add = function(element) {
10035 var $0; 10035 var $0;
10036 if (this.elements.containsKey(element.name)) return (($0 = this.elements.$inde x(element.name)) && $0.is$Element()); 10036 if (this.elements.containsKey(element.name)) return (($0 = this.elements.$inde x(element.name)) && $0.is$Element());
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
10123 this.name = name; 10123 this.name = name;
10124 this.element = element; 10124 this.element = element;
10125 // Initializers done 10125 // Initializers done
10126 } 10126 }
10127 SimpleType.named$ctor = function(name) { 10127 SimpleType.named$ctor = function(name) {
10128 this.name = name; 10128 this.name = name;
10129 this.element = new Element(name, null, null); 10129 this.element = new Element(name, null, null);
10130 // Initializers done 10130 // Initializers done
10131 } 10131 }
10132 SimpleType.named$ctor.prototype = SimpleType.prototype; 10132 SimpleType.named$ctor.prototype = SimpleType.prototype;
10133 SimpleType.prototype.is$leg_Type = function(){return this;}; 10133 SimpleType.prototype.is$Type = function(){return this;};
10134 SimpleType.prototype.get$name = function() { return this.name; }; 10134 SimpleType.prototype.get$name = function() { return this.name; };
10135 SimpleType.prototype.get$element = function() { return this.element; }; 10135 SimpleType.prototype.get$element = function() { return this.element; };
10136 SimpleType.prototype.toString = function() { 10136 SimpleType.prototype.toString = function() {
10137 return this.name.toString(); 10137 return this.name.toString();
10138 } 10138 }
10139 SimpleType.prototype.toString$0 = function() { 10139 SimpleType.prototype.toString$0 = function() {
10140 return this.toString(); 10140 return this.toString();
10141 }; 10141 };
10142 // ********** Code for FunctionType ************** 10142 // ********** Code for FunctionType **************
10143 function FunctionType(returnType, parameterTypes) { 10143 function FunctionType(returnType, parameterTypes) {
10144 this.returnType = returnType; 10144 this.returnType = returnType;
10145 this.parameterTypes = parameterTypes; 10145 this.parameterTypes = parameterTypes;
10146 // Initializers done 10146 // Initializers done
10147 } 10147 }
10148 FunctionType.prototype.is$FunctionType = function(){return this;}; 10148 FunctionType.prototype.is$FunctionType = function(){return this;};
10149 FunctionType.prototype.is$leg_Type = function(){return this;}; 10149 FunctionType.prototype.is$Type = function(){return this;};
10150 FunctionType.prototype.get$returnType = function() { return this.returnType; }; 10150 FunctionType.prototype.get$returnType = function() { return this.returnType; };
10151 FunctionType.prototype.toString = function() { 10151 FunctionType.prototype.toString = function() {
10152 var sb = new StringBufferImpl(""); 10152 var sb = new StringBufferImpl("");
10153 var first = true; 10153 var first = true;
10154 sb.add('('); 10154 sb.add('(');
10155 this.parameterTypes.printOn(sb, ', '); 10155 this.parameterTypes.printOn(sb, ', ');
10156 sb.add((') -> ' + this.returnType + '')); 10156 sb.add((') -> ' + this.returnType + ''));
10157 return sb.toString(); 10157 return sb.toString();
10158 } 10158 }
10159 FunctionType.prototype.toString$0 = function() { 10159 FunctionType.prototype.toString$0 = function() {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
10222 this.reportTypeWarning(node, const$243/*WarningKind.VOID_EXPRESSION*/, const $13/*const []*/); 10222 this.reportTypeWarning(node, const$243/*WarningKind.VOID_EXPRESSION*/, const $13/*const []*/);
10223 } 10223 }
10224 return type; 10224 return type;
10225 } 10225 }
10226 TypeCheckerVisitor.prototype.typeWithDefault = function(node, defaultValue) { 10226 TypeCheckerVisitor.prototype.typeWithDefault = function(node, defaultValue) {
10227 return node != null ? this.type(node) : defaultValue; 10227 return node != null ? this.type(node) : defaultValue;
10228 } 10228 }
10229 TypeCheckerVisitor.prototype.type = function(node) { 10229 TypeCheckerVisitor.prototype.type = function(node) {
10230 var $0; 10230 var $0;
10231 if (node == null) this.fail(null, 'unexpected node: null'); 10231 if (node == null) this.fail(null, 'unexpected node: null');
10232 var result = (($0 = node.accept(this)) && $0.is$leg_Type()); 10232 var result = (($0 = node.accept(this)) && $0.is$Type());
10233 return result; 10233 return result;
10234 } 10234 }
10235 TypeCheckerVisitor.prototype.get$type = function() { 10235 TypeCheckerVisitor.prototype.get$type = function() {
10236 return TypeCheckerVisitor.prototype.type.bind(this); 10236 return TypeCheckerVisitor.prototype.type.bind(this);
10237 } 10237 }
10238 TypeCheckerVisitor.prototype.checkAssignable = function(node, s, t) { 10238 TypeCheckerVisitor.prototype.checkAssignable = function(node, s, t) {
10239 if (!$notnull_bool(this.types.isAssignable(s, t))) { 10239 if (!$notnull_bool(this.types.isAssignable(s, t))) {
10240 this.reportTypeWarning(node, const$236/*WarningKind.NOT_ASSIGNABLE*/, [s, t] ); 10240 this.reportTypeWarning(node, const$236/*WarningKind.NOT_ASSIGNABLE*/, [s, t] );
10241 } 10241 }
10242 } 10242 }
(...skipping 25 matching lines...) Expand all
10268 } 10268 }
10269 TypeCheckerVisitor.prototype.visitIf = function(node) { 10269 TypeCheckerVisitor.prototype.visitIf = function(node) {
10270 this.type(node.condition); 10270 this.type(node.condition);
10271 this.type(node.thenPart); 10271 this.type(node.thenPart);
10272 if ($notnull_bool(node.get$hasElsePart())) this.type(node.elsePart); 10272 if ($notnull_bool(node.get$hasElsePart())) this.type(node.elsePart);
10273 return this.types.voidType; 10273 return this.types.voidType;
10274 } 10274 }
10275 TypeCheckerVisitor.prototype.visitSend = function(node) { 10275 TypeCheckerVisitor.prototype.visitSend = function(node) {
10276 var $0; 10276 var $0;
10277 var target = this.elements.$index(node); 10277 var target = this.elements.$index(node);
10278 var selector = (($0 = node.selector) && $0.is$tree_Identifier()); 10278 var selector = (($0 = node.selector) && $0.is$Identifier());
10279 if (target != null) { 10279 if (target != null) {
10280 var name = selector.get$source(); 10280 var name = selector.get$source();
10281 if ($notnull_bool($eq(name, const$213/*const SourceString('+')*/)) || $notnu ll_bool($eq(name, const$240/*const SourceString('=')*/)) || $notnull_bool($eq(na me, const$215/*const SourceString('-')*/)) || $notnull_bool($eq(name, const$217/ *const SourceString('*')*/)) || $notnull_bool($eq(name, const$219/*const SourceS tring('/')*/)) || $notnull_bool($eq(name, const$225/*const SourceString('<')*/)) || $notnull_bool($eq(name, const$221/*const SourceString('~/')*/))) { 10281 if ($notnull_bool($eq(name, const$213/*const SourceString('+')*/)) || $notnu ll_bool($eq(name, const$240/*const SourceString('=')*/)) || $notnull_bool($eq(na me, const$215/*const SourceString('-')*/)) || $notnull_bool($eq(name, const$217/ *const SourceString('*')*/)) || $notnull_bool($eq(name, const$219/*const SourceS tring('/')*/)) || $notnull_bool($eq(name, const$225/*const SourceString('<')*/)) || $notnull_bool($eq(name, const$221/*const SourceString('~/')*/))) {
10282 return this.types.dynamicType; 10282 return this.types.dynamicType;
10283 } 10283 }
10284 var targetType = target.computeType$2(this.compiler, this.types); 10284 var targetType = target.computeType$2(this.compiler, this.types);
10285 if ($notnull_bool(node.get$isPropertyAccess())) { 10285 if ($notnull_bool(node.get$isPropertyAccess())) {
10286 return (targetType && targetType.is$leg_Type()); 10286 return (targetType && targetType.is$Type());
10287 } 10287 }
10288 else if ($notnull_bool(node.get$isFunctionObjectInvocation())) { 10288 else if ($notnull_bool(node.get$isFunctionObjectInvocation())) {
10289 this.fail(node); 10289 this.fail(node);
10290 } 10290 }
10291 else { 10291 else {
10292 if (!(targetType instanceof FunctionType)) { 10292 if (!(targetType instanceof FunctionType)) {
10293 if ((target instanceof ForeignElement)) { 10293 if ((target instanceof ForeignElement)) {
10294 return this.types.dynamicType; 10294 return this.types.dynamicType;
10295 } 10295 }
10296 this.fail(node, 'can only handle function types'); 10296 this.fail(node, 'can only handle function types');
10297 } 10297 }
10298 var funType = (targetType && targetType.is$FunctionType()); 10298 var funType = (targetType && targetType.is$FunctionType());
10299 var formals = funType.parameterTypes; 10299 var formals = funType.parameterTypes;
10300 var arguments = node.get$arguments(); 10300 var arguments = node.get$arguments();
10301 while ((!$notnull_bool(formals.isEmpty())) && (!$notnull_bool(arguments.is Empty()))) { 10301 while ((!$notnull_bool(formals.isEmpty())) && (!$notnull_bool(arguments.is Empty()))) {
10302 var argument = (($0 = arguments.get$head()) && $0.is$tree_Node()); 10302 var argument = (($0 = arguments.get$head()) && $0.is$Node());
10303 var argumentType = this.type(argument); 10303 var argumentType = this.type(argument);
10304 this.checkAssignable(argument, argumentType, (($0 = formals.get$head()) && $0.is$leg_Type())); 10304 this.checkAssignable(argument, argumentType, (($0 = formals.get$head()) && $0.is$Type()));
10305 formals = (($0 = formals.get$tail()) && $0.is$Link$Type()); 10305 formals = (($0 = formals.get$tail()) && $0.is$Link$Type());
10306 arguments = (($0 = arguments.get$tail()) && $0.is$Link$Node()); 10306 arguments = (($0 = arguments.get$tail()) && $0.is$Link$Node());
10307 } 10307 }
10308 if (!$notnull_bool(formals.isEmpty())) { 10308 if (!$notnull_bool(formals.isEmpty())) {
10309 this.compiler.reportWarning(node, 'missing argument'); 10309 this.compiler.reportWarning(node, 'missing argument');
10310 } 10310 }
10311 if (!$notnull_bool(arguments.isEmpty())) { 10311 if (!$notnull_bool(arguments.isEmpty())) {
10312 this.compiler.reportWarning((($0 = arguments.get$head()) && $0.is$tree_N ode()), 'additional arguments'); 10312 this.compiler.reportWarning((($0 = arguments.get$head()) && $0.is$Node() ), 'additional arguments');
10313 } 10313 }
10314 return funType.returnType; 10314 return funType.returnType;
10315 } 10315 }
10316 } 10316 }
10317 else { 10317 else {
10318 this.fail(node, ('unresolved send ' + selector.get$source() + '')); 10318 this.fail(node, ('unresolved send ' + selector.get$source() + ''));
10319 } 10319 }
10320 } 10320 }
10321 TypeCheckerVisitor.prototype.visitSendSet = function(node) { 10321 TypeCheckerVisitor.prototype.visitSendSet = function(node) {
10322 var $0; 10322 var $0;
10323 this.compiler.ensure(node.get$arguments() != null && !$notnull_bool(node.get$a rguments().isEmpty())); 10323 this.compiler.ensure(node.get$arguments() != null && !$notnull_bool(node.get$a rguments().isEmpty()));
10324 var targetType = (($0 = this.elements.$index(node).computeType$2(this.compiler , this.types)) && $0.is$leg_Type()); 10324 var targetType = (($0 = this.elements.$index(node).computeType$2(this.compiler , this.types)) && $0.is$Type());
10325 var value = (($0 = node.get$arguments().get$head()) && $0.is$tree_Node()); 10325 var value = (($0 = node.get$arguments().get$head()) && $0.is$Node());
10326 this.checkAssignable(value, this.type(value), targetType); 10326 this.checkAssignable(value, this.type(value), targetType);
10327 return targetType; 10327 return targetType;
10328 } 10328 }
10329 TypeCheckerVisitor.prototype.visitLiteralInt = function(node) { 10329 TypeCheckerVisitor.prototype.visitLiteralInt = function(node) {
10330 return this.types.intType; 10330 return this.types.intType;
10331 } 10331 }
10332 TypeCheckerVisitor.prototype.visitLiteralDouble = function(node) { 10332 TypeCheckerVisitor.prototype.visitLiteralDouble = function(node) {
10333 return this.types.dynamicType; 10333 return this.types.dynamicType;
10334 } 10334 }
10335 TypeCheckerVisitor.prototype.visitLiteralBool = function(node) { 10335 TypeCheckerVisitor.prototype.visitLiteralBool = function(node) {
10336 return this.types.dynamicType; 10336 return this.types.dynamicType;
10337 } 10337 }
10338 TypeCheckerVisitor.prototype.visitLiteralString = function(node) { 10338 TypeCheckerVisitor.prototype.visitLiteralString = function(node) {
10339 return this.types.stringType; 10339 return this.types.stringType;
10340 } 10340 }
10341 TypeCheckerVisitor.prototype.visitNodeList = function(node) { 10341 TypeCheckerVisitor.prototype.visitNodeList = function(node) {
10342 var $0; 10342 var $0;
10343 for (var link = node.nodes; 10343 for (var link = node.nodes;
10344 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) { 10344 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) {
10345 this.type((($0 = link.get$head()) && $0.is$tree_Node())); 10345 this.type((($0 = link.get$head()) && $0.is$Node()));
10346 } 10346 }
10347 return null; 10347 return null;
10348 } 10348 }
10349 TypeCheckerVisitor.prototype.visitOperator = function(node) { 10349 TypeCheckerVisitor.prototype.visitOperator = function(node) {
10350 return this.types.dynamicType; 10350 return this.types.dynamicType;
10351 } 10351 }
10352 TypeCheckerVisitor.prototype.visitReturn = function(node) { 10352 TypeCheckerVisitor.prototype.visitReturn = function(node) {
10353 var expression = node.expression; 10353 var expression = node.expression;
10354 var isVoidFunction = (this.expectedReturnType === this.types.voidType); 10354 var isVoidFunction = (this.expectedReturnType === this.types.voidType);
10355 if (expression != null) { 10355 if (expression != null) {
(...skipping 23 matching lines...) Expand all
10379 } 10379 }
10380 TypeCheckerVisitor.prototype.visitVariableDefinitions = function(node) { 10380 TypeCheckerVisitor.prototype.visitVariableDefinitions = function(node) {
10381 var $0; 10381 var $0;
10382 var type = this.typeWithDefault(node.type, this.types.dynamicType); 10382 var type = this.typeWithDefault(node.type, this.types.dynamicType);
10383 if ($eq(type, this.types.voidType)) { 10383 if ($eq(type, this.types.voidType)) {
10384 this.reportTypeWarning(node.type, const$241/*WarningKind.VOID_VARIABLE*/, co nst$13/*const []*/); 10384 this.reportTypeWarning(node.type, const$241/*WarningKind.VOID_VARIABLE*/, co nst$13/*const []*/);
10385 type = this.types.dynamicType; 10385 type = this.types.dynamicType;
10386 } 10386 }
10387 for (var link = node.definitions.nodes; 10387 for (var link = node.definitions.nodes;
10388 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) { 10388 !$notnull_bool(link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$ Node())) {
10389 var initialization = (($0 = link.get$head()) && $0.is$tree_Node()); 10389 var initialization = (($0 = link.get$head()) && $0.is$Node());
10390 this.compiler.ensure((initialization instanceof tree_Identifier) || (initial ization instanceof Send)); 10390 this.compiler.ensure((initialization instanceof Identifier) || (initializati on instanceof Send));
10391 if ((initialization instanceof Send)) { 10391 if ((initialization instanceof Send)) {
10392 var initializer = this.nonVoidType((($0 = link.get$head()) && $0.is$tree_N ode())); 10392 var initializer = this.nonVoidType((($0 = link.get$head()) && $0.is$Node() ));
10393 this.checkAssignable(node, type, initializer); 10393 this.checkAssignable(node, type, initializer);
10394 } 10394 }
10395 } 10395 }
10396 return null; 10396 return null;
10397 } 10397 }
10398 // ********** Code for Universe ************** 10398 // ********** Code for Universe **************
10399 function Universe() { 10399 function Universe() {
10400 this.elements = $map([]); 10400 this.elements = $map([]);
10401 this.generatedCode = $map([]); 10401 this.generatedCode = $map([]);
10402 this.scope = new Element(const$2, null, null); 10402 this.scope = new Element(const$2, null, null);
10403 // Initializers done 10403 // Initializers done
10404 } 10404 }
10405 Universe.prototype.find = function(name) { 10405 Universe.prototype.find = function(name) {
10406 var $0; 10406 var $0;
10407 return (($0 = this.elements.$index(name)) && $0.is$Element()); 10407 return (($0 = this.elements.$index(name)) && $0.is$Element());
10408 } 10408 }
10409 Universe.prototype.define = function(element) { 10409 Universe.prototype.define = function(element) {
10410 $assert(this.elements.$index(element.name) == null, "elements[element.name] == null", "universe.dart", 20, 12); 10410 $assert(this.elements.$index(element.name) == null, "elements[element.name] == null", "universe.dart", 20, 12);
10411 this.elements.$setindex(element.name, element); 10411 this.elements.$setindex(element.name, element);
10412 } 10412 }
10413 Universe.prototype.addGeneratedCode = function(element, code) { 10413 Universe.prototype.addGeneratedCode = function(element, code) {
10414 this.generatedCode.$setindex(element, code); 10414 this.generatedCode.$setindex(element, code);
10415 } 10415 }
10416 // ********** Code for top level ************** 10416 // ********** Code for top level **************
10417 function unreachable() { 10417 function unreachable() {
10418 $throw(const$267/*const Exception("Internal Error (Leg): UNREACHABLE")*/); 10418 $throw(const$267/*const Exception("Internal Error (Leg): UNREACHABLE")*/);
10419 } 10419 }
10420 function leg_compile(world) { 10420 function compile(world) {
10421 var file = world.readFile(options.dartScript); 10421 var file = world.readFile(options.dartScript);
10422 var script = new leg_Script(file); 10422 var script = new leg_Script(file);
10423 var compiler = new WorldCompiler(world, script); 10423 var compiler = new WorldCompiler(world, script);
10424 return compiler.run(); 10424 return compiler.run();
10425 } 10425 }
10426 // ********** Library lang ************** 10426 // ********** Library lang **************
10427 // ********** Code for CodeWriter ************** 10427 // ********** Code for CodeWriter **************
10428 function CodeWriter() { 10428 function CodeWriter() {
10429 this._indentation = 0 10429 this._indentation = 0
10430 this._pendingIndent = false 10430 this._pendingIndent = false
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
10686 var file = $list.$index($i); 10686 var file = $list.$index($i);
10687 var filename = basename(file.filename); 10687 var filename = basename(file.filename);
10688 this.writer.comment(('// ********** Natives ' + filename + ' ************** ')); 10688 this.writer.comment(('// ********** Natives ' + filename + ' ************** '));
10689 this.writer.writeln(file.get$text()); 10689 this.writer.writeln(file.get$text());
10690 } 10690 }
10691 lib.topType.markUsed(); 10691 lib.topType.markUsed();
10692 var $list = this._orderValues(lib.types); 10692 var $list = this._orderValues(lib.types);
10693 for (var $i = 0;$i < $list.length; $i++) { 10693 for (var $i = 0;$i < $list.length; $i++) {
10694 var type = $list.$index($i); 10694 var type = $list.$index($i);
10695 if ($notnull_bool(type.get$isUsed()) && $notnull_bool(type.get$isClass())) { 10695 if ($notnull_bool(type.get$isUsed()) && $notnull_bool(type.get$isClass())) {
10696 this.writeType((type && type.is$Type())); 10696 this.writeType((type && type.is$lang_Type()));
10697 if ($notnull_bool(type.get$isGeneric())) { 10697 if ($notnull_bool(type.get$isGeneric())) {
10698 var $list0 = this._orderValues(type._concreteTypes); 10698 var $list0 = this._orderValues(type._concreteTypes);
10699 for (var $i0 = 0;$i0 < $list0.length; $i0++) { 10699 for (var $i0 = 0;$i0 < $list0.length; $i0++) {
10700 var ct = $list0.$index($i0); 10700 var ct = $list0.$index($i0);
10701 this.writeType((ct && ct.is$Type())); 10701 this.writeType((ct && ct.is$lang_Type()));
10702 } 10702 }
10703 } 10703 }
10704 } 10704 }
10705 if ($notnull_bool(type.get$isFunction()) && type.varStubs != null) { 10705 if ($notnull_bool(type.get$isFunction()) && type.varStubs != null) {
10706 this.writer.comment(('// ********** Code for ' + type.get$jsname() + ' *** ***********')); 10706 this.writer.comment(('// ********** Code for ' + type.get$jsname() + ' *** ***********'));
10707 this._writeDynamicStubs((type && type.is$Type())); 10707 this._writeDynamicStubs((type && type.is$lang_Type()));
10708 } 10708 }
10709 if (type.typeCheckCode != null) { 10709 if (type.typeCheckCode != null) {
10710 this.writer.writeln(type.typeCheckCode); 10710 this.writer.writeln(type.typeCheckCode);
10711 } 10711 }
10712 } 10712 }
10713 } 10713 }
10714 WorldGenerator.prototype.genMethod = function(meth, enclosingMethod) { 10714 WorldGenerator.prototype.genMethod = function(meth, enclosingMethod) {
10715 if (!$notnull_bool(meth.isGenerated) && !$notnull_bool(meth.get$isAbstract()) && $notnull_bool($ne(meth.get$definition(), null))) { 10715 if (!$notnull_bool(meth.isGenerated) && !$notnull_bool(meth.get$isAbstract()) && $notnull_bool($ne(meth.get$definition(), null))) {
10716 new MethodGenerator(meth, enclosingMethod).run(); 10716 new MethodGenerator(meth, enclosingMethod).run();
10717 } 10717 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
10778 } 10778 }
10779 } 10779 }
10780 } 10780 }
10781 if (!(type instanceof ConcreteType)) { 10781 if (!(type instanceof ConcreteType)) {
10782 this._maybeIsTest(type, type); 10782 this._maybeIsTest(type, type);
10783 } 10783 }
10784 if (type.get$genericType()._concreteTypes != null) { 10784 if (type.get$genericType()._concreteTypes != null) {
10785 var $list = this._orderValues(type.get$genericType()._concreteTypes); 10785 var $list = this._orderValues(type.get$genericType()._concreteTypes);
10786 for (var $i = 0;$i < $list.length; $i++) { 10786 for (var $i = 0;$i < $list.length; $i++) {
10787 var ct = $list.$index($i); 10787 var ct = $list.$index($i);
10788 this._maybeIsTest(type, (ct && ct.is$Type())); 10788 this._maybeIsTest(type, (ct && ct.is$lang_Type()));
10789 } 10789 }
10790 } 10790 }
10791 if (type.get$interfaces() != null) { 10791 if (type.get$interfaces() != null) {
10792 var seen = new HashSetImplementation(); 10792 var seen = new HashSetImplementation();
10793 var worklist = []; 10793 var worklist = [];
10794 worklist.addAll(type.get$interfaces()); 10794 worklist.addAll(type.get$interfaces());
10795 seen.addAll(type.get$interfaces()); 10795 seen.addAll(type.get$interfaces());
10796 while (!worklist.isEmpty()) { 10796 while (!worklist.isEmpty()) {
10797 var interface_ = worklist.removeLast(); 10797 var interface_ = worklist.removeLast();
10798 this._maybeIsTest(type, interface_.get$genericType()); 10798 this._maybeIsTest(type, interface_.get$genericType());
10799 if (interface_.get$genericType()._concreteTypes != null) { 10799 if (interface_.get$genericType()._concreteTypes != null) {
10800 var $list = this._orderValues(interface_.get$genericType()._concreteType s); 10800 var $list = this._orderValues(interface_.get$genericType()._concreteType s);
10801 for (var $i = 0;$i < $list.length; $i++) { 10801 for (var $i = 0;$i < $list.length; $i++) {
10802 var ct = $list.$index($i); 10802 var ct = $list.$index($i);
10803 this._maybeIsTest(type, (ct && ct.is$Type())); 10803 this._maybeIsTest(type, (ct && ct.is$lang_Type()));
10804 } 10804 }
10805 } 10805 }
10806 var $list = interface_.get$interfaces(); 10806 var $list = interface_.get$interfaces();
10807 for (var $i = interface_.get$interfaces().iterator$0(); $i.hasNext$0(); ) { 10807 for (var $i = interface_.get$interfaces().iterator$0(); $i.hasNext$0(); ) {
10808 var other = $i.next$0(); 10808 var other = $i.next$0();
10809 if (!seen.contains(other)) { 10809 if (!seen.contains(other)) {
10810 worklist.addLast(other); 10810 worklist.addLast(other);
10811 seen.add(other); 10811 seen.add(other);
10812 } 10812 }
10813 } 10813 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
10928 return WorldGenerator.prototype._compareMembers.bind(this); 10928 return WorldGenerator.prototype._compareMembers.bind(this);
10929 } 10929 }
10930 WorldGenerator.prototype.useMapFactory = function() { 10930 WorldGenerator.prototype.useMapFactory = function() {
10931 var $0; 10931 var $0;
10932 this.corejs.useMap = true; 10932 this.corejs.useMap = true;
10933 var factType = world.get$coreimpl().types.$index('HashMapImplementation'); 10933 var factType = world.get$coreimpl().types.$index('HashMapImplementation');
10934 var m = factType.resolveMember$1('\$setindex'); 10934 var m = factType.resolveMember$1('\$setindex');
10935 this.genMethod((($0 = m.get$members().$index(0)) && $0.is$Member())); 10935 this.genMethod((($0 = m.get$members().$index(0)) && $0.is$Member()));
10936 var c = factType.getConstructor$1(''); 10936 var c = factType.getConstructor$1('');
10937 this.genMethod((c && c.is$Member())); 10937 this.genMethod((c && c.is$Member()));
10938 return (factType && factType.is$Type()); 10938 return (factType && factType.is$lang_Type());
10939 } 10939 }
10940 // ********** Code for BlockScope ************** 10940 // ********** Code for BlockScope **************
10941 function BlockScope(enclosingMethod, parent, reentrant) { 10941 function BlockScope(enclosingMethod, parent, reentrant) {
10942 this.enclosingMethod = enclosingMethod; 10942 this.enclosingMethod = enclosingMethod;
10943 this.parent = parent; 10943 this.parent = parent;
10944 this.reentrant = reentrant; 10944 this.reentrant = reentrant;
10945 this._vars = $map([]); 10945 this._vars = $map([]);
10946 // Initializers done 10946 // Initializers done
10947 if ($notnull_bool(this.get$isMethodScope())) { 10947 if ($notnull_bool(this.get$isMethodScope())) {
10948 this._closedOver = new HashSetImplementation(); 10948 this._closedOver = new HashSetImplementation();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
11004 var ret = new Value(type, jsName, span, false); 11004 var ret = new Value(type, jsName, span, false);
11005 ret.isFinal = isFinal; 11005 ret.isFinal = isFinal;
11006 this._vars.$setindex(name, ret); 11006 this._vars.$setindex(name, ret);
11007 return (ret && ret.is$Value()); 11007 return (ret && ret.is$Value());
11008 } 11008 }
11009 BlockScope.prototype.declareParameter = function(p) { 11009 BlockScope.prototype.declareParameter = function(p) {
11010 return this.create(p.name, p.type, p.definition.span, false, true); 11010 return this.create(p.name, p.type, p.definition.span, false, true);
11011 } 11011 }
11012 BlockScope.prototype.declare = function(id) { 11012 BlockScope.prototype.declare = function(id) {
11013 var type = this.enclosingMethod.method.resolveType(id.type, false); 11013 var type = this.enclosingMethod.method.resolveType(id.type, false);
11014 return this.create(id.name.name, (type && type.is$Type()), id.span, false, fal se); 11014 return this.create(id.name.name, (type && type.is$lang_Type()), id.span, false , false);
11015 } 11015 }
11016 BlockScope.prototype.getRethrow = function() { 11016 BlockScope.prototype.getRethrow = function() {
11017 var scope = this; 11017 var scope = this;
11018 while (scope.rethrow == null && $notnull_bool($ne(scope.get$parent(), null))) { 11018 while (scope.rethrow == null && $notnull_bool($ne(scope.get$parent(), null))) {
11019 scope = scope.get$parent(); 11019 scope = scope.get$parent();
11020 } 11020 }
11021 return scope.rethrow; 11021 return scope.rethrow;
11022 } 11022 }
11023 BlockScope.prototype.lookup$1 = function($0) { 11023 BlockScope.prototype.lookup$1 = function($0) {
11024 return this.lookup($assert_String($0)); 11024 return this.lookup($assert_String($0));
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
11345 if ($notnull_bool($ne(initializedFields, null))) { 11345 if ($notnull_bool($ne(initializedFields, null))) {
11346 var $list = this.method.declaringType.get$members().getKeys(); 11346 var $list = this.method.declaringType.get$members().getKeys();
11347 for (var $i = this.method.declaringType.get$members().getKeys().iterator$0() ; $i.hasNext$0(); ) { 11347 for (var $i = this.method.declaringType.get$members().getKeys().iterator$0() ; $i.hasNext$0(); ) {
11348 var name = $i.next$0(); 11348 var name = $i.next$0();
11349 var member = this.method.declaringType.get$members().$index(name); 11349 var member = this.method.declaringType.get$members().$index(name);
11350 if ((member instanceof FieldMember) && $notnull_bool(member.get$isFinal()) && !$notnull_bool(member.get$isStatic()) && !$notnull_bool(initializedFields.co ntains$1(name))) { 11350 if ((member instanceof FieldMember) && $notnull_bool(member.get$isFinal()) && !$notnull_bool(member.get$isStatic()) && !$notnull_bool(initializedFields.co ntains$1(name))) {
11351 world.error(('Field "' + name + '" is final and was not initialized'), t his.method.get$definition().get$span()); 11351 world.error(('Field "' + name + '" is final and was not initialized'), t his.method.get$definition().get$span());
11352 } 11352 }
11353 } 11353 }
11354 } 11354 }
11355 this.visitStatementsInBlock((body && body.is$Statement())); 11355 this.visitStatementsInBlock((body && body.is$lang_Statement()));
11356 } 11356 }
11357 MethodGenerator.prototype._writeInitializerCall = function(node) { 11357 MethodGenerator.prototype._writeInitializerCall = function(node) {
11358 var contructorName = ''; 11358 var contructorName = '';
11359 var targetExp = node.target; 11359 var targetExp = node.target;
11360 if ((targetExp instanceof DotExpression)) { 11360 if ((targetExp instanceof DotExpression)) {
11361 var dot = (targetExp && targetExp.is$DotExpression()); 11361 var dot = (targetExp && targetExp.is$DotExpression());
11362 targetExp = dot.self; 11362 targetExp = dot.self;
11363 contructorName = dot.name.name; 11363 contructorName = dot.name.name;
11364 } 11364 }
11365 var target = null; 11365 var target = null;
11366 if ((targetExp instanceof SuperExpression)) { 11366 if ((targetExp instanceof SuperExpression)) {
11367 target = this._makeSuperValue((targetExp && targetExp.is$Node())); 11367 target = this._makeSuperValue((targetExp && targetExp.is$lang_Node()));
11368 } 11368 }
11369 else if ((targetExp instanceof ThisExpression)) { 11369 else if ((targetExp instanceof ThisExpression)) {
11370 target = this._makeThisValue((targetExp && targetExp.is$Node())); 11370 target = this._makeThisValue((targetExp && targetExp.is$lang_Node()));
11371 } 11371 }
11372 else { 11372 else {
11373 world.error('bad call in initializers', node.span); 11373 world.error('bad call in initializers', node.span);
11374 } 11374 }
11375 var m = target.type.getConstructor$1(contructorName); 11375 var m = target.type.getConstructor$1(contructorName);
11376 this.method.set$initDelegate(m); 11376 this.method.set$initDelegate(m);
11377 var other = m; 11377 var other = m;
11378 while ($notnull_bool($ne(other, null))) { 11378 while ($notnull_bool($ne(other, null))) {
11379 if ($notnull_bool($eq(other, this.method))) { 11379 if ($notnull_bool($eq(other, this.method))) {
11380 world.error('initialization cycle', node.span); 11380 world.error('initialization cycle', node.span);
(...skipping 13 matching lines...) Expand all
11394 var args = []; 11394 var args = [];
11395 var seenLabel = false; 11395 var seenLabel = false;
11396 for (var $i = 0;$i < arguments.length; $i++) { 11396 for (var $i = 0;$i < arguments.length; $i++) {
11397 var arg = arguments.$index($i); 11397 var arg = arguments.$index($i);
11398 if (arg.label != null) { 11398 if (arg.label != null) {
11399 seenLabel = true; 11399 seenLabel = true;
11400 } 11400 }
11401 else if ($notnull_bool(seenLabel)) { 11401 else if ($notnull_bool(seenLabel)) {
11402 world.error('bare argument can not follow named arguments', arg.get$span() ); 11402 world.error('bare argument can not follow named arguments', arg.get$span() );
11403 } 11403 }
11404 args.add$1(this.visitValue((($0 = arg.get$value()) && $0.is$Expression()))); 11404 args.add$1(this.visitValue((($0 = arg.get$value()) && $0.is$lang_Expression( ))));
11405 } 11405 }
11406 return new Arguments(arguments, args); 11406 return new Arguments(arguments, args);
11407 } 11407 }
11408 MethodGenerator._escapeString = function(text) { 11408 MethodGenerator._escapeString = function(text) {
11409 return text.replaceAll('\\', '\\\\').replaceAll('"', '\\"').replaceAll('\n', ' \\n').replaceAll('\r', '\\r'); 11409 return text.replaceAll('\\', '\\\\').replaceAll('"', '\\"').replaceAll('\n', ' \\n').replaceAll('\r', '\\r');
11410 } 11410 }
11411 MethodGenerator.prototype.visitStatementsInBlock = function(body) { 11411 MethodGenerator.prototype.visitStatementsInBlock = function(body) {
11412 if ((body instanceof BlockStatement)) { 11412 if ((body instanceof BlockStatement)) {
11413 var block = (body && body.is$BlockStatement()); 11413 var block = (body && body.is$BlockStatement());
11414 var $list = block.body; 11414 var $list = block.body;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
11449 } 11449 }
11450 MethodGenerator.prototype.visitVoid = function(node) { 11450 MethodGenerator.prototype.visitVoid = function(node) {
11451 if ((node instanceof PostfixExpression)) { 11451 if ((node instanceof PostfixExpression)) {
11452 var value = this.visitPostfixExpression((node && node.is$PostfixExpression() ), true); 11452 var value = this.visitPostfixExpression((node && node.is$PostfixExpression() ), true);
11453 value.checkFirstClass$1(node.span); 11453 value.checkFirstClass$1(node.span);
11454 return value; 11454 return value;
11455 } 11455 }
11456 return this.visitValue(node); 11456 return this.visitValue(node);
11457 } 11457 }
11458 MethodGenerator.prototype.visitDietStatement = function(node) { 11458 MethodGenerator.prototype.visitDietStatement = function(node) {
11459 var parser = new Parser(node.span.file, false, false, false, node.span.start); 11459 var parser = new lang_Parser(node.span.file, false, false, false, node.span.st art);
11460 this.visitStatementsInBlock(parser.block$0()); 11460 this.visitStatementsInBlock(parser.block$0());
11461 return false; 11461 return false;
11462 } 11462 }
11463 MethodGenerator.prototype.visitVariableDefinition = function(node) { 11463 MethodGenerator.prototype.visitVariableDefinition = function(node) {
11464 var $0; 11464 var $0;
11465 var isFinal = false; 11465 var isFinal = false;
11466 if (node.modifiers != null && $notnull_bool($eq(node.modifiers.$index(0).kind, 97/*TokenKind.FINAL*/))) { 11466 if (node.modifiers != null && $notnull_bool($eq(node.modifiers.$index(0).kind, 97/*TokenKind.FINAL*/))) {
11467 isFinal = true; 11467 isFinal = true;
11468 } 11468 }
11469 this.writer.write('var '); 11469 this.writer.write('var ');
11470 var type = this.method.resolveType(node.type, false); 11470 var type = this.method.resolveType(node.type, false);
11471 for (var i = 0; 11471 for (var i = 0;
11472 i < node.names.length; i++) { 11472 i < node.names.length; i++) {
11473 var thisType = type; 11473 var thisType = type;
11474 if (i > 0) { 11474 if (i > 0) {
11475 this.writer.write(', '); 11475 this.writer.write(', ');
11476 } 11476 }
11477 var name = node.names.$index(i).get$name(); 11477 var name = node.names.$index(i).get$name();
11478 var value = this.visitValue((($0 = node.values.$index(i)) && $0.is$Expressio n())); 11478 var value = this.visitValue((($0 = node.values.$index(i)) && $0.is$lang_Expr ession()));
11479 if ($notnull_bool(isFinal)) { 11479 if ($notnull_bool(isFinal)) {
11480 if ($notnull_bool(value == null)) { 11480 if ($notnull_bool(value == null)) {
11481 world.error('no value specified for final variable', node.span); 11481 world.error('no value specified for final variable', node.span);
11482 } 11482 }
11483 else { 11483 else {
11484 if ($notnull_bool(thisType.get$isVar())) thisType = value.type; 11484 if ($notnull_bool(thisType.get$isVar())) thisType = value.type;
11485 } 11485 }
11486 } 11486 }
11487 var val = this._scope.create($assert_String(name), (thisType && thisType.is$ Type()), node.names.$index(i).get$span(), $assert_bool(isFinal), false); 11487 var val = this._scope.create($assert_String(name), (thisType && thisType.is$ lang_Type()), node.names.$index(i).get$span(), $assert_bool(isFinal), false);
11488 if ($notnull_bool(value == null)) { 11488 if ($notnull_bool(value == null)) {
11489 if ($notnull_bool(this._scope.reentrant)) { 11489 if ($notnull_bool(this._scope.reentrant)) {
11490 this.writer.write(('' + val.code + ' = null')); 11490 this.writer.write(('' + val.code + ' = null'));
11491 } 11491 }
11492 else { 11492 else {
11493 this.writer.write(('' + val.code + '')); 11493 this.writer.write(('' + val.code + ''));
11494 } 11494 }
11495 } 11495 }
11496 else { 11496 else {
11497 value = value.convertTo$3(this, type, node.values.$index(i)); 11497 value = value.convertTo$3(this, type, node.values.$index(i));
11498 this.writer.write(('' + val.code + ' = ' + value.code + '')); 11498 this.writer.write(('' + val.code + ' = ' + value.code + ''));
11499 } 11499 }
11500 } 11500 }
11501 this.writer.writeln(';'); 11501 this.writer.writeln(';');
11502 return false; 11502 return false;
11503 } 11503 }
11504 MethodGenerator.prototype.visitFunctionDefinition = function(node) { 11504 MethodGenerator.prototype.visitFunctionDefinition = function(node) {
11505 var $0; 11505 var $0;
11506 var name = world.toJsIdentifier(node.name.name); 11506 var name = world.toJsIdentifier(node.name.name);
11507 var meth = this._makeLambdaMethod($assert_String(name), node); 11507 var meth = this._makeLambdaMethod($assert_String(name), node);
11508 var funcValue = this._scope.create($assert_String(name), (($0 = meth.get$funct ionType()) && $0.is$Type()), this.method.get$definition().get$span(), true, fals e); 11508 var funcValue = this._scope.create($assert_String(name), (($0 = meth.get$funct ionType()) && $0.is$lang_Type()), this.method.get$definition().get$span(), true, false);
11509 meth.generator.writeDefinition$2(this.writer); 11509 meth.generator.writeDefinition$2(this.writer);
11510 return false; 11510 return false;
11511 } 11511 }
11512 MethodGenerator.prototype.visitReturnStatement = function(node) { 11512 MethodGenerator.prototype.visitReturnStatement = function(node) {
11513 if (node.value == null) { 11513 if (node.value == null) {
11514 this.writer.writeln('return;'); 11514 this.writer.writeln('return;');
11515 } 11515 }
11516 else { 11516 else {
11517 if ($notnull_bool(this.method.get$isConstructor())) { 11517 if ($notnull_bool(this.method.get$isConstructor())) {
11518 world.error('return of value not allowed from constructor', node.span); 11518 world.error('return of value not allowed from constructor', node.span);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
11612 this.writer.write((' ' + test.code + '; ')); 11612 this.writer.write((' ' + test.code + '; '));
11613 } 11613 }
11614 else { 11614 else {
11615 this.writer.write('; '); 11615 this.writer.write('; ');
11616 } 11616 }
11617 var needsComma = false; 11617 var needsComma = false;
11618 var $list = node.step; 11618 var $list = node.step;
11619 for (var $i = 0;$i < $list.length; $i++) { 11619 for (var $i = 0;$i < $list.length; $i++) {
11620 var s = $list.$index($i); 11620 var s = $list.$index($i);
11621 if ($notnull_bool(needsComma)) this.writer.write(', '); 11621 if ($notnull_bool(needsComma)) this.writer.write(', ');
11622 var sv = this.visitVoid((s && s.is$Expression())); 11622 var sv = this.visitVoid((s && s.is$lang_Expression()));
11623 this.writer.write($assert_String(sv.code)); 11623 this.writer.write($assert_String(sv.code));
11624 needsComma = true; 11624 needsComma = true;
11625 } 11625 }
11626 this.writer.write(') '); 11626 this.writer.write(') ');
11627 this._pushBlock(true); 11627 this._pushBlock(true);
11628 node.body.visit(this); 11628 node.body.visit(this);
11629 this._popBlock(); 11629 this._popBlock();
11630 this._popBlock(); 11630 this._popBlock();
11631 return false; 11631 return false;
11632 } 11632 }
11633 MethodGenerator.prototype._isFinal = function(typeRef) { 11633 MethodGenerator.prototype._isFinal = function(typeRef) {
11634 if ((typeRef instanceof GenericTypeReference)) { 11634 if ((typeRef instanceof GenericTypeReference)) {
11635 typeRef = typeRef.baseType; 11635 typeRef = typeRef.baseType;
11636 } 11636 }
11637 return $notnull_bool($ne(typeRef, null)) && $notnull_bool(typeRef.get$isFinal( )); 11637 return $notnull_bool($ne(typeRef, null)) && $notnull_bool(typeRef.get$isFinal( ));
11638 } 11638 }
11639 MethodGenerator.prototype.visitForInStatement = function(node) { 11639 MethodGenerator.prototype.visitForInStatement = function(node) {
11640 var $0; 11640 var $0;
11641 var itemType = this.method.resolveType(node.item.type, false); 11641 var itemType = this.method.resolveType(node.item.type, false);
11642 var itemName = node.item.name.name; 11642 var itemName = node.item.name.name;
11643 var list = node.list.visit(this); 11643 var list = node.list.visit(this);
11644 this._pushBlock(true); 11644 this._pushBlock(true);
11645 var isFinal = this._isFinal(node.item.type); 11645 var isFinal = this._isFinal(node.item.type);
11646 var item = this._scope.create($assert_String(itemName), (itemType && itemType. is$Type()), node.item.name.span, isFinal, false); 11646 var item = this._scope.create($assert_String(itemName), (itemType && itemType. is$lang_Type()), node.item.name.span, isFinal, false);
11647 var listVar = (list && list.is$Value()); 11647 var listVar = (list && list.is$Value());
11648 if ($notnull_bool(list.needsTemp)) { 11648 if ($notnull_bool(list.needsTemp)) {
11649 listVar = this._scope.create('\$list', (($0 = list.type) && $0.is$Type()), n ull, false, false); 11649 listVar = this._scope.create('\$list', (($0 = list.type) && $0.is$lang_Type( )), null, false, false);
11650 this.writer.writeln(('var ' + listVar.code + ' = ' + list.code + ';')); 11650 this.writer.writeln(('var ' + listVar.code + ' = ' + list.code + ';'));
11651 } 11651 }
11652 if ($notnull_bool(list.type.get$isList())) { 11652 if ($notnull_bool(list.type.get$isList())) {
11653 var tmpi = this._scope.create('\$i', world.numType, null, false, false); 11653 var tmpi = this._scope.create('\$i', world.numType, null, false, false);
11654 this.writer.enterBlock(('for (var ' + tmpi.code + ' = 0;') + ('' + tmpi.code + ' < ' + listVar.code + '.length; ' + tmpi.code + '++) {')); 11654 this.writer.enterBlock(('for (var ' + tmpi.code + ' = 0;') + ('' + tmpi.code + ' < ' + listVar.code + '.length; ' + tmpi.code + '++) {'));
11655 var value = listVar.invoke(this, '\$index', node.list, new Arguments(null, [ tmpi]), false); 11655 var value = listVar.invoke(this, '\$index', node.list, new Arguments(null, [ tmpi]), false);
11656 this.writer.writeln(('var ' + item.code + ' = ' + value.code + ';')); 11656 this.writer.writeln(('var ' + item.code + ' = ' + value.code + ';'));
11657 } 11657 }
11658 else { 11658 else {
11659 this._pushBlock(false); 11659 this._pushBlock(false);
11660 var iterator = list.invoke$4(this, 'iterator', node.list, Arguments.get$EMPT Y()); 11660 var iterator = list.invoke$4(this, 'iterator', node.list, Arguments.get$EMPT Y());
11661 var tmpi = this._scope.create('\$i', (($0 = iterator.type) && $0.is$Type()), null, false, false); 11661 var tmpi = this._scope.create('\$i', (($0 = iterator.type) && $0.is$lang_Typ e()), null, false, false);
11662 var hasNext = tmpi.invoke$4(this, 'hasNext', node.list, Arguments.get$EMPTY( )); 11662 var hasNext = tmpi.invoke$4(this, 'hasNext', node.list, Arguments.get$EMPTY( ));
11663 var next = tmpi.invoke$4(this, 'next', node.list, Arguments.get$EMPTY()); 11663 var next = tmpi.invoke$4(this, 'next', node.list, Arguments.get$EMPTY());
11664 this.writer.enterBlock(('for (var ' + tmpi.code + ' = ' + iterator.code + '; ' + hasNext.code + '; ) {')); 11664 this.writer.enterBlock(('for (var ' + tmpi.code + ' = ' + iterator.code + '; ' + hasNext.code + '; ) {'));
11665 this.writer.writeln(('var ' + item.code + ' = ' + next.code + ';')); 11665 this.writer.writeln(('var ' + item.code + ' = ' + next.code + ';'));
11666 } 11666 }
11667 this.visitStatementsInBlock(node.body); 11667 this.visitStatementsInBlock(node.body);
11668 this.writer.exitBlock('}'); 11668 this.writer.exitBlock('}');
11669 this._popBlock(); 11669 this._popBlock();
11670 return false; 11670 return false;
11671 } 11671 }
(...skipping 25 matching lines...) Expand all
11697 if (catch_.trace != null) { 11697 if (catch_.trace != null) {
11698 var trace = this._scope.declare(catch_.trace); 11698 var trace = this._scope.declare(catch_.trace);
11699 this.writer.writeln(('var ' + trace.code + ' = \$stackTraceOf(' + ex.code + ');')); 11699 this.writer.writeln(('var ' + trace.code + ' = \$stackTraceOf(' + ex.code + ');'));
11700 world.gen.corejs.useStackTraceOf = true; 11700 world.gen.corejs.useStackTraceOf = true;
11701 } 11701 }
11702 this._genToDartException($assert_String(ex.code), node); 11702 this._genToDartException($assert_String(ex.code), node);
11703 if (!$notnull_bool(ex.type.get$isVarOrObject())) { 11703 if (!$notnull_bool(ex.type.get$isVarOrObject())) {
11704 var test = ex.instanceOf$3$isTrue$forceCheck(this, ex.type, catch_.get$exc eption().get$span(), false, true); 11704 var test = ex.instanceOf$3$isTrue$forceCheck(this, ex.type, catch_.get$exc eption().get$span(), false, true);
11705 this.writer.writeln(('if (' + test.code + ') throw ' + ex.code + ';')); 11705 this.writer.writeln(('if (' + test.code + ') throw ' + ex.code + ';'));
11706 } 11706 }
11707 this.visitStatementsInBlock((($0 = node.catches.$index(0).body) && $0.is$Sta tement())); 11707 this.visitStatementsInBlock((($0 = node.catches.$index(0).body) && $0.is$lan g_Statement()));
11708 this._popBlock(); 11708 this._popBlock();
11709 } 11709 }
11710 else if (node.catches.length > 0) { 11710 else if (node.catches.length > 0) {
11711 this._pushBlock(false); 11711 this._pushBlock(false);
11712 var ex = this._scope.create('\$ex', world.varType, null, false, false); 11712 var ex = this._scope.create('\$ex', world.varType, null, false, false);
11713 this._scope.rethrow = (ex && ex.is$Value()); 11713 this._scope.rethrow = (ex && ex.is$Value());
11714 this.writer.nextBlock(('} catch (' + ex.code + ') {')); 11714 this.writer.nextBlock(('} catch (' + ex.code + ') {'));
11715 var trace = null; 11715 var trace = null;
11716 if (node.catches.some((function (c) { 11716 if (node.catches.some((function (c) {
11717 return c.trace != null; 11717 return c.trace != null;
(...skipping 20 matching lines...) Expand all
11738 } 11738 }
11739 } 11739 }
11740 else if (i > 0) { 11740 else if (i > 0) {
11741 this.writer.nextBlock('} else {'); 11741 this.writer.nextBlock('} else {');
11742 } 11742 }
11743 this.writer.writeln(('var ' + tmp.code + ' = ' + ex.code + ';')); 11743 this.writer.writeln(('var ' + tmp.code + ' = ' + ex.code + ';'));
11744 if (catch_.trace != null) { 11744 if (catch_.trace != null) {
11745 var tmptrace = this._scope.declare(catch_.trace); 11745 var tmptrace = this._scope.declare(catch_.trace);
11746 this.writer.writeln(('var ' + tmptrace.code + ' = ' + trace.code + ';')) ; 11746 this.writer.writeln(('var ' + tmptrace.code + ' = ' + trace.code + ';')) ;
11747 } 11747 }
11748 this.visitStatementsInBlock((($0 = catch_.body) && $0.is$Statement())); 11748 this.visitStatementsInBlock((($0 = catch_.body) && $0.is$lang_Statement()) );
11749 this._popBlock(); 11749 this._popBlock();
11750 if ($notnull_bool(tmp.type.get$isVarOrObject())) { 11750 if ($notnull_bool(tmp.type.get$isVarOrObject())) {
11751 if (i + 1 < node.catches.length) { 11751 if (i + 1 < node.catches.length) {
11752 world.warning('Unreachable catch clause', (($0 = node.catches.$index(i + 1)) && $0.is$SourceSpan())); 11752 world.warning('Unreachable catch clause', (($0 = node.catches.$index(i + 1)) && $0.is$SourceSpan()));
11753 } 11753 }
11754 if (i > 0) { 11754 if (i > 0) {
11755 this.writer.exitBlock('}'); 11755 this.writer.exitBlock('}');
11756 } 11756 }
11757 needsRethrow = false; 11757 needsRethrow = false;
11758 break; 11758 break;
(...skipping 28 matching lines...) Expand all
11787 for (var i = 0; 11787 for (var i = 0;
11788 i < case_.cases.length; i++) { 11788 i < case_.cases.length; i++) {
11789 var expr = case_.cases.$index(i); 11789 var expr = case_.cases.$index(i);
11790 if ($notnull_bool(expr == null)) { 11790 if ($notnull_bool(expr == null)) {
11791 if (i < case_.cases.length - 1) { 11791 if (i < case_.cases.length - 1) {
11792 world.error('default clause must be the last case', case_.get$span()); 11792 world.error('default clause must be the last case', case_.get$span());
11793 } 11793 }
11794 this.writer.writeln('default:'); 11794 this.writer.writeln('default:');
11795 } 11795 }
11796 else { 11796 else {
11797 var value = this.visitValue((expr && expr.is$Expression())); 11797 var value = this.visitValue((expr && expr.is$lang_Expression()));
11798 this.writer.writeln(('case ' + value.code + ':')); 11798 this.writer.writeln(('case ' + value.code + ':'));
11799 } 11799 }
11800 } 11800 }
11801 this.writer.enterBlock(''); 11801 this.writer.enterBlock('');
11802 var caseExits = this._visitAllStatements(case_.statements, false); 11802 var caseExits = this._visitAllStatements(case_.statements, false);
11803 if ($notnull_bool($ne(case_, node.cases.$index(node.cases.length - 1))) && ! $notnull_bool(caseExits)) { 11803 if ($notnull_bool($ne(case_, node.cases.$index(node.cases.length - 1))) && ! $notnull_bool(caseExits)) {
11804 var span = case_.statements.$index(case_.statements.length - 1).get$span() ; 11804 var span = case_.statements.$index(case_.statements.length - 1).get$span() ;
11805 this.writer.writeln('\$throw(new FallThroughError());'); 11805 this.writer.writeln('\$throw(new FallThroughError());');
11806 world.gen.corejs.useThrow = true; 11806 world.gen.corejs.useThrow = true;
11807 } 11807 }
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
12096 switch (node.op.kind) { 12096 switch (node.op.kind) {
12097 case 16/*TokenKind.INCR*/: 12097 case 16/*TokenKind.INCR*/:
12098 case 17/*TokenKind.DECR*/: 12098 case 17/*TokenKind.DECR*/:
12099 12099
12100 if ($notnull_bool(value.type.get$isNum())) { 12100 if ($notnull_bool(value.type.get$isNum())) {
12101 return new Value(value.type, ('' + node.op + '' + value.code + ''), node .span, true); 12101 return new Value(value.type, ('' + node.op + '' + value.code + ''), node .span, true);
12102 } 12102 }
12103 else { 12103 else {
12104 var kind = (16/*TokenKind.INCR*/ == node.op.kind ? 42/*TokenKind.ADD*/ : 43/*TokenKind.SUB*/); 12104 var kind = (16/*TokenKind.INCR*/ == node.op.kind ? 42/*TokenKind.ADD*/ : 43/*TokenKind.SUB*/);
12105 var operand = new LiteralExpression(1, new TypeReference(node.span, worl d.numType), '1', node.span); 12105 var operand = new LiteralExpression(1, new TypeReference(node.span, worl d.numType), '1', node.span);
12106 return this._visitAssign($assert_num(kind), node.self, (operand && opera nd.is$Expression()), node, to$call$1(null)); 12106 return this._visitAssign($assert_num(kind), node.self, (operand && opera nd.is$lang_Expression()), node, to$call$1(null));
12107 } 12107 }
12108 12108
12109 case 19/*TokenKind.NOT*/: 12109 case 19/*TokenKind.NOT*/:
12110 12110
12111 if ($notnull_bool(value.type.get$isBool()) && $notnull_bool(value.get$isCo nst())) { 12111 if ($notnull_bool(value.type.get$isBool()) && $notnull_bool(value.get$isCo nst())) {
12112 var newVal = !$notnull_bool(value.get$actualValue()); 12112 var newVal = !$notnull_bool(value.get$actualValue());
12113 return EvaluatedValue.EvaluatedValue$factory((($0 = value.type) && $0.is $Type()), newVal, ('' + newVal + ''), node.span); 12113 return EvaluatedValue.EvaluatedValue$factory((($0 = value.type) && $0.is $lang_Type()), newVal, ('' + newVal + ''), node.span);
12114 } 12114 }
12115 else { 12115 else {
12116 var newVal = value.convertTo$3(this, world.nonNullBool, node); 12116 var newVal = value.convertTo$3(this, world.nonNullBool, node);
12117 return new Value(newVal.type, ('!' + newVal.code + ''), node.span, true) ; 12117 return new Value(newVal.type, ('!' + newVal.code + ''), node.span, true) ;
12118 } 12118 }
12119 12119
12120 case 42/*TokenKind.ADD*/: 12120 case 42/*TokenKind.ADD*/:
12121 12121
12122 return value.convertTo$3(this, world.numType, node); 12122 return value.convertTo$3(this, world.numType, node);
12123 12123
(...skipping 19 matching lines...) Expand all
12143 } 12143 }
12144 MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) { 12144 MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) {
12145 var $this = this; // closure support 12145 var $this = this; // closure support
12146 var value = this.visitValue(node.body); 12146 var value = this.visitValue(node.body);
12147 if ($notnull_bool(value.type.get$isNum())) { 12147 if ($notnull_bool(value.type.get$isNum())) {
12148 return new Value(value.type, ('' + value.code + '' + node.op + ''), node.spa n, true); 12148 return new Value(value.type, ('' + value.code + '' + node.op + ''), node.spa n, true);
12149 } 12149 }
12150 var kind = (16/*TokenKind.INCR*/ == node.op.kind) ? 42/*TokenKind.ADD*/ : 43/* TokenKind.SUB*/; 12150 var kind = (16/*TokenKind.INCR*/ == node.op.kind) ? 42/*TokenKind.ADD*/ : 43/* TokenKind.SUB*/;
12151 var operand = new LiteralExpression(1, new TypeReference(node.span, world.numT ype), '1', node.span); 12151 var operand = new LiteralExpression(1, new TypeReference(node.span, world.numT ype), '1', node.span);
12152 var tmpleft = null, left = null; 12152 var tmpleft = null, left = null;
12153 var ret = this._visitAssign($assert_num(kind), node.body, (operand && operand. is$Expression()), node, (function (l) { 12153 var ret = this._visitAssign($assert_num(kind), node.body, (operand && operand. is$lang_Expression()), node, (function (l) {
12154 if ($notnull_bool(isVoid)) { 12154 if ($notnull_bool(isVoid)) {
12155 return l; 12155 return l;
12156 } 12156 }
12157 else { 12157 else {
12158 left = l; 12158 left = l;
12159 tmpleft = $this.forceTemp((l && l.is$Value())); 12159 tmpleft = $this.forceTemp((l && l.is$Value()));
12160 return $this.assignTemp((tmpleft && tmpleft.is$Value()), (left && left.is$ Value())); 12160 return $this.assignTemp((tmpleft && tmpleft.is$Value()), (left && left.is$ Value()));
12161 } 12161 }
12162 }) 12162 })
12163 ); 12163 );
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
12196 world.error(('no matching constructor for ' + name + ''), node.span); 12196 world.error(('no matching constructor for ' + name + ''), node.span);
12197 return this._makeMissingValue($assert_String(name)); 12197 return this._makeMissingValue($assert_String(name));
12198 } 12198 }
12199 if ($notnull_bool(node.isConst)) { 12199 if ($notnull_bool(node.isConst)) {
12200 if (!$notnull_bool(m.get$isConst())) { 12200 if (!$notnull_bool(m.get$isConst())) {
12201 world.error('can\'t use const on a non-const constructor', node.span); 12201 world.error('can\'t use const on a non-const constructor', node.span);
12202 } 12202 }
12203 var $list = node.arguments; 12203 var $list = node.arguments;
12204 for (var $i = 0;$i < $list.length; $i++) { 12204 for (var $i = 0;$i < $list.length; $i++) {
12205 var arg = $list.$index($i); 12205 var arg = $list.$index($i);
12206 if (!$notnull_bool(this.visitValue((($0 = arg.get$value()) && $0.is$Expres sion())).get$isConst())) { 12206 if (!$notnull_bool(this.visitValue((($0 = arg.get$value()) && $0.is$lang_E xpression())).get$isConst())) {
12207 world.error('const constructor expects const arguments', arg.get$span()) ; 12207 world.error('const constructor expects const arguments', arg.get$span()) ;
12208 } 12208 }
12209 } 12209 }
12210 } 12210 }
12211 return m.invoke$4(this, node, null, this._makeArgs(node.arguments)); 12211 return m.invoke$4(this, node, null, this._makeArgs(node.arguments));
12212 } 12212 }
12213 MethodGenerator.prototype.visitListExpression = function(node) { 12213 MethodGenerator.prototype.visitListExpression = function(node) {
12214 var argsCode = []; 12214 var argsCode = [];
12215 var argValues = []; 12215 var argValues = [];
12216 var $list = node.values; 12216 var $list = node.values;
12217 for (var $i = 0;$i < $list.length; $i++) { 12217 for (var $i = 0;$i < $list.length; $i++) {
12218 var item = $list.$index($i); 12218 var item = $list.$index($i);
12219 var arg = this.visitValue((item && item.is$Expression())); 12219 var arg = this.visitValue((item && item.is$lang_Expression()));
12220 argValues.add$1(arg); 12220 argValues.add$1(arg);
12221 if ($notnull_bool(node.isConst)) { 12221 if ($notnull_bool(node.isConst)) {
12222 if (!$notnull_bool(arg.get$isConst())) { 12222 if (!$notnull_bool(arg.get$isConst())) {
12223 world.error('const list can only contain const values', item.get$span()) ; 12223 world.error('const list can only contain const values', item.get$span()) ;
12224 argsCode.add$1(arg.code); 12224 argsCode.add$1(arg.code);
12225 } 12225 }
12226 else { 12226 else {
12227 argsCode.add$1(arg.get$canonicalCode()); 12227 argsCode.add$1(arg.get$canonicalCode());
12228 } 12228 }
12229 } 12229 }
12230 else { 12230 else {
12231 argsCode.add$1(arg.code); 12231 argsCode.add$1(arg.code);
12232 } 12232 }
12233 } 12233 }
12234 world.get$coreimpl().types.$index('ListFactory').markUsed$0(); 12234 world.get$coreimpl().types.$index('ListFactory').markUsed$0();
12235 var code = ('[' + Strings.join((argsCode && argsCode.is$List$String()), ", ") + ']'); 12235 var code = ('[' + Strings.join((argsCode && argsCode.is$List$String()), ", ") + ']');
12236 var value = new Value(world.listType, code, node.span, true); 12236 var value = new Value(world.listType, code, node.span, true);
12237 if ($notnull_bool(node.isConst)) { 12237 if ($notnull_bool(node.isConst)) {
12238 var immutableList = world.get$coreimpl().types.$index('ImmutableList'); 12238 var immutableList = world.get$coreimpl().types.$index('ImmutableList');
12239 var immutableListCtor = immutableList.getConstructor$1('from'); 12239 var immutableListCtor = immutableList.getConstructor$1('from');
12240 var result = immutableListCtor.invoke$4(this, node, null, new Arguments(null , [value])); 12240 var result = immutableListCtor.invoke$4(this, node, null, new Arguments(null , [value]));
12241 value = world.gen.globalForConst(ConstListValue.ConstListValue$factory((immu tableList && immutableList.is$Type()), (argValues && argValues.is$List$Evaluated Value()), ('const ' + code + ''), $assert_String(result.code), node.span), (argV alues && argValues.is$List$Value())); 12241 value = world.gen.globalForConst(ConstListValue.ConstListValue$factory((immu tableList && immutableList.is$lang_Type()), (argValues && argValues.is$List$Eval uatedValue()), ('const ' + code + ''), $assert_String(result.code), node.span), (argValues && argValues.is$List$Value()));
12242 } 12242 }
12243 return value; 12243 return value;
12244 } 12244 }
12245 MethodGenerator.prototype.visitMapExpression = function(node) { 12245 MethodGenerator.prototype.visitMapExpression = function(node) {
12246 var $0; 12246 var $0;
12247 var mapImplType = world.gen.useMapFactory(); 12247 var mapImplType = world.gen.useMapFactory();
12248 var argValues = []; 12248 var argValues = [];
12249 var argsCode = []; 12249 var argsCode = [];
12250 for (var i = 0; 12250 for (var i = 0;
12251 i < node.items.length; i += 2) { 12251 i < node.items.length; i += 2) {
12252 var key = this.visitTypedValue((($0 = node.items.$index(i)) && $0.is$Express ion()), world.stringType); 12252 var key = this.visitTypedValue((($0 = node.items.$index(i)) && $0.is$lang_Ex pression()), world.stringType);
12253 var valueItem = node.items.$index(i + 1); 12253 var valueItem = node.items.$index(i + 1);
12254 var value = this.visitValue((valueItem && valueItem.is$Expression())); 12254 var value = this.visitValue((valueItem && valueItem.is$lang_Expression()));
12255 argValues.add$1(key); 12255 argValues.add$1(key);
12256 argValues.add$1(value); 12256 argValues.add$1(value);
12257 if ($notnull_bool(node.isConst)) { 12257 if ($notnull_bool(node.isConst)) {
12258 if (!$notnull_bool(key.get$isConst()) || !$notnull_bool(value.get$isConst( ))) { 12258 if (!$notnull_bool(key.get$isConst()) || !$notnull_bool(value.get$isConst( ))) {
12259 world.error('const map can only contain const values', valueItem.get$spa n()); 12259 world.error('const map can only contain const values', valueItem.get$spa n());
12260 argsCode.add$1(key.code); 12260 argsCode.add$1(key.code);
12261 argsCode.add$1(value.code); 12261 argsCode.add$1(value.code);
12262 } 12262 }
12263 else { 12263 else {
12264 argsCode.add$1(key.get$canonicalCode()); 12264 argsCode.add$1(key.get$canonicalCode());
12265 argsCode.add$1(value.get$canonicalCode()); 12265 argsCode.add$1(value.get$canonicalCode());
12266 } 12266 }
12267 } 12267 }
12268 else { 12268 else {
12269 argsCode.add$1(key.code); 12269 argsCode.add$1(key.code);
12270 argsCode.add$1(value.code); 12270 argsCode.add$1(value.code);
12271 } 12271 }
12272 } 12272 }
12273 var argList = ('[' + Strings.join((argsCode && argsCode.is$List$String()), ", ") + ']'); 12273 var argList = ('[' + Strings.join((argsCode && argsCode.is$List$String()), ", ") + ']');
12274 var code = ('\$map(' + argList + ')'); 12274 var code = ('\$map(' + argList + ')');
12275 if ($notnull_bool(node.isConst)) { 12275 if ($notnull_bool(node.isConst)) {
12276 var immutableMap = world.get$coreimpl().types.$index('ImmutableMap'); 12276 var immutableMap = world.get$coreimpl().types.$index('ImmutableMap');
12277 var immutableMapCtor = immutableMap.getConstructor$1(''); 12277 var immutableMapCtor = immutableMap.getConstructor$1('');
12278 var argsValue = new Value(world.listType, argList, node.span, true); 12278 var argsValue = new Value(world.listType, argList, node.span, true);
12279 var result = immutableMapCtor.invoke$4(this, node, null, new Arguments(null, [argsValue])); 12279 var result = immutableMapCtor.invoke$4(this, node, null, new Arguments(null, [argsValue]));
12280 var value = ConstMapValue.ConstMapValue$factory((immutableMap && immutableMa p.is$Type()), (argValues && argValues.is$List$EvaluatedValue()), code, $assert_S tring(result.code), node.span); 12280 var value = ConstMapValue.ConstMapValue$factory((immutableMap && immutableMa p.is$lang_Type()), (argValues && argValues.is$List$EvaluatedValue()), code, $ass ert_String(result.code), node.span);
12281 return world.gen.globalForConst(value, (argValues && argValues.is$List$Value ())); 12281 return world.gen.globalForConst(value, (argValues && argValues.is$List$Value ()));
12282 } 12282 }
12283 return new Value(mapImplType, code, node.span, true); 12283 return new Value(mapImplType, code, node.span, true);
12284 } 12284 }
12285 MethodGenerator.prototype.visitConditionalExpression = function(node) { 12285 MethodGenerator.prototype.visitConditionalExpression = function(node) {
12286 var $0; 12286 var $0;
12287 var test = this.visitBool(node.test); 12287 var test = this.visitBool(node.test);
12288 var trueBranch = this.visitValue(node.trueBranch); 12288 var trueBranch = this.visitValue(node.trueBranch);
12289 var falseBranch = this.visitValue(node.falseBranch); 12289 var falseBranch = this.visitValue(node.falseBranch);
12290 var code = ('' + test.code + ' ? ' + trueBranch.code + ' : ' + falseBranch.cod e + ''); 12290 var code = ('' + test.code + ' ? ' + trueBranch.code + ' : ' + falseBranch.cod e + '');
12291 return new Value(Type.union((($0 = trueBranch.type) && $0.is$Type()), (($0 = f alseBranch.type) && $0.is$Type())), code, node.span, true); 12291 return new Value(lang_Type.union((($0 = trueBranch.type) && $0.is$lang_Type()) , (($0 = falseBranch.type) && $0.is$lang_Type())), code, node.span, true);
12292 } 12292 }
12293 MethodGenerator.prototype.visitIsExpression = function(node) { 12293 MethodGenerator.prototype.visitIsExpression = function(node) {
12294 var value = this.visitValue(node.x); 12294 var value = this.visitValue(node.x);
12295 var type = this.method.resolveType(node.type, false); 12295 var type = this.method.resolveType(node.type, false);
12296 return value.instanceOf$4(this, type, node.span, node.isTrue); 12296 return value.instanceOf$4(this, type, node.span, node.isTrue);
12297 } 12297 }
12298 MethodGenerator.prototype.visitParenExpression = function(node) { 12298 MethodGenerator.prototype.visitParenExpression = function(node) {
12299 var $0; 12299 var $0;
12300 var body = this.visitValue(node.body); 12300 var body = this.visitValue(node.body);
12301 if ($notnull_bool(body.get$isConst())) { 12301 if ($notnull_bool(body.get$isConst())) {
12302 return EvaluatedValue.EvaluatedValue$factory((($0 = body.type) && $0.is$Type ()), body.get$actualValue(), ('(' + body.get$canonicalCode() + ')'), node.span); 12302 return EvaluatedValue.EvaluatedValue$factory((($0 = body.type) && $0.is$lang _Type()), body.get$actualValue(), ('(' + body.get$canonicalCode() + ')'), node.s pan);
12303 } 12303 }
12304 return new Value(body.type, ('(' + body.code + ')'), node.span, true); 12304 return new Value(body.type, ('(' + body.code + ')'), node.span, true);
12305 } 12305 }
12306 MethodGenerator.prototype.visitDotExpression = function(node) { 12306 MethodGenerator.prototype.visitDotExpression = function(node) {
12307 var target = node.self.visit(this); 12307 var target = node.self.visit(this);
12308 return target.get_$3(this, node.name.name, node.name); 12308 return target.get_$3(this, node.name.name, node.name);
12309 } 12309 }
12310 MethodGenerator.prototype.visitVarExpression = function(node) { 12310 MethodGenerator.prototype.visitVarExpression = function(node) {
12311 var name = node.name.name; 12311 var name = node.name.name;
12312 var ret = this._scope.lookup(name); 12312 var ret = this._scope.lookup(name);
(...skipping 18 matching lines...) Expand all
12331 } 12331 }
12332 MethodGenerator.prototype.visitLiteralExpression = function(node) { 12332 MethodGenerator.prototype.visitLiteralExpression = function(node) {
12333 var $0; 12333 var $0;
12334 var type = node.type.type; 12334 var type = node.type.type;
12335 $assert($ne(type, null), "type != null", "gen.dart", 2119, 12); 12335 $assert($ne(type, null), "type != null", "gen.dart", 2119, 12);
12336 if (!!(($0 = node.value) && $0.is$List)) { 12336 if (!!(($0 = node.value) && $0.is$List)) {
12337 var items = []; 12337 var items = [];
12338 var $list = node.value; 12338 var $list = node.value;
12339 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) { 12339 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) {
12340 var item = $i.next$0(); 12340 var item = $i.next$0();
12341 var val = this.visitValue((item && item.is$Expression())); 12341 var val = this.visitValue((item && item.is$lang_Expression()));
12342 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); 12342 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY());
12343 var code = val.code; 12343 var code = val.code;
12344 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr ession)) { 12344 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr ession)) {
12345 code = ('(' + code + ')'); 12345 code = ('(' + code + ')');
12346 } 12346 }
12347 items.add$1(code); 12347 items.add$1(code);
12348 } 12348 }
12349 return new Value(type, ('(' + Strings.join((items && items.is$List$String()) , " + ") + ')'), node.span, true); 12349 return new Value(type, ('(' + Strings.join((items && items.is$List$String()) , " + ") + ')'), node.span, true);
12350 } 12350 }
12351 var text = node.text; 12351 var text = node.text;
12352 if ($notnull_bool(type.get$isString())) { 12352 if ($notnull_bool(type.get$isString())) {
12353 if ($notnull_bool(text.startsWith$1('@'))) { 12353 if ($notnull_bool(text.startsWith$1('@'))) {
12354 text = MethodGenerator._escapeString(parseStringLiteral($assert_String(tex t))); 12354 text = MethodGenerator._escapeString(parseStringLiteral($assert_String(tex t)));
12355 text = ('"' + text + '"'); 12355 text = ('"' + text + '"');
12356 } 12356 }
12357 else if ($notnull_bool(isMultilineString($assert_String(text)))) { 12357 else if ($notnull_bool(isMultilineString($assert_String(text)))) {
12358 text = parseStringLiteral($assert_String(text)); 12358 text = parseStringLiteral($assert_String(text));
12359 text = text.replaceAll$2('\n', '\\n'); 12359 text = text.replaceAll$2('\n', '\\n');
12360 text = text.replaceAll$2('"', '\\"'); 12360 text = text.replaceAll$2('"', '\\"');
12361 text = ('"' + text + '"'); 12361 text = ('"' + text + '"');
12362 } 12362 }
12363 if (text !== node.text) { 12363 if (text !== node.text) {
12364 node.value = text; 12364 node.value = text;
12365 node.text = $assert_String(text); 12365 node.text = $assert_String(text);
12366 } 12366 }
12367 } 12367 }
12368 return EvaluatedValue.EvaluatedValue$factory((type && type.is$Type()), node.va lue, node.text, null); 12368 return EvaluatedValue.EvaluatedValue$factory((type && type.is$lang_Type()), no de.value, node.text, null);
12369 } 12369 }
12370 MethodGenerator.prototype.visitPostfixExpression$1 = function($0) { 12370 MethodGenerator.prototype.visitPostfixExpression$1 = function($0) {
12371 return this.visitPostfixExpression(($0 && $0.is$PostfixExpression()), false); 12371 return this.visitPostfixExpression(($0 && $0.is$PostfixExpression()), false);
12372 }; 12372 };
12373 MethodGenerator.prototype.writeDefinition$2 = function($0, $1) { 12373 MethodGenerator.prototype.writeDefinition$2 = function($0, $1) {
12374 return this.writeDefinition(($0 && $0.is$CodeWriter()), ($1 && $1.is$LambdaExp ression())); 12374 return this.writeDefinition(($0 && $0.is$CodeWriter()), ($1 && $1.is$LambdaExp ression()));
12375 }; 12375 };
12376 // ********** Code for Arguments ************** 12376 // ********** Code for Arguments **************
12377 function Arguments(nodes, values) { 12377 function Arguments(nodes, values) {
12378 this.nodes = nodes; 12378 this.nodes = nodes;
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
12618 } 12618 }
12619 if ($notnull_bool($ne(newRet, null))) { 12619 if ($notnull_bool($ne(newRet, null))) {
12620 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { 12620 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) {
12621 world.error(('conflicting types for "' + name + '"'), ret.get$span(), ne wRet.get$span()); 12621 world.error(('conflicting types for "' + name + '"'), ret.get$span(), ne wRet.get$span());
12622 } 12622 }
12623 else { 12623 else {
12624 ret = newRet; 12624 ret = newRet;
12625 } 12625 }
12626 } 12626 }
12627 } 12627 }
12628 return (ret && ret.is$Type()); 12628 return (ret && ret.is$lang_Type());
12629 } 12629 }
12630 Library.prototype.lookup = function(name, span) { 12630 Library.prototype.lookup = function(name, span) {
12631 var retType = this.findTypeByName(name); 12631 var retType = this.findTypeByName(name);
12632 var ret = null; 12632 var ret = null;
12633 if ($notnull_bool($ne(retType, null))) { 12633 if ($notnull_bool($ne(retType, null))) {
12634 ret = retType.get$typeMember(); 12634 ret = retType.get$typeMember();
12635 } 12635 }
12636 var newRet = this.topType.getMember(name); 12636 var newRet = this.topType.getMember(name);
12637 if ($notnull_bool($ne(newRet, null))) { 12637 if ($notnull_bool($ne(newRet, null))) {
12638 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { 12638 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
12727 _LibraryVisitor.prototype.addSource = function(source) { 12727 _LibraryVisitor.prototype.addSource = function(source) {
12728 var $this = this; // closure support 12728 var $this = this; // closure support
12729 if (this.library.sources.some((function (s) { 12729 if (this.library.sources.some((function (s) {
12730 return s.filename == source.filename; 12730 return s.filename == source.filename;
12731 }) 12731 })
12732 )) { 12732 )) {
12733 world.error(('duplicate source file "' + source.filename + '"')); 12733 world.error(('duplicate source file "' + source.filename + '"'));
12734 return; 12734 return;
12735 } 12735 }
12736 this.library.sources.add(source); 12736 this.library.sources.add(source);
12737 var parser = new Parser(source, options.dietParse, false, false, 0); 12737 var parser = new lang_Parser(source, options.dietParse, false, false, 0);
12738 var unit = parser.compilationUnit(); 12738 var unit = parser.compilationUnit();
12739 unit.forEach((function (def) { 12739 unit.forEach((function (def) {
12740 return def.visit$1($this); 12740 return def.visit$1($this);
12741 }) 12741 })
12742 ); 12742 );
12743 $assert(this.sources.length == 0 || $notnull_bool(this.isTop), "sources.length == 0 || isTop", "library.dart", 293, 12); 12743 $assert(this.sources.length == 0 || $notnull_bool(this.isTop), "sources.length == 0 || isTop", "library.dart", 293, 12);
12744 this.isTop = false; 12744 this.isTop = false;
12745 var newSources = this.sources; 12745 var newSources = this.sources;
12746 this.sources = []; 12746 this.sources = [];
12747 for (var $i = newSources.iterator$0(); $i.hasNext$0(); ) { 12747 for (var $i = newSources.iterator$0(); $i.hasNext$0(); ) {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
12943 var ret = new Parameter(this.definition); 12943 var ret = new Parameter(this.definition);
12944 ret.set$type(newType); 12944 ret.set$type(newType);
12945 ret.set$name(this.name); 12945 ret.set$name(this.name);
12946 ret.isInitializer = this.isInitializer; 12946 ret.isInitializer = this.isInitializer;
12947 return (ret && ret.is$Parameter()); 12947 return (ret && ret.is$Parameter());
12948 } 12948 }
12949 Parameter.prototype.get$isOptional = function() { 12949 Parameter.prototype.get$isOptional = function() {
12950 return this.definition != null && this.definition.value != null; 12950 return this.definition != null && this.definition.value != null;
12951 } 12951 }
12952 Parameter.prototype.copyWithNewType$1 = function($0) { 12952 Parameter.prototype.copyWithNewType$1 = function($0) {
12953 return this.copyWithNewType(($0 && $0.is$Type())); 12953 return this.copyWithNewType(($0 && $0.is$lang_Type()));
12954 }; 12954 };
12955 Parameter.prototype.genValue$2 = function($0, $1) { 12955 Parameter.prototype.genValue$2 = function($0, $1) {
12956 return this.genValue(($0 && $0.is$MethodMember()), ($1 && $1.is$MethodGenerato r())); 12956 return this.genValue(($0 && $0.is$MethodMember()), ($1 && $1.is$MethodGenerato r()));
12957 }; 12957 };
12958 Parameter.prototype.resolve$2 = function($0, $1) { 12958 Parameter.prototype.resolve$2 = function($0, $1) {
12959 return this.resolve(($0 && $0.is$Member()), ($1 && $1.is$Type())); 12959 return this.resolve(($0 && $0.is$Member()), ($1 && $1.is$lang_Type()));
12960 }; 12960 };
12961 // ********** Code for Member ************** 12961 // ********** Code for Member **************
12962 function Member(name, declaringType) { 12962 function Member(name, declaringType) {
12963 this.name = name; 12963 this.name = name;
12964 this.declaringType = declaringType; 12964 this.declaringType = declaringType;
12965 this.isGenerated = false; 12965 this.isGenerated = false;
12966 // Initializers done 12966 // Initializers done
12967 } 12967 }
12968 Member.prototype.is$Member = function(){return this;}; 12968 Member.prototype.is$Member = function(){return this;};
12969 Member.prototype.is$Named = function(){return this;}; 12969 Member.prototype.is$Named = function(){return this;};
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
13029 world.internalError('cannot have initializers', this.get$span()); 13029 world.internalError('cannot have initializers', this.get$span());
13030 } 13030 }
13031 Member.prototype.set$initDelegate = function(ctor) { 13031 Member.prototype.set$initDelegate = function(ctor) {
13032 world.internalError('cannot have initializers', this.get$span()); 13032 world.internalError('cannot have initializers', this.get$span());
13033 } 13033 }
13034 Member.prototype.get$inferredResult = function() { 13034 Member.prototype.get$inferredResult = function() {
13035 var t = this.get$returnType(); 13035 var t = this.get$returnType();
13036 if ($notnull_bool(t.get$isBool()) && ($notnull_bool(this.get$library().get$isC ore()) || $notnull_bool(this.get$library().get$isCoreImpl()))) { 13036 if ($notnull_bool(t.get$isBool()) && ($notnull_bool(this.get$library().get$isC ore()) || $notnull_bool(this.get$library().get$isCoreImpl()))) {
13037 return world.nonNullBool; 13037 return world.nonNullBool;
13038 } 13038 }
13039 return (t && t.is$Type()); 13039 return (t && t.is$lang_Type());
13040 } 13040 }
13041 Member.prototype.get$definition = function() { 13041 Member.prototype.get$definition = function() {
13042 return null; 13042 return null;
13043 } 13043 }
13044 Member.prototype.get$parameters = function() { 13044 Member.prototype.get$parameters = function() {
13045 return []; 13045 return [];
13046 } 13046 }
13047 Member.prototype.canInvoke = function(context, args) { 13047 Member.prototype.canInvoke = function(context, args) {
13048 return $notnull_bool(this.get$canGet()) && $notnull_bool(new Value(this.get$re turnType(), null, null, true).canInvoke(context, '\$call', args)); 13048 return $notnull_bool(this.get$canGet()) && $notnull_bool(new Value(this.get$re turnType(), null, null, true).canInvoke(context, '\$call', args));
13049 } 13049 }
(...skipping 21 matching lines...) Expand all
13071 } 13071 }
13072 else { 13072 else {
13073 return ('' + prefix + '' + this.name + '\$factory'); 13073 return ('' + prefix + '' + this.name + '\$factory');
13074 } 13074 }
13075 } 13075 }
13076 Member.prototype.resolveType = function(node, isRequired) { 13076 Member.prototype.resolveType = function(node, isRequired) {
13077 var type = this.declaringType.resolveType(node, isRequired); 13077 var type = this.declaringType.resolveType(node, isRequired);
13078 if ($notnull_bool(this.get$isStatic()) && $notnull_bool(type.get$hasTypeParams ())) { 13078 if ($notnull_bool(this.get$isStatic()) && $notnull_bool(type.get$hasTypeParams ())) {
13079 world.error('using type parameter in static context', node.span); 13079 world.error('using type parameter in static context', node.span);
13080 } 13080 }
13081 return (type && type.is$Type()); 13081 return (type && type.is$lang_Type());
13082 } 13082 }
13083 Member.prototype._get$3 = function($0, $1, $2) { 13083 Member.prototype._get$3 = function($0, $1, $2) {
13084 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value())); 13084 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()));
13085 }; 13085 };
13086 Member.prototype._set$4 = function($0, $1, $2, $3) { 13086 Member.prototype._set$4 = function($0, $1, $2, $3) {
13087 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Value())); 13087 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()));
13088 }; 13088 };
13089 Member.prototype.canInvoke$2 = function($0, $1) { 13089 Member.prototype.canInvoke$2 = function($0, $1) {
13090 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 13090 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( )));
13091 }; 13091 };
13092 Member.prototype.invoke$4 = function($0, $1, $2, $3) { 13092 Member.prototype.invoke$4 = function($0, $1, $2, $3) {
13093 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); 13093 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
13094 }; 13094 };
13095 Member.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 13095 Member.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) {
13096 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 13096 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
13097 }; 13097 };
13098 Member.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 13098 Member.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
13099 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); 13099 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4));
13100 }; 13100 };
13101 Member.prototype.provideFieldSyntax$0 = function() { 13101 Member.prototype.provideFieldSyntax$0 = function() {
13102 return this.provideFieldSyntax(); 13102 return this.provideFieldSyntax();
13103 }; 13103 };
13104 Member.prototype.providePropertySyntax$0 = function() { 13104 Member.prototype.providePropertySyntax$0 = function() {
13105 return this.providePropertySyntax(); 13105 return this.providePropertySyntax();
13106 }; 13106 };
13107 Member.prototype.resolve$1 = function($0) { 13107 Member.prototype.resolve$1 = function($0) {
13108 return this.resolve(($0 && $0.is$Type())); 13108 return this.resolve(($0 && $0.is$lang_Type()));
13109 }; 13109 };
13110 // ********** Code for TypeMember ************** 13110 // ********** Code for TypeMember **************
13111 function TypeMember(type) { 13111 function TypeMember(type) {
13112 this.type = type; 13112 this.type = type;
13113 // Initializers done 13113 // Initializers done
13114 Member.call(this, type.name, type.library.topType); 13114 Member.call(this, type.name, type.library.topType);
13115 } 13115 }
13116 $inherits(TypeMember, Member); 13116 $inherits(TypeMember, Member);
13117 TypeMember.prototype.is$TypeMember = function(){return this;}; 13117 TypeMember.prototype.is$TypeMember = function(){return this;};
13118 TypeMember.prototype.get$type = function() { return this.type; }; 13118 TypeMember.prototype.get$type = function() { return this.type; };
(...skipping 23 matching lines...) Expand all
13142 ret.isType = true; 13142 ret.isType = true;
13143 return (ret && ret.is$Value()); 13143 return (ret && ret.is$Value());
13144 } 13144 }
13145 TypeMember.prototype._set = function(context, node, target, value, isDynamic) { 13145 TypeMember.prototype._set = function(context, node, target, value, isDynamic) {
13146 world.error('can not set type', node.span); 13146 world.error('can not set type', node.span);
13147 } 13147 }
13148 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { 13148 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) {
13149 world.error('can not invoke type', node.span); 13149 world.error('can not invoke type', node.span);
13150 } 13150 }
13151 TypeMember.prototype._get$3 = function($0, $1, $2) { 13151 TypeMember.prototype._get$3 = function($0, $1, $2) {
13152 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), false); 13152 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
13153 }; 13153 };
13154 TypeMember.prototype._set$4 = function($0, $1, $2, $3) { 13154 TypeMember.prototype._set$4 = function($0, $1, $2, $3) {
13155 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Value()), false); 13155 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false);
13156 }; 13156 };
13157 TypeMember.prototype.canInvoke$2 = function($0, $1) { 13157 TypeMember.prototype.canInvoke$2 = function($0, $1) {
13158 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 13158 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( )));
13159 }; 13159 };
13160 TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) { 13160 TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) {
13161 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); 13161 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
13162 }; 13162 };
13163 TypeMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 13163 TypeMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) {
13164 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 13164 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
13165 }; 13165 };
13166 TypeMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 13166 TypeMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
13167 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); 13167 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4));
13168 }; 13168 };
13169 TypeMember.prototype.resolve$1 = function($0) { 13169 TypeMember.prototype.resolve$1 = function($0) {
13170 return this.resolve(($0 && $0.is$Type())); 13170 return this.resolve(($0 && $0.is$lang_Type()));
13171 }; 13171 };
13172 // ********** Code for FieldMember ************** 13172 // ********** Code for FieldMember **************
13173 function FieldMember(name, declaringType, definition, value) { 13173 function FieldMember(name, declaringType, definition, value) {
13174 this._providePropertySyntax = false 13174 this._providePropertySyntax = false
13175 this._computing = false 13175 this._computing = false
13176 this.definition = definition; 13176 this.definition = definition;
13177 this.value = value; 13177 this.value = value;
13178 this.isNative = false; 13178 this.isNative = false;
13179 // Initializers done 13179 // Initializers done
13180 Member.call(this, name, declaringType); 13180 Member.call(this, name, declaringType);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
13317 } 13317 }
13318 } 13318 }
13319 return new Value(this.type, ('' + target.code + '.' + this.get$jsname() + ''), node.span, true); 13319 return new Value(this.type, ('' + target.code + '.' + this.get$jsname() + ''), node.span, true);
13320 } 13320 }
13321 FieldMember.prototype._set = function(context, node, target, value, isDynamic) { 13321 FieldMember.prototype._set = function(context, node, target, value, isDynamic) {
13322 var lhs = this._get(context, node, target, isDynamic); 13322 var lhs = this._get(context, node, target, isDynamic);
13323 value = value.convertTo(context, this.type, node, isDynamic); 13323 value = value.convertTo(context, this.type, node, isDynamic);
13324 return new Value(this.type, ('' + lhs.code + ' = ' + value.code + ''), node.sp an, true); 13324 return new Value(this.type, ('' + lhs.code + ' = ' + value.code + ''), node.sp an, true);
13325 } 13325 }
13326 FieldMember.prototype._get$3 = function($0, $1, $2) { 13326 FieldMember.prototype._get$3 = function($0, $1, $2) {
13327 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), false); 13327 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
13328 }; 13328 };
13329 FieldMember.prototype._set$4 = function($0, $1, $2, $3) { 13329 FieldMember.prototype._set$4 = function($0, $1, $2, $3) {
13330 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Value()), false); 13330 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false);
13331 }; 13331 };
13332 FieldMember.prototype.computeValue$0 = function() { 13332 FieldMember.prototype.computeValue$0 = function() {
13333 return this.computeValue(); 13333 return this.computeValue();
13334 }; 13334 };
13335 FieldMember.prototype.provideFieldSyntax$0 = function() { 13335 FieldMember.prototype.provideFieldSyntax$0 = function() {
13336 return this.provideFieldSyntax(); 13336 return this.provideFieldSyntax();
13337 }; 13337 };
13338 FieldMember.prototype.providePropertySyntax$0 = function() { 13338 FieldMember.prototype.providePropertySyntax$0 = function() {
13339 return this.providePropertySyntax(); 13339 return this.providePropertySyntax();
13340 }; 13340 };
13341 FieldMember.prototype.resolve$1 = function($0) { 13341 FieldMember.prototype.resolve$1 = function($0) {
13342 return this.resolve(($0 && $0.is$Type())); 13342 return this.resolve(($0 && $0.is$lang_Type()));
13343 }; 13343 };
13344 // ********** Code for PropertyMember ************** 13344 // ********** Code for PropertyMember **************
13345 function PropertyMember(name, declaringType) { 13345 function PropertyMember(name, declaringType) {
13346 this._provideFieldSyntax = false 13346 this._provideFieldSyntax = false
13347 // Initializers done 13347 // Initializers done
13348 Member.call(this, name, declaringType); 13348 Member.call(this, name, declaringType);
13349 } 13349 }
13350 $inherits(PropertyMember, Member); 13350 $inherits(PropertyMember, Member);
13351 PropertyMember.prototype.is$PropertyMember = function(){return this;}; 13351 PropertyMember.prototype.is$PropertyMember = function(){return this;};
13352 PropertyMember.prototype.get$span = function() { 13352 PropertyMember.prototype.get$span = function() {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
13422 } 13422 }
13423 if (this.getter == null) this.getter = parent.getter; 13423 if (this.getter == null) this.getter = parent.getter;
13424 if (this.setter == null) this.setter = parent.setter; 13424 if (this.setter == null) this.setter = parent.setter;
13425 } 13425 }
13426 PropertyMember.prototype.resolve = function(inType) { 13426 PropertyMember.prototype.resolve = function(inType) {
13427 if (this.getter != null) this.getter.resolve(inType); 13427 if (this.getter != null) this.getter.resolve(inType);
13428 if (this.setter != null) this.setter.resolve(inType); 13428 if (this.setter != null) this.setter.resolve(inType);
13429 this.get$library()._addMember(this); 13429 this.get$library()._addMember(this);
13430 } 13430 }
13431 PropertyMember.prototype._get$3 = function($0, $1, $2) { 13431 PropertyMember.prototype._get$3 = function($0, $1, $2) {
13432 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), false); 13432 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
13433 }; 13433 };
13434 PropertyMember.prototype._set$4 = function($0, $1, $2, $3) { 13434 PropertyMember.prototype._set$4 = function($0, $1, $2, $3) {
13435 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Value()), false); 13435 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false);
13436 }; 13436 };
13437 PropertyMember.prototype.provideFieldSyntax$0 = function() { 13437 PropertyMember.prototype.provideFieldSyntax$0 = function() {
13438 return this.provideFieldSyntax(); 13438 return this.provideFieldSyntax();
13439 }; 13439 };
13440 PropertyMember.prototype.providePropertySyntax$0 = function() { 13440 PropertyMember.prototype.providePropertySyntax$0 = function() {
13441 return this.providePropertySyntax(); 13441 return this.providePropertySyntax();
13442 }; 13442 };
13443 PropertyMember.prototype.resolve$1 = function($0) { 13443 PropertyMember.prototype.resolve$1 = function($0) {
13444 return this.resolve(($0 && $0.is$Type())); 13444 return this.resolve(($0 && $0.is$lang_Type()));
13445 }; 13445 };
13446 // ********** Code for ConcreteMember ************** 13446 // ********** Code for ConcreteMember **************
13447 function ConcreteMember(name, declaringType, baseMember) { 13447 function ConcreteMember(name, declaringType, baseMember) {
13448 this.baseMember = baseMember; 13448 this.baseMember = baseMember;
13449 // Initializers done 13449 // Initializers done
13450 Member.call(this, name, declaringType); 13450 Member.call(this, name, declaringType);
13451 this.parameters = []; 13451 this.parameters = [];
13452 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring Type); 13452 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring Type);
13453 var $list = this.baseMember.get$parameters(); 13453 var $list = this.baseMember.get$parameters();
13454 for (var $i = 0;$i < $list.length; $i++) { 13454 for (var $i = 0;$i < $list.length; $i++) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
13531 } 13531 }
13532 ConcreteMember.prototype.get$initDelegate = function() { 13532 ConcreteMember.prototype.get$initDelegate = function() {
13533 return this.baseMember.get$initDelegate(); 13533 return this.baseMember.get$initDelegate();
13534 } 13534 }
13535 ConcreteMember.prototype.set$initDelegate = function(ctor) { 13535 ConcreteMember.prototype.set$initDelegate = function(ctor) {
13536 this.baseMember.set$initDelegate(ctor); 13536 this.baseMember.set$initDelegate(ctor);
13537 } 13537 }
13538 ConcreteMember.prototype.resolveType = function(node, isRequired) { 13538 ConcreteMember.prototype.resolveType = function(node, isRequired) {
13539 var $0; 13539 var $0;
13540 var type = this.baseMember.resolveType(node, isRequired); 13540 var type = this.baseMember.resolveType(node, isRequired);
13541 return (($0 = type.resolveTypeParams$1(this.declaringType)) && $0.is$Type()); 13541 return (($0 = type.resolveTypeParams$1(this.declaringType)) && $0.is$lang_Type ());
13542 } 13542 }
13543 ConcreteMember.prototype.override = function(other) { 13543 ConcreteMember.prototype.override = function(other) {
13544 return this.baseMember.override(other); 13544 return this.baseMember.override(other);
13545 } 13545 }
13546 ConcreteMember.prototype._get = function(context, node, target, isDynamic) { 13546 ConcreteMember.prototype._get = function(context, node, target, isDynamic) {
13547 var ret = this.baseMember._get(context, node, target, isDynamic); 13547 var ret = this.baseMember._get(context, node, target, isDynamic);
13548 return new Value(this.get$inferredResult(), ret.code, node.span, true); 13548 return new Value(this.get$inferredResult(), ret.code, node.span, true);
13549 } 13549 }
13550 ConcreteMember.prototype._set = function(context, node, target, value, isDynamic ) { 13550 ConcreteMember.prototype._set = function(context, node, target, value, isDynamic ) {
13551 var ret = this.baseMember._set(context, node, target, value, isDynamic); 13551 var ret = this.baseMember._set(context, node, target, value, isDynamic);
13552 return new Value(this.returnType, ret.code, node.span, true); 13552 return new Value(this.returnType, ret.code, node.span, true);
13553 } 13553 }
13554 ConcreteMember.prototype.invoke = function(context, node, target, args, isDynami c) { 13554 ConcreteMember.prototype.invoke = function(context, node, target, args, isDynami c) {
13555 var ret = this.baseMember.invoke(context, node, target, args, isDynamic); 13555 var ret = this.baseMember.invoke(context, node, target, args, isDynamic);
13556 var code = ret.code; 13556 var code = ret.code;
13557 if ($notnull_bool(this.get$isConstructor())) { 13557 if ($notnull_bool(this.get$isConstructor())) {
13558 code = code.replaceFirst$2(this.declaringType.get$genericType().get$jsname() , this.declaringType.get$jsname()); 13558 code = code.replaceFirst$2(this.declaringType.get$genericType().get$jsname() , this.declaringType.get$jsname());
13559 } 13559 }
13560 if ((this.baseMember instanceof MethodMember)) { 13560 if ((this.baseMember instanceof MethodMember)) {
13561 this.declaringType.genMethod(this); 13561 this.declaringType.genMethod(this);
13562 } 13562 }
13563 return new Value(this.get$inferredResult(), code, node.span, true); 13563 return new Value(this.get$inferredResult(), code, node.span, true);
13564 } 13564 }
13565 ConcreteMember.prototype._get$3 = function($0, $1, $2) { 13565 ConcreteMember.prototype._get$3 = function($0, $1, $2) {
13566 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), false); 13566 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
13567 }; 13567 };
13568 ConcreteMember.prototype._set$4 = function($0, $1, $2, $3) { 13568 ConcreteMember.prototype._set$4 = function($0, $1, $2, $3) {
13569 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Value()), false); 13569 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false);
13570 }; 13570 };
13571 ConcreteMember.prototype.canInvoke$2 = function($0, $1) { 13571 ConcreteMember.prototype.canInvoke$2 = function($0, $1) {
13572 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 13572 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( )));
13573 }; 13573 };
13574 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) { 13574 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) {
13575 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); 13575 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
13576 }; 13576 };
13577 ConcreteMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic ) { 13577 ConcreteMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic ) {
13578 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 13578 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
13579 }; 13579 };
13580 ConcreteMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 13580 ConcreteMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
13581 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); 13581 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4));
13582 }; 13582 };
13583 ConcreteMember.prototype.provideFieldSyntax$0 = function() { 13583 ConcreteMember.prototype.provideFieldSyntax$0 = function() {
13584 return this.provideFieldSyntax(); 13584 return this.provideFieldSyntax();
13585 }; 13585 };
13586 ConcreteMember.prototype.providePropertySyntax$0 = function() { 13586 ConcreteMember.prototype.providePropertySyntax$0 = function() {
13587 return this.providePropertySyntax(); 13587 return this.providePropertySyntax();
13588 }; 13588 };
13589 // ********** Code for MethodMember ************** 13589 // ********** Code for MethodMember **************
13590 function MethodMember(name, declaringType, definition) { 13590 function MethodMember(name, declaringType, definition) {
13591 this.isStatic = false 13591 this.isStatic = false
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
13891 return new Value(this.get$inferredResult(), code, node.span, true); 13891 return new Value(this.get$inferredResult(), code, node.span, true);
13892 } 13892 }
13893 MethodMember.prototype._invokeConstructor = function(context, node, target, args , argsString) { 13893 MethodMember.prototype._invokeConstructor = function(context, node, target, args , argsString) {
13894 this.declaringType.markUsed(); 13894 this.declaringType.markUsed();
13895 if (target != null) { 13895 if (target != null) {
13896 var code = (this.get$constructorName() != '') ? ('' + this.declaringType.get $jsname() + '.' + this.get$constructorName() + '\$ctor.call(' + argsString + ')' ) : ('' + this.declaringType.get$jsname() + '.call(' + argsString + ')'); 13896 var code = (this.get$constructorName() != '') ? ('' + this.declaringType.get $jsname() + '.' + this.get$constructorName() + '\$ctor.call(' + argsString + ')' ) : ('' + this.declaringType.get$jsname() + '.call(' + argsString + ')');
13897 return new Value(this.declaringType, code, node.span, true); 13897 return new Value(this.declaringType, code, node.span, true);
13898 } 13898 }
13899 else { 13899 else {
13900 var code = (this.get$constructorName() != '') ? ('new ' + this.declaringType .get$jsname() + '.' + this.get$constructorName() + '\$ctor(' + argsString + ')') : ('new ' + this.declaringType.get$jsname() + '(' + argsString + ')'); 13900 var code = (this.get$constructorName() != '') ? ('new ' + this.declaringType .get$jsname() + '.' + this.get$constructorName() + '\$ctor(' + argsString + ')') : ('new ' + this.declaringType.get$jsname() + '(' + argsString + ')');
13901 if ($notnull_bool(this.isConst) && (node instanceof NewExpression) && $notnu ll_bool(node.get$dynamic().get$isConst())) { 13901 if ($notnull_bool(this.isConst) && (node instanceof lang_NewExpression) && $ notnull_bool(node.get$dynamic().get$isConst())) {
13902 return this._invokeConstConstructor(node, $assert_String(code), target, ar gs); 13902 return this._invokeConstConstructor(node, $assert_String(code), target, ar gs);
13903 } 13903 }
13904 else { 13904 else {
13905 return new Value(this.declaringType, code, node.span, true); 13905 return new Value(this.declaringType, code, node.span, true);
13906 } 13906 }
13907 } 13907 }
13908 } 13908 }
13909 MethodMember.prototype._invokeConstConstructor = function(node, code, target, ar gs) { 13909 MethodMember.prototype._invokeConstConstructor = function(node, code, target, ar gs) {
13910 var $0; 13910 var $0;
13911 var fields = new HashMapImplementation(); 13911 var fields = new HashMapImplementation();
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
14258 var formal = $list.$index($i); 14258 var formal = $list.$index($i);
14259 var param = new Parameter(formal); 14259 var param = new Parameter(formal);
14260 param.resolve$2(this, inType); 14260 param.resolve$2(this, inType);
14261 this.parameters.add(param); 14261 this.parameters.add(param);
14262 } 14262 }
14263 if (!$notnull_bool(this.isLambda)) { 14263 if (!$notnull_bool(this.isLambda)) {
14264 this.get$library()._addMember(this); 14264 this.get$library()._addMember(this);
14265 } 14265 }
14266 } 14266 }
14267 MethodMember.prototype._get$3 = function($0, $1, $2) { 14267 MethodMember.prototype._get$3 = function($0, $1, $2) {
14268 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), false); 14268 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
14269 }; 14269 };
14270 MethodMember.prototype._set$4 = function($0, $1, $2, $3) { 14270 MethodMember.prototype._set$4 = function($0, $1, $2, $3) {
14271 return this._set(($0 && $0.is$MethodGenerator()), $1, ($2 && $2.is$Value()), ( $3 && $3.is$Value()), false); 14271 return this._set(($0 && $0.is$MethodGenerator()), $1, ($2 && $2.is$Value()), ( $3 && $3.is$Value()), false);
14272 }; 14272 };
14273 MethodMember.prototype.canInvoke$2 = function($0, $1) { 14273 MethodMember.prototype.canInvoke$2 = function($0, $1) {
14274 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 14274 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( )));
14275 }; 14275 };
14276 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) { 14276 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) {
14277 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); 14277 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
14278 }; 14278 };
14279 MethodMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 14279 MethodMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) {
14280 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 14280 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
14281 }; 14281 };
14282 MethodMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 14282 MethodMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
14283 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); 14283 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4));
14284 }; 14284 };
14285 MethodMember.prototype.namesInOrder$1 = function($0) { 14285 MethodMember.prototype.namesInOrder$1 = function($0) {
14286 return this.namesInOrder(($0 && $0.is$Arguments())); 14286 return this.namesInOrder(($0 && $0.is$Arguments()));
14287 }; 14287 };
14288 MethodMember.prototype.provideFieldSyntax$0 = function() { 14288 MethodMember.prototype.provideFieldSyntax$0 = function() {
14289 return this.provideFieldSyntax(); 14289 return this.provideFieldSyntax();
14290 }; 14290 };
14291 MethodMember.prototype.providePropertySyntax$0 = function() { 14291 MethodMember.prototype.providePropertySyntax$0 = function() {
14292 return this.providePropertySyntax(); 14292 return this.providePropertySyntax();
14293 }; 14293 };
14294 MethodMember.prototype.resolve$1 = function($0) { 14294 MethodMember.prototype.resolve$1 = function($0) {
14295 return this.resolve(($0 && $0.is$Type())); 14295 return this.resolve(($0 && $0.is$lang_Type()));
14296 }; 14296 };
14297 // ********** Code for MemberSet ************** 14297 // ********** Code for MemberSet **************
14298 function MemberSet(member, isVar) { 14298 function MemberSet(member, isVar) {
14299 this.name = member.name; 14299 this.name = member.name;
14300 this.members = [member]; 14300 this.members = [member];
14301 this.jsname = member.get$jsname(); 14301 this.jsname = member.get$jsname();
14302 this.isVar = isVar; 14302 this.isVar = isVar;
14303 // Initializers done 14303 // Initializers done
14304 } 14304 }
14305 MemberSet.prototype.is$MemberSet = function(){return this;}; 14305 MemberSet.prototype.is$MemberSet = function(){return this;};
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
14418 if ($notnull_bool(this.get$treatAsField())) { 14418 if ($notnull_bool(this.get$treatAsField())) {
14419 return new Value(returnValue.type, ('' + target.code + '.' + this.jsname + ' = ' + value.code + ''), node.span, true); 14419 return new Value(returnValue.type, ('' + target.code + '.' + this.jsname + ' = ' + value.code + ''), node.span, true);
14420 } 14420 }
14421 else { 14421 else {
14422 return new Value(returnValue.type, ('' + target.code + '.set\$' + this.jsn ame + '(' + value.code + ')'), node.span, true); 14422 return new Value(returnValue.type, ('' + target.code + '.set\$' + this.jsn ame + '(' + value.code + ')'), node.span, true);
14423 } 14423 }
14424 } 14424 }
14425 return returnValue; 14425 return returnValue;
14426 } 14426 }
14427 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) { 14427 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) {
14428 var $0;
14428 if ($notnull_bool(this.isVar) && !$notnull_bool(this.get$isOperator())) { 14429 if ($notnull_bool(this.isVar) && !$notnull_bool(this.get$isOperator())) {
14429 return this.invokeOnVar(context, node, target, args); 14430 return this.invokeOnVar(context, node, target, args);
14430 } 14431 }
14431 if (this.members.length == 1) { 14432 if (this.members.length == 1) {
14432 return this.members.$index(0).invoke$5(context, node, target, args, isDynami c); 14433 return (($0 = this.members.$index(0).invoke$5(context, node, target, args, i sDynamic)) && $0.is$Value());
14433 } 14434 }
14434 var targets = this.members.filter((function (m) { 14435 var targets = this.members.filter((function (m) {
14435 return m.canInvoke$2(context, args); 14436 return m.canInvoke$2(context, args);
14436 }) 14437 })
14437 ); 14438 );
14438 if (targets.length == 1) { 14439 if (targets.length == 1) {
14439 return targets.$index(0).invoke$5(context, node, target, args, isDynamic); 14440 return (($0 = targets.$index(0).invoke$5(context, node, target, args, isDyna mic)) && $0.is$Value());
14440 } 14441 }
14441 var returnValue = null; 14442 var returnValue = null;
14442 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) { 14443 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) {
14443 var member = $i.next$0(); 14444 var member = $i.next$0();
14444 var res = member.invoke$4$isDynamic(context, node, target, args, true); 14445 var res = member.invoke$4$isDynamic(context, node, target, args, true);
14445 returnValue = this._tryUnion(returnValue, res, node); 14446 returnValue = this._tryUnion(returnValue, (res && res.is$Value()), node);
14446 } 14447 }
14447 if (returnValue == null) { 14448 if (returnValue == null) {
14448 return this._makeError(node, target, 'method'); 14449 return this._makeError(node, target, 'method');
14449 } 14450 }
14450 if (returnValue.code == null) { 14451 if (returnValue.code == null) {
14451 if (this.name == '\$call') { 14452 if (this.name == '\$call') {
14452 return target._varCall(context, args); 14453 return target._varCall(context, args);
14453 } 14454 }
14454 else if ($notnull_bool(this.get$isOperator())) { 14455 else if ($notnull_bool(this.get$isOperator())) {
14455 return target.invokeSpecial(this.name, args, returnValue.type); 14456 return target.invokeSpecial(this.name, args, returnValue.type);
14456 } 14457 }
14457 else { 14458 else {
14458 return this.invokeOnVar(context, node, target, args); 14459 return this.invokeOnVar(context, node, target, args);
14459 } 14460 }
14460 } 14461 }
14461 return returnValue; 14462 return returnValue;
14462 } 14463 }
14463 MemberSet.prototype.invokeOnVar = function(context, node, target, args) { 14464 MemberSet.prototype.invokeOnVar = function(context, node, target, args) {
14464 var member = this.getVarMember(context, node, args); 14465 var member = this.getVarMember(context, node, args);
14465 return member.invoke$4(context, node, target, args); 14466 return member.invoke$4(context, node, target, args);
14466 } 14467 }
14467 MemberSet.prototype._tryUnion = function(x, y, node) { 14468 MemberSet.prototype._tryUnion = function(x, y, node) {
14468 if (x == null) return y; 14469 if (x == null) return y;
14469 var type = Type.union(x.type, y.type); 14470 var type = lang_Type.union(x.type, y.type);
14470 if (x.code == y.code) { 14471 if (x.code == y.code) {
14471 if ($notnull_bool($eq(type, x.type))) { 14472 if ($notnull_bool($eq(type, x.type))) {
14472 return x; 14473 return x;
14473 } 14474 }
14474 else if ($notnull_bool(x.get$isConst()) || $notnull_bool(y.get$isConst())) { 14475 else if ($notnull_bool(x.get$isConst()) || $notnull_bool(y.get$isConst())) {
14475 world.internalError("unexpected: union of const values "); 14476 world.internalError("unexpected: union of const values ");
14476 } 14477 }
14477 else { 14478 else {
14478 var ret = new Value(type, x.code, node.span, true); 14479 var ret = new Value(type, x.code, node.span, true);
14479 ret.isSuper = $notnull_bool(x.isSuper) && $notnull_bool(y.isSuper); 14480 ret.isSuper = $notnull_bool(x.isSuper) && $notnull_bool(y.isSuper);
(...skipping 14 matching lines...) Expand all
14494 var stub = world.objectType.varStubs.$index(stubName); 14495 var stub = world.objectType.varStubs.$index(stubName);
14495 if ($notnull_bool(stub == null)) { 14496 if ($notnull_bool(stub == null)) {
14496 var mset = context.findMembers(this.name).members; 14497 var mset = context.findMembers(this.name).members;
14497 var targets = mset.filter((function (m) { 14498 var targets = mset.filter((function (m) {
14498 return m.canInvoke$2(context, args); 14499 return m.canInvoke$2(context, args);
14499 }) 14500 })
14500 ); 14501 );
14501 var returnType = reduce(map((targets && targets.is$Iterable()), (function (t ) { 14502 var returnType = reduce(map((targets && targets.is$Iterable()), (function (t ) {
14502 return t.get$returnType(); 14503 return t.get$returnType();
14503 }) 14504 })
14504 ), Type.union); 14505 ), lang_Type.union);
14505 stub = new VarMethodSet($assert_String(stubName), targets, args, returnType) ; 14506 stub = new VarMethodSet($assert_String(stubName), targets, args, returnType) ;
14506 world.objectType.varStubs.$setindex(stubName, stub); 14507 world.objectType.varStubs.$setindex(stubName, stub);
14507 } 14508 }
14508 return (stub && stub.is$VarMember()); 14509 return (stub && stub.is$VarMember());
14509 } 14510 }
14510 MemberSet.prototype._get$3 = function($0, $1, $2) { 14511 MemberSet.prototype._get$3 = function($0, $1, $2) {
14511 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), false); 14512 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
14512 }; 14513 };
14513 MemberSet.prototype._set$4 = function($0, $1, $2, $3) { 14514 MemberSet.prototype._set$4 = function($0, $1, $2, $3) {
14514 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Value()), false); 14515 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false);
14515 }; 14516 };
14516 MemberSet.prototype.add$1 = function($0) { 14517 MemberSet.prototype.add$1 = function($0) {
14517 return this.add(($0 && $0.is$Member())); 14518 return this.add(($0 && $0.is$Member()));
14518 }; 14519 };
14519 MemberSet.prototype.canInvoke$2 = function($0, $1) { 14520 MemberSet.prototype.canInvoke$2 = function($0, $1) {
14520 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 14521 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( )));
14521 }; 14522 };
14522 MemberSet.prototype.invoke$4 = function($0, $1, $2, $3) { 14523 MemberSet.prototype.invoke$4 = function($0, $1, $2, $3) {
14523 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false); 14524 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
14524 }; 14525 };
14525 MemberSet.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 14526 MemberSet.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) {
14526 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 14527 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
14527 }; 14528 };
14528 MemberSet.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 14529 MemberSet.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
14529 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4)); 14530 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4));
14530 }; 14531 };
14531 MemberSet.prototype.toString$0 = function() { 14532 MemberSet.prototype.toString$0 = function() {
14532 return this.toString(); 14533 return this.toString();
14533 }; 14534 };
14534 // ********** Code for FactoryMap ************** 14535 // ********** Code for FactoryMap **************
14535 function FactoryMap() { 14536 function FactoryMap() {
14536 this.factories = $map([]); 14537 this.factories = $map([]);
14537 // Initializers done 14538 // Initializers done
14538 } 14539 }
14539 FactoryMap.prototype.getFactoriesFor = function(typeName) { 14540 FactoryMap.prototype.getFactoriesFor = function(typeName) {
(...skipping 16 matching lines...) Expand all
14556 constructors.forEach((function (_, member) { 14557 constructors.forEach((function (_, member) {
14557 f(member); 14558 f(member);
14558 }) 14559 })
14559 ); 14560 );
14560 }) 14561 })
14561 ); 14562 );
14562 } 14563 }
14563 FactoryMap.prototype.getFactory$2 = function($0, $1) { 14564 FactoryMap.prototype.getFactory$2 = function($0, $1) {
14564 return this.getFactory($assert_String($0), $assert_String($1)); 14565 return this.getFactory($assert_String($0), $assert_String($1));
14565 }; 14566 };
14566 // ********** Code for Token ************** 14567 // ********** Code for lang_Token **************
14567 function Token(kind, source, start, end) { 14568 function lang_Token(kind, source, start, end) {
14568 this.kind = kind; 14569 this.kind = kind;
14569 this.source = source; 14570 this.source = source;
14570 this.start = start; 14571 this.start = start;
14571 this.end = end; 14572 this.end = end;
14572 // Initializers done 14573 // Initializers done
14573 } 14574 }
14574 Token.prototype.get$source = function() { return this.source; }; 14575 lang_Token.prototype.get$source = function() { return this.source; };
14575 Token.prototype.get$text = function() { 14576 lang_Token.prototype.get$text = function() {
14576 return this.source.get$text().substring(this.start, this.end); 14577 return this.source.get$text().substring(this.start, this.end);
14577 } 14578 }
14578 Token.prototype.toString = function() { 14579 lang_Token.prototype.toString = function() {
14579 var kindText = TokenKind.kindToString(this.kind); 14580 var kindText = TokenKind.kindToString(this.kind);
14580 var actualText = this.get$text(); 14581 var actualText = this.get$text();
14581 if ($notnull_bool($ne(kindText, actualText))) { 14582 if ($notnull_bool($ne(kindText, actualText))) {
14582 if (actualText.length > 10) { 14583 if (actualText.length > 10) {
14583 actualText = actualText.substring$2(0, 8) + '...'; 14584 actualText = actualText.substring$2(0, 8) + '...';
14584 } 14585 }
14585 return ('' + kindText + '(' + actualText + ')'); 14586 return ('' + kindText + '(' + actualText + ')');
14586 } 14587 }
14587 else { 14588 else {
14588 return $assert_String(kindText); 14589 return $assert_String(kindText);
14589 } 14590 }
14590 } 14591 }
14591 Token.prototype.get$span = function() { 14592 lang_Token.prototype.get$span = function() {
14592 return new SourceSpan(this.source, this.start, this.end); 14593 return new SourceSpan(this.source, this.start, this.end);
14593 } 14594 }
14594 Token.prototype.toString$0 = function() { 14595 lang_Token.prototype.toString$0 = function() {
14595 return this.toString(); 14596 return this.toString();
14596 }; 14597 };
14597 // ********** Code for SourceFile ************** 14598 // ********** Code for SourceFile **************
14598 function SourceFile(filename, _text) { 14599 function SourceFile(filename, _text) {
14599 this.filename = filename; 14600 this.filename = filename;
14600 this._text = _text; 14601 this._text = _text;
14601 // Initializers done 14602 // Initializers done
14602 } 14603 }
14603 SourceFile.prototype.is$SourceFile = function(){return this;}; 14604 SourceFile.prototype.is$SourceFile = function(){return this;};
14604 SourceFile.prototype.is$Comparable = function(){return this;}; 14605 SourceFile.prototype.is$Comparable = function(){return this;};
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
14750 } 14751 }
14751 else { 14752 else {
14752 return false; 14753 return false;
14753 } 14754 }
14754 } 14755 }
14755 else { 14756 else {
14756 return false; 14757 return false;
14757 } 14758 }
14758 } 14759 }
14759 TokenizerBase.prototype._finishToken = function(kind) { 14760 TokenizerBase.prototype._finishToken = function(kind) {
14760 return new Token(kind, this._source, this._startIndex, this._lang_index); 14761 return new lang_Token(kind, this._source, this._startIndex, this._lang_index);
14761 } 14762 }
14762 TokenizerBase.prototype._errorToken = function() { 14763 TokenizerBase.prototype._errorToken = function() {
14763 return this._finishToken(65/*TokenKind.ERROR*/); 14764 return this._finishToken(65/*TokenKind.ERROR*/);
14764 } 14765 }
14765 TokenizerBase.prototype.finishWhitespace = function() { 14766 TokenizerBase.prototype.finishWhitespace = function() {
14766 while (this._lang_index < this._text.length) { 14767 while (this._lang_index < this._text.length) {
14767 if (!$notnull_bool(TokenizerHelpers.isWhitespace(this._text.charCodeAt(this. _lang_index++)))) { 14768 if (!$notnull_bool(TokenizerHelpers.isWhitespace(this._text.charCodeAt(this. _lang_index++)))) {
14768 this._lang_index--; 14769 this._lang_index--;
14769 if ($notnull_bool(this._skipWhitespace)) { 14770 if ($notnull_bool(this._skipWhitespace)) {
14770 return this.next(); 14771 return this.next();
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
15011 else { 15012 else {
15012 return false; 15013 return false;
15013 } 15014 }
15014 } 15015 }
15015 15016
15016 default: 15017 default:
15017 15018
15018 return true; 15019 return true;
15019 15020
15020 } 15021 }
15021 var n = Parser.parseHex(hex); 15022 var n = lang_Parser.parseHex(hex);
15022 return n < 0xD800 || n > 0xDFFF && n <= 0x10FFFF; 15023 return n < 0xD800 || n > 0xDFFF && n <= 0x10FFFF;
15023 } 15024 }
15024 TokenizerBase.prototype.finishDot = function() { 15025 TokenizerBase.prototype.finishDot = function() {
15025 if ($notnull_bool(TokenizerHelpers.isDigit(this._peekChar()))) { 15026 if ($notnull_bool(TokenizerHelpers.isDigit(this._peekChar()))) {
15026 this.eatDigits(); 15027 this.eatDigits();
15027 return this.finishNumberExtra(62/*TokenKind.DOUBLE*/); 15028 return this.finishNumberExtra(62/*TokenKind.DOUBLE*/);
15028 } 15029 }
15029 else { 15030 else {
15030 return this._finishToken(14/*TokenKind.DOT*/); 15031 return this._finishToken(14/*TokenKind.DOT*/);
15031 } 15032 }
(...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after
16397 16398
16398 } 16399 }
16399 } 16400 }
16400 TokenKind.kindFromAssign = function(kind) { 16401 TokenKind.kindFromAssign = function(kind) {
16401 if (kind == 20/*TokenKind.ASSIGN*/) return 0; 16402 if (kind == 20/*TokenKind.ASSIGN*/) return 0;
16402 if (kind > 20/*TokenKind.ASSIGN*/ && kind <= 32/*TokenKind.ASSIGN_MOD*/) { 16403 if (kind > 20/*TokenKind.ASSIGN*/ && kind <= 32/*TokenKind.ASSIGN_MOD*/) {
16403 return kind + (15)/*(ADD - ASSIGN_ADD)*/; 16404 return kind + (15)/*(ADD - ASSIGN_ADD)*/;
16404 } 16405 }
16405 return -1; 16406 return -1;
16406 } 16407 }
16407 // ********** Code for Parser ************** 16408 // ********** Code for lang_Parser **************
16408 function Parser(source, diet, throwOnIncomplete, optionalSemicolons, startOffset ) { 16409 function lang_Parser(source, diet, throwOnIncomplete, optionalSemicolons, startO ffset) {
16409 this.source = source; 16410 this.source = source;
16410 this.diet = diet; 16411 this.diet = diet;
16411 this.throwOnIncomplete = throwOnIncomplete; 16412 this.throwOnIncomplete = throwOnIncomplete;
16412 this.optionalSemicolons = optionalSemicolons; 16413 this.optionalSemicolons = optionalSemicolons;
16413 // Initializers done 16414 // Initializers done
16414 this.tokenizer = new Tokenizer(this.source, true, startOffset); 16415 this.tokenizer = new Tokenizer(this.source, true, startOffset);
16415 this._peekToken = this.tokenizer.next(); 16416 this._peekToken = this.tokenizer.next();
16416 this._previousToken = null; 16417 this._previousToken = null;
16417 this._inInitializers = false; 16418 this._inInitializers = false;
16418 } 16419 }
16419 Parser.prototype.get$source = function() { return this.source; }; 16420 lang_Parser.prototype.get$source = function() { return this.source; };
16420 Parser.prototype.isPrematureEndOfFile = function() { 16421 lang_Parser.prototype.isPrematureEndOfFile = function() {
16421 if ($notnull_bool(this.throwOnIncomplete) && $notnull_bool(this._maybeEat(1/*T okenKind.END_OF_FILE*/)) || $notnull_bool(this._maybeEat(68/*TokenKind.INCOMPLET E_MULTILINE_STRING_DQ*/)) || $notnull_bool(this._maybeEat(69/*TokenKind.INCOMPLE TE_MULTILINE_STRING_SQ*/))) { 16422 if ($notnull_bool(this.throwOnIncomplete) && $notnull_bool(this._maybeEat(1/*T okenKind.END_OF_FILE*/)) || $notnull_bool(this._maybeEat(68/*TokenKind.INCOMPLET E_MULTILINE_STRING_DQ*/)) || $notnull_bool(this._maybeEat(69/*TokenKind.INCOMPLE TE_MULTILINE_STRING_SQ*/))) {
16422 $throw(new IncompleteSourceException(this._previousToken)); 16423 $throw(new IncompleteSourceException(this._previousToken));
16423 } 16424 }
16424 else if ($notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) { 16425 else if ($notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) {
16425 this._lang_error('unexpected end of file', this._peekToken.get$span()); 16426 this._lang_error('unexpected end of file', this._peekToken.get$span());
16426 return true; 16427 return true;
16427 } 16428 }
16428 else { 16429 else {
16429 return false; 16430 return false;
16430 } 16431 }
16431 } 16432 }
16432 Parser.prototype._peek = function() { 16433 lang_Parser.prototype._peek = function() {
16433 return this._peekToken.kind; 16434 return this._peekToken.kind;
16434 } 16435 }
16435 Parser.prototype._lang_next = function() { 16436 lang_Parser.prototype._lang_next = function() {
16436 this._previousToken = this._peekToken; 16437 this._previousToken = this._peekToken;
16437 this._peekToken = this.tokenizer.next(); 16438 this._peekToken = this.tokenizer.next();
16438 return this._previousToken; 16439 return this._previousToken;
16439 } 16440 }
16440 Parser.prototype._peekKind = function(kind) { 16441 lang_Parser.prototype._peekKind = function(kind) {
16441 return this._peekToken.kind == kind; 16442 return this._peekToken.kind == kind;
16442 } 16443 }
16443 Parser.prototype._peekIdentifier = function() { 16444 lang_Parser.prototype._peekIdentifier = function() {
16444 return TokenKind.isIdentifier(this._peekToken.kind); 16445 return TokenKind.isIdentifier(this._peekToken.kind);
16445 } 16446 }
16446 Parser.prototype._maybeEat = function(kind) { 16447 lang_Parser.prototype._maybeEat = function(kind) {
16447 if (this._peekToken.kind == kind) { 16448 if (this._peekToken.kind == kind) {
16448 this._previousToken = this._peekToken; 16449 this._previousToken = this._peekToken;
16449 this._peekToken = this.tokenizer.next(); 16450 this._peekToken = this.tokenizer.next();
16450 return true; 16451 return true;
16451 } 16452 }
16452 else { 16453 else {
16453 return false; 16454 return false;
16454 } 16455 }
16455 } 16456 }
16456 Parser.prototype._eat = function(kind) { 16457 lang_Parser.prototype._eat = function(kind) {
16457 if (!$notnull_bool(this._maybeEat(kind))) { 16458 if (!$notnull_bool(this._maybeEat(kind))) {
16458 this._errorExpected(TokenKind.kindToString(kind)); 16459 this._errorExpected(TokenKind.kindToString(kind));
16459 } 16460 }
16460 } 16461 }
16461 Parser.prototype._eatSemicolon = function() { 16462 lang_Parser.prototype._eatSemicolon = function() {
16462 if ($notnull_bool(this.optionalSemicolons) && $notnull_bool(this._peekKind(1/* TokenKind.END_OF_FILE*/))) return; 16463 if ($notnull_bool(this.optionalSemicolons) && $notnull_bool(this._peekKind(1/* TokenKind.END_OF_FILE*/))) return;
16463 this._eat(10/*TokenKind.SEMICOLON*/); 16464 this._eat(10/*TokenKind.SEMICOLON*/);
16464 } 16465 }
16465 Parser.prototype._errorExpected = function(expected) { 16466 lang_Parser.prototype._errorExpected = function(expected) {
16466 if ($notnull_bool(this.throwOnIncomplete)) this.isPrematureEndOfFile(); 16467 if ($notnull_bool(this.throwOnIncomplete)) this.isPrematureEndOfFile();
16467 var tok = this._lang_next(); 16468 var tok = this._lang_next();
16468 var message = ('expected ' + expected + ', but found ' + tok + ''); 16469 var message = ('expected ' + expected + ', but found ' + tok + '');
16469 this._lang_error($assert_String(message), tok.get$span()); 16470 this._lang_error($assert_String(message), tok.get$span());
16470 } 16471 }
16471 Parser.prototype._lang_error = function(message, location) { 16472 lang_Parser.prototype._lang_error = function(message, location) {
16472 if (location == null) { 16473 if (location == null) {
16473 location = this._peekToken.get$span(); 16474 location = this._peekToken.get$span();
16474 } 16475 }
16475 world.fatal(message, location); 16476 world.fatal(message, location);
16476 } 16477 }
16477 Parser.prototype._skipBlock = function() { 16478 lang_Parser.prototype._skipBlock = function() {
16478 var depth = 1; 16479 var depth = 1;
16479 this._eat(6/*TokenKind.LBRACE*/); 16480 this._eat(6/*TokenKind.LBRACE*/);
16480 while (true) { 16481 while (true) {
16481 var tok = this._lang_next(); 16482 var tok = this._lang_next();
16482 if ($notnull_bool($eq(tok.kind, 6/*TokenKind.LBRACE*/))) { 16483 if ($notnull_bool($eq(tok.kind, 6/*TokenKind.LBRACE*/))) {
16483 depth += 1; 16484 depth += 1;
16484 } 16485 }
16485 else if ($notnull_bool($eq(tok.kind, 7/*TokenKind.RBRACE*/))) { 16486 else if ($notnull_bool($eq(tok.kind, 7/*TokenKind.RBRACE*/))) {
16486 depth -= 1; 16487 depth -= 1;
16487 if (depth == 0) return; 16488 if (depth == 0) return;
16488 } 16489 }
16489 else if ($notnull_bool($eq(tok.kind, 1/*TokenKind.END_OF_FILE*/))) { 16490 else if ($notnull_bool($eq(tok.kind, 1/*TokenKind.END_OF_FILE*/))) {
16490 this._lang_error('unexpected end of file during diet parse', tok.get$span( )); 16491 this._lang_error('unexpected end of file during diet parse', tok.get$span( ));
16491 return; 16492 return;
16492 } 16493 }
16493 } 16494 }
16494 } 16495 }
16495 Parser.prototype._makeSpan = function(start) { 16496 lang_Parser.prototype._makeSpan = function(start) {
16496 return new SourceSpan(this.source, start, this._previousToken.end); 16497 return new SourceSpan(this.source, start, this._previousToken.end);
16497 } 16498 }
16498 Parser.prototype.compilationUnit = function() { 16499 lang_Parser.prototype.compilationUnit = function() {
16499 var ret = []; 16500 var ret = [];
16500 this._maybeEat(13/*TokenKind.HASHBANG*/); 16501 this._maybeEat(13/*TokenKind.HASHBANG*/);
16501 while ($notnull_bool(this._peekKind(12/*TokenKind.HASH*/))) { 16502 while ($notnull_bool(this._peekKind(12/*TokenKind.HASH*/))) {
16502 ret.add$1(this.directive()); 16503 ret.add$1(this.directive());
16503 } 16504 }
16504 while (!$notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) { 16505 while (!$notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) {
16505 ret.add$1(this.topLevelDefinition()); 16506 ret.add$1(this.topLevelDefinition());
16506 } 16507 }
16507 return (ret && ret.is$List$Definition()); 16508 return (ret && ret.is$List$Definition());
16508 } 16509 }
16509 Parser.prototype.directive = function() { 16510 lang_Parser.prototype.directive = function() {
16510 var start = this._peekToken.start; 16511 var start = this._peekToken.start;
16511 this._eat(12/*TokenKind.HASH*/); 16512 this._eat(12/*TokenKind.HASH*/);
16512 var name = this.identifier(); 16513 var name = this.identifier();
16513 var args = this.arguments(); 16514 var args = this.arguments();
16514 this._eatSemicolon(); 16515 this._eatSemicolon();
16515 return new DirectiveDefinition(name, args, this._makeSpan(start)); 16516 return new DirectiveDefinition(name, args, this._makeSpan(start));
16516 } 16517 }
16517 Parser.prototype.topLevelDefinition = function() { 16518 lang_Parser.prototype.topLevelDefinition = function() {
16518 switch (this._peek()) { 16519 switch (this._peek()) {
16519 case 73/*TokenKind.CLASS*/: 16520 case 73/*TokenKind.CLASS*/:
16520 16521
16521 return this.classDefinition(73/*TokenKind.CLASS*/); 16522 return this.classDefinition(73/*TokenKind.CLASS*/);
16522 16523
16523 case 79/*TokenKind.INTERFACE*/: 16524 case 79/*TokenKind.INTERFACE*/:
16524 16525
16525 return this.classDefinition(79/*TokenKind.INTERFACE*/); 16526 return this.classDefinition(79/*TokenKind.INTERFACE*/);
16526 16527
16527 case 87/*TokenKind.TYPEDEF*/: 16528 case 87/*TokenKind.TYPEDEF*/:
16528 16529
16529 return this.functionTypeAlias(); 16530 return this.functionTypeAlias();
16530 16531
16531 default: 16532 default:
16532 16533
16533 return this.declaration(true); 16534 return this.declaration(true);
16534 16535
16535 } 16536 }
16536 } 16537 }
16537 Parser.prototype.classDefinition = function(kind) { 16538 lang_Parser.prototype.classDefinition = function(kind) {
16538 var start = this._peekToken.start; 16539 var start = this._peekToken.start;
16539 this._eat(kind); 16540 this._eat(kind);
16540 var name = this.identifier(); 16541 var name = this.identifier();
16541 var typeParams = null; 16542 var typeParams = null;
16542 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { 16543 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
16543 typeParams = this.typeParameters(); 16544 typeParams = this.typeParameters();
16544 } 16545 }
16545 var _extends = null; 16546 var _extends = null;
16546 if ($notnull_bool(this._maybeEat(74/*TokenKind.EXTENDS*/))) { 16547 if ($notnull_bool(this._maybeEat(74/*TokenKind.EXTENDS*/))) {
16547 _extends = this.typeList(); 16548 _extends = this.typeList();
(...skipping 15 matching lines...) Expand all
16563 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) { 16564 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) {
16564 if ($notnull_bool(this.isPrematureEndOfFile())) break; 16565 if ($notnull_bool(this.isPrematureEndOfFile())) break;
16565 body.add$1(this.declaration(true)); 16566 body.add$1(this.declaration(true));
16566 } 16567 }
16567 } 16568 }
16568 else { 16569 else {
16569 this._errorExpected('block starting with "{" or ";"'); 16570 this._errorExpected('block starting with "{" or ";"');
16570 } 16571 }
16571 return new TypeDefinition(kind == 73/*TokenKind.CLASS*/, name, typeParams, _ex tends, _implements, _native, _factory, body, this._makeSpan(start)); 16572 return new TypeDefinition(kind == 73/*TokenKind.CLASS*/, name, typeParams, _ex tends, _implements, _native, _factory, body, this._makeSpan(start));
16572 } 16573 }
16573 Parser.prototype.functionTypeAlias = function() { 16574 lang_Parser.prototype.functionTypeAlias = function() {
16574 var start = this._peekToken.start; 16575 var start = this._peekToken.start;
16575 this._eat(87/*TokenKind.TYPEDEF*/); 16576 this._eat(87/*TokenKind.TYPEDEF*/);
16576 var di = this.declaredIdentifier(false); 16577 var di = this.declaredIdentifier(false);
16577 var typeParams = null; 16578 var typeParams = null;
16578 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { 16579 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
16579 typeParams = this.typeParameters(); 16580 typeParams = this.typeParameters();
16580 } 16581 }
16581 var formals = this.formalParameterList(); 16582 var formals = this.formalParameterList();
16582 this._eatSemicolon(); 16583 this._eatSemicolon();
16583 var func = new FunctionDefinition(null, di.type, di.get$name(), formals, null, null, this._makeSpan(start)); 16584 var func = new FunctionDefinition(null, di.type, di.get$name(), formals, null, null, this._makeSpan(start));
16584 return new FunctionTypeDefinition(func, typeParams, this._makeSpan(start)); 16585 return new FunctionTypeDefinition(func, typeParams, this._makeSpan(start));
16585 } 16586 }
16586 Parser.prototype.initializers = function() { 16587 lang_Parser.prototype.initializers = function() {
16587 this._inInitializers = true; 16588 this._inInitializers = true;
16588 var ret = []; 16589 var ret = [];
16589 do { 16590 do {
16590 ret.add$1(this.expression()); 16591 ret.add$1(this.expression());
16591 } 16592 }
16592 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) 16593 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
16593 this._inInitializers = false; 16594 this._inInitializers = false;
16594 return ret; 16595 return ret;
16595 } 16596 }
16596 Parser.prototype.functionBody = function(inExpression) { 16597 lang_Parser.prototype.functionBody = function(inExpression) {
16597 var start = this._peekToken.start; 16598 var start = this._peekToken.start;
16598 if ($notnull_bool(this._maybeEat(9/*TokenKind.ARROW*/))) { 16599 if ($notnull_bool(this._maybeEat(9/*TokenKind.ARROW*/))) {
16599 var expr = this.expression(); 16600 var expr = this.expression();
16600 if (!$notnull_bool(inExpression)) { 16601 if (!$notnull_bool(inExpression)) {
16601 this._eatSemicolon(); 16602 this._eatSemicolon();
16602 } 16603 }
16603 return new ReturnStatement(expr, this._makeSpan(start)); 16604 return new ReturnStatement(expr, this._makeSpan(start));
16604 } 16605 }
16605 else if ($notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/))) { 16606 else if ($notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/))) {
16606 if ($notnull_bool(this.diet)) { 16607 if ($notnull_bool(this.diet)) {
(...skipping 14 matching lines...) Expand all
16621 this._eatSemicolon(); 16622 this._eatSemicolon();
16622 return new NativeStatement(nativeBody, this._makeSpan(start)); 16623 return new NativeStatement(nativeBody, this._makeSpan(start));
16623 } 16624 }
16624 else { 16625 else {
16625 return this.functionBody(inExpression); 16626 return this.functionBody(inExpression);
16626 } 16627 }
16627 } 16628 }
16628 } 16629 }
16629 this._lang_error('Expected function body (neither { nor => found)'); 16630 this._lang_error('Expected function body (neither { nor => found)');
16630 } 16631 }
16631 Parser.prototype.finishField = function(start, modifiers, type, name, value) { 16632 lang_Parser.prototype.finishField = function(start, modifiers, type, name, value ) {
16632 var names = [name]; 16633 var names = [name];
16633 var values = [value]; 16634 var values = [value];
16634 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 16635 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
16635 names.add$1(this.identifier()); 16636 names.add$1(this.identifier());
16636 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { 16637 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
16637 values.add$1(this.expression()); 16638 values.add$1(this.expression());
16638 } 16639 }
16639 else { 16640 else {
16640 values.add$1(); 16641 values.add$1();
16641 } 16642 }
16642 } 16643 }
16643 this._eatSemicolon(); 16644 this._eatSemicolon();
16644 return new VariableDefinition(modifiers, type, names, values, this._makeSpan($ assert_num(start))); 16645 return new VariableDefinition(modifiers, type, names, values, this._makeSpan($ assert_num(start)));
16645 } 16646 }
16646 Parser.prototype.finishDefinition = function(start, modifiers, di) { 16647 lang_Parser.prototype.finishDefinition = function(start, modifiers, di) {
16647 var $0; 16648 var $0;
16648 switch (this._peek()) { 16649 switch (this._peek()) {
16649 case 2/*TokenKind.LPAREN*/: 16650 case 2/*TokenKind.LPAREN*/:
16650 16651
16651 var formals = this.formalParameterList(); 16652 var formals = this.formalParameterList();
16652 var inits = null; 16653 var inits = null;
16653 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) { 16654 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) {
16654 inits = this.initializers(); 16655 inits = this.initializers();
16655 } 16656 }
16656 var body = this.functionBody(false); 16657 var body = this.functionBody(false);
(...skipping 13 matching lines...) Expand all
16670 16671
16671 return this.finishField(start, modifiers, di.type, di.get$name(), null); 16672 return this.finishField(start, modifiers, di.type, di.get$name(), null);
16672 16673
16673 default: 16674 default:
16674 16675
16675 this._errorExpected('declaration'); 16676 this._errorExpected('declaration');
16676 return null; 16677 return null;
16677 16678
16678 } 16679 }
16679 } 16680 }
16680 Parser.prototype.declaration = function(includeOperators) { 16681 lang_Parser.prototype.declaration = function(includeOperators) {
16681 var start = this._peekToken.start; 16682 var start = this._peekToken.start;
16682 if ($notnull_bool(this._peekKind(75/*TokenKind.FACTORY*/))) { 16683 if ($notnull_bool(this._peekKind(75/*TokenKind.FACTORY*/))) {
16683 return this.factoryConstructorDeclaration(); 16684 return this.factoryConstructorDeclaration();
16684 } 16685 }
16685 var modifiers = this._readModifiers(); 16686 var modifiers = this._readModifiers();
16686 return this.finishDefinition(start, modifiers, this.declaredIdentifier(include Operators)); 16687 return this.finishDefinition(start, modifiers, this.declaredIdentifier(include Operators));
16687 } 16688 }
16688 Parser.prototype.factoryConstructorDeclaration = function() { 16689 lang_Parser.prototype.factoryConstructorDeclaration = function() {
16689 var start = this._peekToken.start; 16690 var start = this._peekToken.start;
16690 var factoryToken = this._lang_next(); 16691 var factoryToken = this._lang_next();
16691 var names = [this.identifier()]; 16692 var names = [this.identifier()];
16692 while ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { 16693 while ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
16693 names.add$1(this.identifier()); 16694 names.add$1(this.identifier());
16694 } 16695 }
16695 var typeParams = null; 16696 var typeParams = null;
16696 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { 16697 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
16697 typeParams = this.typeParameters(); 16698 typeParams = this.typeParameters();
16698 } 16699 }
16699 var name = null; 16700 var name = null;
16700 var type = null; 16701 var type = null;
16701 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { 16702 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
16702 name = this.identifier(); 16703 name = this.identifier();
16703 } 16704 }
16704 else if ($notnull_bool(typeParams == null)) { 16705 else if ($notnull_bool(typeParams == null)) {
16705 if (names.length > 1) { 16706 if (names.length > 1) {
16706 name = names.removeLast$0(); 16707 name = names.removeLast$0();
16707 } 16708 }
16708 else { 16709 else {
16709 name = new Identifier('', names.$index(0).get$span()); 16710 name = new lang_Identifier('', names.$index(0).get$span());
16710 } 16711 }
16711 } 16712 }
16712 else { 16713 else {
16713 name = new Identifier('', names.$index(0).get$span()); 16714 name = new lang_Identifier('', names.$index(0).get$span());
16714 } 16715 }
16715 if (names.length > 1) { 16716 if (names.length > 1) {
16716 this._lang_error('unsupported qualified name for factory', names.$index(0).g et$span()); 16717 this._lang_error('unsupported qualified name for factory', names.$index(0).g et$span());
16717 } 16718 }
16718 type = new NameTypeReference(false, names.$index(0), null, names.$index(0).get $span()); 16719 type = new NameTypeReference(false, names.$index(0), null, names.$index(0).get $span());
16719 var di = new DeclaredIdentifier(type, name, this._makeSpan(start)); 16720 var di = new DeclaredIdentifier(type, name, this._makeSpan(start));
16720 return this.finishDefinition(start, [factoryToken], di); 16721 return this.finishDefinition(start, [factoryToken], di);
16721 } 16722 }
16722 Parser.prototype.statement = function() { 16723 lang_Parser.prototype.statement = function() {
16723 var $0; 16724 var $0;
16724 switch (this._peek()) { 16725 switch (this._peek()) {
16725 case 88/*TokenKind.BREAK*/: 16726 case 88/*TokenKind.BREAK*/:
16726 16727
16727 return (($0 = this.breakStatement()) && $0.is$Statement()); 16728 return (($0 = this.breakStatement()) && $0.is$lang_Statement());
16728 16729
16729 case 92/*TokenKind.CONTINUE*/: 16730 case 92/*TokenKind.CONTINUE*/:
16730 16731
16731 return (($0 = this.continueStatement()) && $0.is$Statement()); 16732 return (($0 = this.continueStatement()) && $0.is$lang_Statement());
16732 16733
16733 case 105/*TokenKind.RETURN*/: 16734 case 105/*TokenKind.RETURN*/:
16734 16735
16735 return (($0 = this.returnStatement()) && $0.is$Statement()); 16736 return (($0 = this.returnStatement()) && $0.is$lang_Statement());
16736 16737
16737 case 109/*TokenKind.THROW*/: 16738 case 109/*TokenKind.THROW*/:
16738 16739
16739 return (($0 = this.throwStatement()) && $0.is$Statement()); 16740 return (($0 = this.throwStatement()) && $0.is$lang_Statement());
16740 16741
16741 case 72/*TokenKind.ASSERT*/: 16742 case 72/*TokenKind.ASSERT*/:
16742 16743
16743 return (($0 = this.assertStatement()) && $0.is$Statement()); 16744 return (($0 = this.assertStatement()) && $0.is$lang_Statement());
16744 16745
16745 case 114/*TokenKind.WHILE*/: 16746 case 114/*TokenKind.WHILE*/:
16746 16747
16747 return this.whileStatement(); 16748 return this.whileStatement();
16748 16749
16749 case 94/*TokenKind.DO*/: 16750 case 94/*TokenKind.DO*/:
16750 16751
16751 return this.doStatement(); 16752 return this.doStatement();
16752 16753
16753 case 99/*TokenKind.FOR*/: 16754 case 99/*TokenKind.FOR*/:
16754 16755
16755 return (($0 = this.forStatement()) && $0.is$Statement()); 16756 return (($0 = this.forStatement()) && $0.is$lang_Statement());
16756 16757
16757 case 100/*TokenKind.IF*/: 16758 case 100/*TokenKind.IF*/:
16758 16759
16759 return this.ifStatement(); 16760 return this.ifStatement();
16760 16761
16761 case 107/*TokenKind.SWITCH*/: 16762 case 107/*TokenKind.SWITCH*/:
16762 16763
16763 return (($0 = this.switchStatement()) && $0.is$Statement()); 16764 return (($0 = this.switchStatement()) && $0.is$lang_Statement());
16764 16765
16765 case 111/*TokenKind.TRY*/: 16766 case 111/*TokenKind.TRY*/:
16766 16767
16767 return (($0 = this.tryStatement()) && $0.is$Statement()); 16768 return (($0 = this.tryStatement()) && $0.is$lang_Statement());
16768 16769
16769 case 6/*TokenKind.LBRACE*/: 16770 case 6/*TokenKind.LBRACE*/:
16770 16771
16771 return this.block(); 16772 return this.block();
16772 16773
16773 case 10/*TokenKind.SEMICOLON*/: 16774 case 10/*TokenKind.SEMICOLON*/:
16774 16775
16775 return this.emptyStatement(); 16776 return this.emptyStatement();
16776 16777
16777 case 97/*TokenKind.FINAL*/: 16778 case 97/*TokenKind.FINAL*/:
16778 16779
16779 return (($0 = this.declaration(false)) && $0.is$Statement()); 16780 return (($0 = this.declaration(false)) && $0.is$lang_Statement());
16780 16781
16781 case 112/*TokenKind.VAR*/: 16782 case 112/*TokenKind.VAR*/:
16782 16783
16783 return (($0 = this.declaration(false)) && $0.is$Statement()); 16784 return (($0 = this.declaration(false)) && $0.is$lang_Statement());
16784 16785
16785 default: 16786 default:
16786 16787
16787 return (($0 = this.finishExpressionAsStatement(this.expression())) && $0.i s$Statement()); 16788 return (($0 = this.finishExpressionAsStatement(this.expression())) && $0.i s$lang_Statement());
16788 16789
16789 } 16790 }
16790 } 16791 }
16791 Parser.prototype.finishExpressionAsStatement = function(expr) { 16792 lang_Parser.prototype.finishExpressionAsStatement = function(expr) {
16792 var $0; 16793 var $0;
16793 var start = expr.get$span().start; 16794 var start = expr.get$span().start;
16794 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) { 16795 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) {
16795 var label = this._makeLabel(expr); 16796 var label = this._makeLabel(expr);
16796 return new LabeledStatement(label, this.statement(), this._makeSpan(start)); 16797 return new LabeledStatement(label, this.statement(), this._makeSpan(start));
16797 } 16798 }
16798 if ((expr instanceof LambdaExpression)) { 16799 if ((expr instanceof LambdaExpression)) {
16799 if (!(expr.func.body instanceof BlockStatement)) { 16800 if (!(expr.func.body instanceof BlockStatement)) {
16800 this._eatSemicolon(); 16801 this._eatSemicolon();
16801 expr.func.span = this._makeSpan(start); 16802 expr.func.span = this._makeSpan(start);
(...skipping 17 matching lines...) Expand all
16819 var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference()) , 0, typeArgs); 16820 var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference()) , 0, typeArgs);
16820 var name = this.identifier(); 16821 var name = this.identifier();
16821 var value = null; 16822 var value = null;
16822 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { 16823 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
16823 value = this.expression(); 16824 value = this.expression();
16824 } 16825 }
16825 return this.finishField(expr.get$span().start, null, gt, name, value); 16826 return this.finishField(expr.get$span().start, null, gt, name, value);
16826 } 16827 }
16827 else { 16828 else {
16828 this._eatSemicolon(); 16829 this._eatSemicolon();
16829 return new ExpressionStatement(expr, this._makeSpan(expr.get$span().start)); 16830 return new lang_ExpressionStatement(expr, this._makeSpan(expr.get$span().sta rt));
16830 } 16831 }
16831 } 16832 }
16832 Parser.prototype.testCondition = function() { 16833 lang_Parser.prototype.testCondition = function() {
16833 this._eat(2/*TokenKind.LPAREN*/); 16834 this._eat(2/*TokenKind.LPAREN*/);
16834 var ret = this.expression(); 16835 var ret = this.expression();
16835 this._eat(3/*TokenKind.RPAREN*/); 16836 this._eat(3/*TokenKind.RPAREN*/);
16836 return (ret && ret.is$Expression()); 16837 return (ret && ret.is$lang_Expression());
16837 } 16838 }
16838 Parser.prototype.block = function() { 16839 lang_Parser.prototype.block = function() {
16839 var start = this._peekToken.start; 16840 var start = this._peekToken.start;
16840 this._eat(6/*TokenKind.LBRACE*/); 16841 this._eat(6/*TokenKind.LBRACE*/);
16841 var stmts = []; 16842 var stmts = [];
16842 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) { 16843 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) {
16843 if ($notnull_bool(this.isPrematureEndOfFile())) break; 16844 if ($notnull_bool(this.isPrematureEndOfFile())) break;
16844 stmts.add$1(this.statement()); 16845 stmts.add$1(this.statement());
16845 } 16846 }
16846 return new BlockStatement(stmts, this._makeSpan(start)); 16847 return new BlockStatement(stmts, this._makeSpan(start));
16847 } 16848 }
16848 Parser.prototype.emptyStatement = function() { 16849 lang_Parser.prototype.emptyStatement = function() {
16849 var start = this._peekToken.start; 16850 var start = this._peekToken.start;
16850 this._eat(10/*TokenKind.SEMICOLON*/); 16851 this._eat(10/*TokenKind.SEMICOLON*/);
16851 return new EmptyStatement(this._makeSpan(start)); 16852 return new EmptyStatement(this._makeSpan(start));
16852 } 16853 }
16853 Parser.prototype.ifStatement = function() { 16854 lang_Parser.prototype.ifStatement = function() {
16854 var start = this._peekToken.start; 16855 var start = this._peekToken.start;
16855 this._eat(100/*TokenKind.IF*/); 16856 this._eat(100/*TokenKind.IF*/);
16856 var test = this.testCondition(); 16857 var test = this.testCondition();
16857 var trueBranch = this.statement(); 16858 var trueBranch = this.statement();
16858 var falseBranch = null; 16859 var falseBranch = null;
16859 if ($notnull_bool(this._maybeEat(95/*TokenKind.ELSE*/))) { 16860 if ($notnull_bool(this._maybeEat(95/*TokenKind.ELSE*/))) {
16860 falseBranch = this.statement(); 16861 falseBranch = this.statement();
16861 } 16862 }
16862 return new IfStatement(test, trueBranch, falseBranch, this._makeSpan(start)); 16863 return new IfStatement(test, trueBranch, falseBranch, this._makeSpan(start));
16863 } 16864 }
16864 Parser.prototype.whileStatement = function() { 16865 lang_Parser.prototype.whileStatement = function() {
16865 var start = this._peekToken.start; 16866 var start = this._peekToken.start;
16866 this._eat(114/*TokenKind.WHILE*/); 16867 this._eat(114/*TokenKind.WHILE*/);
16867 var test = this.testCondition(); 16868 var test = this.testCondition();
16868 var body = this.statement(); 16869 var body = this.statement();
16869 return new WhileStatement(test, body, this._makeSpan(start)); 16870 return new WhileStatement(test, body, this._makeSpan(start));
16870 } 16871 }
16871 Parser.prototype.doStatement = function() { 16872 lang_Parser.prototype.doStatement = function() {
16872 var start = this._peekToken.start; 16873 var start = this._peekToken.start;
16873 this._eat(94/*TokenKind.DO*/); 16874 this._eat(94/*TokenKind.DO*/);
16874 var body = this.statement(); 16875 var body = this.statement();
16875 this._eat(114/*TokenKind.WHILE*/); 16876 this._eat(114/*TokenKind.WHILE*/);
16876 var test = this.testCondition(); 16877 var test = this.testCondition();
16877 this._eatSemicolon(); 16878 this._eatSemicolon();
16878 return new DoStatement(body, test, this._makeSpan(start)); 16879 return new DoStatement(body, test, this._makeSpan(start));
16879 } 16880 }
16880 Parser.prototype.forStatement = function() { 16881 lang_Parser.prototype.forStatement = function() {
16881 var start = this._peekToken.start; 16882 var start = this._peekToken.start;
16882 this._eat(99/*TokenKind.FOR*/); 16883 this._eat(99/*TokenKind.FOR*/);
16883 this._eat(2/*TokenKind.LPAREN*/); 16884 this._eat(2/*TokenKind.LPAREN*/);
16884 var init = this.forInitializerStatement(start); 16885 var init = this.forInitializerStatement(start);
16885 if ((init instanceof ForInStatement)) { 16886 if ((init instanceof ForInStatement)) {
16886 return init; 16887 return init;
16887 } 16888 }
16888 var test = null; 16889 var test = null;
16889 if (!$notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) { 16890 if (!$notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
16890 test = this.expression(); 16891 test = this.expression();
16891 this._eatSemicolon(); 16892 this._eatSemicolon();
16892 } 16893 }
16893 var step = []; 16894 var step = [];
16894 if (!$notnull_bool(this._maybeEat(3/*TokenKind.RPAREN*/))) { 16895 if (!$notnull_bool(this._maybeEat(3/*TokenKind.RPAREN*/))) {
16895 step.add$1(this.expression()); 16896 step.add$1(this.expression());
16896 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 16897 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
16897 step.add$1(this.expression()); 16898 step.add$1(this.expression());
16898 } 16899 }
16899 this._eat(3/*TokenKind.RPAREN*/); 16900 this._eat(3/*TokenKind.RPAREN*/);
16900 } 16901 }
16901 var body = this.statement(); 16902 var body = this.statement();
16902 return new ForStatement(init, test, step, body, this._makeSpan(start)); 16903 return new ForStatement(init, test, step, body, this._makeSpan(start));
16903 } 16904 }
16904 Parser.prototype.forInitializerStatement = function(start) { 16905 lang_Parser.prototype.forInitializerStatement = function(start) {
16905 var $0; 16906 var $0;
16906 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) { 16907 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
16907 return null; 16908 return null;
16908 } 16909 }
16909 else { 16910 else {
16910 var init = this.expression(); 16911 var init = this.expression();
16911 if ($notnull_bool(this._peekKind(11/*TokenKind.COMMA*/)) && $notnull_bool(th is._isBin(init, 52/*TokenKind.LT*/))) { 16912 if ($notnull_bool(this._peekKind(11/*TokenKind.COMMA*/)) && $notnull_bool(th is._isBin(init, 52/*TokenKind.LT*/))) {
16912 this._eat(11/*TokenKind.COMMA*/); 16913 this._eat(11/*TokenKind.COMMA*/);
16913 var baseType = this._makeType(init.x); 16914 var baseType = this._makeType(init.x);
16914 var typeArgs = [this._makeType(init.y)]; 16915 var typeArgs = [this._makeType(init.y)];
16915 var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference( )), 0, typeArgs); 16916 var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference( )), 0, typeArgs);
16916 var name = this.identifier(); 16917 var name = this.identifier();
16917 init = new DeclaredIdentifier(gt, name, this._makeSpan(init.get$span().sta rt)); 16918 init = new DeclaredIdentifier(gt, name, this._makeSpan(init.get$span().sta rt));
16918 } 16919 }
16919 if ($notnull_bool(this._maybeEat(101/*TokenKind.IN*/))) { 16920 if ($notnull_bool(this._maybeEat(101/*TokenKind.IN*/))) {
16920 return this._finishForIn(start, (($0 = this._makeDeclaredIdentifier(init)) && $0.is$DeclaredIdentifier())); 16921 return this._finishForIn(start, (($0 = this._makeDeclaredIdentifier(init)) && $0.is$DeclaredIdentifier()));
16921 } 16922 }
16922 else { 16923 else {
16923 return this.finishExpressionAsStatement(init); 16924 return this.finishExpressionAsStatement(init);
16924 } 16925 }
16925 } 16926 }
16926 } 16927 }
16927 Parser.prototype._finishForIn = function(start, di) { 16928 lang_Parser.prototype._finishForIn = function(start, di) {
16928 var expr = this.expression(); 16929 var expr = this.expression();
16929 this._eat(3/*TokenKind.RPAREN*/); 16930 this._eat(3/*TokenKind.RPAREN*/);
16930 var body = this.statement(); 16931 var body = this.statement();
16931 return new ForInStatement(di, expr, body, this._makeSpan(start)); 16932 return new ForInStatement(di, expr, body, this._makeSpan(start));
16932 } 16933 }
16933 Parser.prototype.tryStatement = function() { 16934 lang_Parser.prototype.tryStatement = function() {
16934 var start = this._peekToken.start; 16935 var start = this._peekToken.start;
16935 this._eat(111/*TokenKind.TRY*/); 16936 this._eat(111/*TokenKind.TRY*/);
16936 var body = this.block(); 16937 var body = this.block();
16937 var catches = []; 16938 var catches = [];
16938 while ($notnull_bool(this._peekKind(90/*TokenKind.CATCH*/))) { 16939 while ($notnull_bool(this._peekKind(90/*TokenKind.CATCH*/))) {
16939 catches.add$1(this.catchNode()); 16940 catches.add$1(this.catchNode());
16940 } 16941 }
16941 var finallyBlock = null; 16942 var finallyBlock = null;
16942 if ($notnull_bool(this._maybeEat(98/*TokenKind.FINALLY*/))) { 16943 if ($notnull_bool(this._maybeEat(98/*TokenKind.FINALLY*/))) {
16943 finallyBlock = this.block(); 16944 finallyBlock = this.block();
16944 } 16945 }
16945 return new TryStatement(body, catches, finallyBlock, this._makeSpan(start)); 16946 return new TryStatement(body, catches, finallyBlock, this._makeSpan(start));
16946 } 16947 }
16947 Parser.prototype.catchNode = function() { 16948 lang_Parser.prototype.catchNode = function() {
16948 var start = this._peekToken.start; 16949 var start = this._peekToken.start;
16949 this._eat(90/*TokenKind.CATCH*/); 16950 this._eat(90/*TokenKind.CATCH*/);
16950 this._eat(2/*TokenKind.LPAREN*/); 16951 this._eat(2/*TokenKind.LPAREN*/);
16951 var exc = this.declaredIdentifier(false); 16952 var exc = this.declaredIdentifier(false);
16952 var trace = null; 16953 var trace = null;
16953 if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 16954 if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
16954 trace = this.declaredIdentifier(false); 16955 trace = this.declaredIdentifier(false);
16955 } 16956 }
16956 this._eat(3/*TokenKind.RPAREN*/); 16957 this._eat(3/*TokenKind.RPAREN*/);
16957 var body = this.block(); 16958 var body = this.block();
16958 return new CatchNode(exc, trace, body, this._makeSpan(start)); 16959 return new CatchNode(exc, trace, body, this._makeSpan(start));
16959 } 16960 }
16960 Parser.prototype.switchStatement = function() { 16961 lang_Parser.prototype.switchStatement = function() {
16961 var start = this._peekToken.start; 16962 var start = this._peekToken.start;
16962 this._eat(107/*TokenKind.SWITCH*/); 16963 this._eat(107/*TokenKind.SWITCH*/);
16963 var test = this.testCondition(); 16964 var test = this.testCondition();
16964 var cases = []; 16965 var cases = [];
16965 this._eat(6/*TokenKind.LBRACE*/); 16966 this._eat(6/*TokenKind.LBRACE*/);
16966 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) { 16967 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) {
16967 cases.add$1(this.caseNode()); 16968 cases.add$1(this.caseNode());
16968 } 16969 }
16969 return new SwitchStatement(test, cases, this._makeSpan(start)); 16970 return new SwitchStatement(test, cases, this._makeSpan(start));
16970 } 16971 }
16971 Parser.prototype._peekCaseEnd = function() { 16972 lang_Parser.prototype._peekCaseEnd = function() {
16972 var kind = this._peek(); 16973 var kind = this._peek();
16973 return $notnull_bool($eq(kind, 7/*TokenKind.RBRACE*/)) || $notnull_bool($eq(ki nd, 89/*TokenKind.CASE*/)) || $notnull_bool($eq(kind, 93/*TokenKind.DEFAULT*/)); 16974 return $notnull_bool($eq(kind, 7/*TokenKind.RBRACE*/)) || $notnull_bool($eq(ki nd, 89/*TokenKind.CASE*/)) || $notnull_bool($eq(kind, 93/*TokenKind.DEFAULT*/));
16974 } 16975 }
16975 Parser.prototype.caseNode = function() { 16976 lang_Parser.prototype.caseNode = function() {
16976 var start = this._peekToken.start; 16977 var start = this._peekToken.start;
16977 var label = null; 16978 var label = null;
16978 if ($notnull_bool(this._peekIdentifier())) { 16979 if ($notnull_bool(this._peekIdentifier())) {
16979 label = this.identifier(); 16980 label = this.identifier();
16980 this._eat(8/*TokenKind.COLON*/); 16981 this._eat(8/*TokenKind.COLON*/);
16981 } 16982 }
16982 var cases = []; 16983 var cases = [];
16983 while (true) { 16984 while (true) {
16984 if ($notnull_bool(this._maybeEat(89/*TokenKind.CASE*/))) { 16985 if ($notnull_bool(this._maybeEat(89/*TokenKind.CASE*/))) {
16985 cases.add$1(this.expression()); 16986 cases.add$1(this.expression());
(...skipping 10 matching lines...) Expand all
16996 if (cases.length == 0) { 16997 if (cases.length == 0) {
16997 this._lang_error('case or default'); 16998 this._lang_error('case or default');
16998 } 16999 }
16999 var stmts = []; 17000 var stmts = [];
17000 while (!$notnull_bool(this._peekCaseEnd())) { 17001 while (!$notnull_bool(this._peekCaseEnd())) {
17001 if ($notnull_bool(this.isPrematureEndOfFile())) break; 17002 if ($notnull_bool(this.isPrematureEndOfFile())) break;
17002 stmts.add$1(this.statement()); 17003 stmts.add$1(this.statement());
17003 } 17004 }
17004 return new CaseNode(label, cases, stmts, this._makeSpan(start)); 17005 return new CaseNode(label, cases, stmts, this._makeSpan(start));
17005 } 17006 }
17006 Parser.prototype.returnStatement = function() { 17007 lang_Parser.prototype.returnStatement = function() {
17007 var start = this._peekToken.start; 17008 var start = this._peekToken.start;
17008 this._eat(105/*TokenKind.RETURN*/); 17009 this._eat(105/*TokenKind.RETURN*/);
17009 var expr; 17010 var expr;
17010 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) { 17011 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
17011 expr = null; 17012 expr = null;
17012 } 17013 }
17013 else { 17014 else {
17014 expr = this.expression(); 17015 expr = this.expression();
17015 this._eatSemicolon(); 17016 this._eatSemicolon();
17016 } 17017 }
17017 return new ReturnStatement(expr, this._makeSpan(start)); 17018 return new ReturnStatement(expr, this._makeSpan(start));
17018 } 17019 }
17019 Parser.prototype.throwStatement = function() { 17020 lang_Parser.prototype.throwStatement = function() {
17020 var start = this._peekToken.start; 17021 var start = this._peekToken.start;
17021 this._eat(109/*TokenKind.THROW*/); 17022 this._eat(109/*TokenKind.THROW*/);
17022 var expr; 17023 var expr;
17023 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) { 17024 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
17024 expr = null; 17025 expr = null;
17025 } 17026 }
17026 else { 17027 else {
17027 expr = this.expression(); 17028 expr = this.expression();
17028 this._eatSemicolon(); 17029 this._eatSemicolon();
17029 } 17030 }
17030 return new ThrowStatement(expr, this._makeSpan(start)); 17031 return new ThrowStatement(expr, this._makeSpan(start));
17031 } 17032 }
17032 Parser.prototype.assertStatement = function() { 17033 lang_Parser.prototype.assertStatement = function() {
17033 var start = this._peekToken.start; 17034 var start = this._peekToken.start;
17034 this._eat(72/*TokenKind.ASSERT*/); 17035 this._eat(72/*TokenKind.ASSERT*/);
17035 this._eat(2/*TokenKind.LPAREN*/); 17036 this._eat(2/*TokenKind.LPAREN*/);
17036 var expr = this.expression(); 17037 var expr = this.expression();
17037 this._eat(3/*TokenKind.RPAREN*/); 17038 this._eat(3/*TokenKind.RPAREN*/);
17038 this._eatSemicolon(); 17039 this._eatSemicolon();
17039 return new AssertStatement(expr, this._makeSpan(start)); 17040 return new AssertStatement(expr, this._makeSpan(start));
17040 } 17041 }
17041 Parser.prototype.breakStatement = function() { 17042 lang_Parser.prototype.breakStatement = function() {
17042 var start = this._peekToken.start; 17043 var start = this._peekToken.start;
17043 this._eat(88/*TokenKind.BREAK*/); 17044 this._eat(88/*TokenKind.BREAK*/);
17044 var name = null; 17045 var name = null;
17045 if ($notnull_bool(this._peekIdentifier())) { 17046 if ($notnull_bool(this._peekIdentifier())) {
17046 name = this.identifier(); 17047 name = this.identifier();
17047 } 17048 }
17048 this._eatSemicolon(); 17049 this._eatSemicolon();
17049 return new BreakStatement(name, this._makeSpan(start)); 17050 return new BreakStatement(name, this._makeSpan(start));
17050 } 17051 }
17051 Parser.prototype.continueStatement = function() { 17052 lang_Parser.prototype.continueStatement = function() {
17052 var start = this._peekToken.start; 17053 var start = this._peekToken.start;
17053 this._eat(92/*TokenKind.CONTINUE*/); 17054 this._eat(92/*TokenKind.CONTINUE*/);
17054 var name = null; 17055 var name = null;
17055 if ($notnull_bool(this._peekIdentifier())) { 17056 if ($notnull_bool(this._peekIdentifier())) {
17056 name = this.identifier(); 17057 name = this.identifier();
17057 } 17058 }
17058 this._eatSemicolon(); 17059 this._eatSemicolon();
17059 return new ContinueStatement(name, this._makeSpan(start)); 17060 return new ContinueStatement(name, this._makeSpan(start));
17060 } 17061 }
17061 Parser.prototype.expression = function() { 17062 lang_Parser.prototype.expression = function() {
17062 return this.infixExpression(0); 17063 return this.infixExpression(0);
17063 } 17064 }
17064 Parser.prototype._makeType = function(expr) { 17065 lang_Parser.prototype._makeType = function(expr) {
17065 if ((expr instanceof VarExpression)) { 17066 if ((expr instanceof VarExpression)) {
17066 return new NameTypeReference(false, expr.get$name(), null, expr.get$span()); 17067 return new NameTypeReference(false, expr.get$name(), null, expr.get$span());
17067 } 17068 }
17068 else if ((expr instanceof DotExpression)) { 17069 else if ((expr instanceof DotExpression)) {
17069 var type = this._makeType(expr.self); 17070 var type = this._makeType(expr.self);
17070 if (type.names == null) { 17071 if (type.names == null) {
17071 type.names = [expr.get$name()]; 17072 type.names = [expr.get$name()];
17072 } 17073 }
17073 else { 17074 else {
17074 type.names.add$1(expr.get$name()); 17075 type.names.add$1(expr.get$name());
17075 } 17076 }
17076 type.span = expr.get$span(); 17077 type.span = expr.get$span();
17077 return type; 17078 return type;
17078 } 17079 }
17079 else { 17080 else {
17080 this._lang_error('expected type reference'); 17081 this._lang_error('expected type reference');
17081 return null; 17082 return null;
17082 } 17083 }
17083 } 17084 }
17084 Parser.prototype.infixExpression = function(precedence) { 17085 lang_Parser.prototype.infixExpression = function(precedence) {
17085 var $0; 17086 var $0;
17086 return this.finishInfixExpression((($0 = this.unaryExpression()) && $0.is$Expr ession()), precedence); 17087 return this.finishInfixExpression((($0 = this.unaryExpression()) && $0.is$lang _Expression()), precedence);
17087 } 17088 }
17088 Parser.prototype._finishDeclaredId = function(type) { 17089 lang_Parser.prototype._finishDeclaredId = function(type) {
17089 var name = this.identifier(); 17090 var name = this.identifier();
17090 return this.finishPostfixExpression(new DeclaredIdentifier(type, name, this._m akeSpan(type.get$span().start))); 17091 return this.finishPostfixExpression(new DeclaredIdentifier(type, name, this._m akeSpan(type.get$span().start)));
17091 } 17092 }
17092 Parser.prototype._fixAsType = function(x) { 17093 lang_Parser.prototype._fixAsType = function(x) {
17093 $assert(this._isBin(x, 52/*TokenKind.LT*/), "_isBin(x, TokenKind.LT)", "parser .dart", 790, 12); 17094 $assert(this._isBin(x, 52/*TokenKind.LT*/), "_isBin(x, TokenKind.LT)", "parser .dart", 790, 12);
17094 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) { 17095 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) {
17095 var base = this._makeType(x.x); 17096 var base = this._makeType(x.x);
17096 var typeParam = this._makeType(x.y); 17097 var typeParam = this._makeType(x.y);
17097 var type = new GenericTypeReference(base, [typeParam], 0, this._makeSpan(x.s pan.start)); 17098 var type = new GenericTypeReference(base, [typeParam], 0, this._makeSpan(x.s pan.start));
17098 return this._finishDeclaredId(type); 17099 return this._finishDeclaredId(type);
17099 } 17100 }
17100 else { 17101 else {
17101 $assert(this._peekKind(52/*TokenKind.LT*/), "_peekKind(TokenKind.LT)", "pars er.dart", 801, 14); 17102 $assert(this._peekKind(52/*TokenKind.LT*/), "_peekKind(TokenKind.LT)", "pars er.dart", 801, 14);
17102 var base = this._makeType(x.x); 17103 var base = this._makeType(x.x);
17103 var paramBase = this._makeType(x.y); 17104 var paramBase = this._makeType(x.y);
17104 var firstParam = this.addTypeArguments((paramBase && paramBase.is$TypeRefere nce()), 1); 17105 var firstParam = this.addTypeArguments((paramBase && paramBase.is$TypeRefere nce()), 1);
17105 var type; 17106 var type;
17106 if (firstParam.depth <= 0) { 17107 if (firstParam.depth <= 0) {
17107 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp an.start)); 17108 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp an.start));
17108 } 17109 }
17109 else if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 17110 else if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
17110 type = this._finishTypeArguments((base && base.is$TypeReference()), 0, [fi rstParam]); 17111 type = this._finishTypeArguments((base && base.is$TypeReference()), 0, [fi rstParam]);
17111 } 17112 }
17112 else { 17113 else {
17113 this._eat(53/*TokenKind.GT*/); 17114 this._eat(53/*TokenKind.GT*/);
17114 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp an.start)); 17115 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp an.start));
17115 } 17116 }
17116 return this._finishDeclaredId(type); 17117 return this._finishDeclaredId(type);
17117 } 17118 }
17118 } 17119 }
17119 Parser.prototype.finishInfixExpression = function(x, precedence) { 17120 lang_Parser.prototype.finishInfixExpression = function(x, precedence) {
17120 while (true) { 17121 while (true) {
17121 var kind = this._peek(); 17122 var kind = this._peek();
17122 var prec = TokenKind.infixPrecedence(this._peek()); 17123 var prec = TokenKind.infixPrecedence(this._peek());
17123 if (prec >= precedence) { 17124 if (prec >= precedence) {
17124 if (kind == 52/*TokenKind.LT*/ || kind == 53/*TokenKind.GT*/) { 17125 if (kind == 52/*TokenKind.LT*/ || kind == 53/*TokenKind.GT*/) {
17125 if ($notnull_bool(this._isBin(x, 52/*TokenKind.LT*/))) { 17126 if ($notnull_bool(this._isBin(x, 52/*TokenKind.LT*/))) {
17126 return this._fixAsType((x && x.is$BinaryExpression())); 17127 return this._fixAsType((x && x.is$BinaryExpression()));
17127 } 17128 }
17128 } 17129 }
17129 var op = this._lang_next(); 17130 var op = this._lang_next();
(...skipping 12 matching lines...) Expand all
17142 else { 17143 else {
17143 x = new BinaryExpression(op, x, y, this._makeSpan(x.span.start)); 17144 x = new BinaryExpression(op, x, y, this._makeSpan(x.span.start));
17144 } 17145 }
17145 } 17146 }
17146 else { 17147 else {
17147 break; 17148 break;
17148 } 17149 }
17149 } 17150 }
17150 return x; 17151 return x;
17151 } 17152 }
17152 Parser.prototype._isPrefixUnaryOperator = function(kind) { 17153 lang_Parser.prototype._isPrefixUnaryOperator = function(kind) {
17153 switch (kind) { 17154 switch (kind) {
17154 case 42/*TokenKind.ADD*/: 17155 case 42/*TokenKind.ADD*/:
17155 case 43/*TokenKind.SUB*/: 17156 case 43/*TokenKind.SUB*/:
17156 case 19/*TokenKind.NOT*/: 17157 case 19/*TokenKind.NOT*/:
17157 case 18/*TokenKind.BIT_NOT*/: 17158 case 18/*TokenKind.BIT_NOT*/:
17158 case 16/*TokenKind.INCR*/: 17159 case 16/*TokenKind.INCR*/:
17159 case 17/*TokenKind.DECR*/: 17160 case 17/*TokenKind.DECR*/:
17160 17161
17161 return true; 17162 return true;
17162 17163
17163 default: 17164 default:
17164 17165
17165 return false; 17166 return false;
17166 17167
17167 } 17168 }
17168 } 17169 }
17169 Parser.prototype.unaryExpression = function() { 17170 lang_Parser.prototype.unaryExpression = function() {
17170 var start = this._peekToken.start; 17171 var start = this._peekToken.start;
17171 if ($notnull_bool(this._isPrefixUnaryOperator(this._peek()))) { 17172 if ($notnull_bool(this._isPrefixUnaryOperator(this._peek()))) {
17172 var tok = this._lang_next(); 17173 var tok = this._lang_next();
17173 var expr = this.unaryExpression(); 17174 var expr = this.unaryExpression();
17174 return new UnaryExpression(tok, expr, this._makeSpan(start)); 17175 return new UnaryExpression(tok, expr, this._makeSpan(start));
17175 } 17176 }
17176 return this.finishPostfixExpression(this.primary()); 17177 return this.finishPostfixExpression(this.primary());
17177 } 17178 }
17178 Parser.prototype.argument = function() { 17179 lang_Parser.prototype.argument = function() {
17179 var start = this._peekToken.start; 17180 var start = this._peekToken.start;
17180 var expr; 17181 var expr;
17181 var label = null; 17182 var label = null;
17182 if ($notnull_bool(this._maybeEat(15/*TokenKind.ELLIPSIS*/))) { 17183 if ($notnull_bool(this._maybeEat(15/*TokenKind.ELLIPSIS*/))) {
17183 label = new Identifier('...', this._makeSpan(start)); 17184 label = new lang_Identifier('...', this._makeSpan(start));
17184 } 17185 }
17185 expr = this.expression(); 17186 expr = this.expression();
17186 if (label == null && $notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) { 17187 if (label == null && $notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) {
17187 label = this._makeLabel(expr); 17188 label = this._makeLabel(expr);
17188 expr = this.expression(); 17189 expr = this.expression();
17189 } 17190 }
17190 return new ArgumentNode(label, expr, this._makeSpan(start)); 17191 return new ArgumentNode(label, expr, this._makeSpan(start));
17191 } 17192 }
17192 Parser.prototype.arguments = function() { 17193 lang_Parser.prototype.arguments = function() {
17193 var args = []; 17194 var args = [];
17194 this._eat(2/*TokenKind.LPAREN*/); 17195 this._eat(2/*TokenKind.LPAREN*/);
17195 if (!$notnull_bool(this._maybeEat(3/*TokenKind.RPAREN*/))) { 17196 if (!$notnull_bool(this._maybeEat(3/*TokenKind.RPAREN*/))) {
17196 do { 17197 do {
17197 args.add$1(this.argument()); 17198 args.add$1(this.argument());
17198 } 17199 }
17199 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) 17200 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
17200 this._eat(3/*TokenKind.RPAREN*/); 17201 this._eat(3/*TokenKind.RPAREN*/);
17201 } 17202 }
17202 return args; 17203 return args;
17203 } 17204 }
17204 Parser.prototype.get$arguments = function() { 17205 lang_Parser.prototype.get$arguments = function() {
17205 return Parser.prototype.arguments.bind(this); 17206 return lang_Parser.prototype.arguments.bind(this);
17206 } 17207 }
17207 Parser.prototype.finishPostfixExpression = function(expr) { 17208 lang_Parser.prototype.finishPostfixExpression = function(expr) {
17208 switch (this._peek()) { 17209 switch (this._peek()) {
17209 case 2/*TokenKind.LPAREN*/: 17210 case 2/*TokenKind.LPAREN*/:
17210 17211
17211 return this.finishPostfixExpression(new CallExpression(expr, this.argument s(), this._makeSpan(expr.get$span().start))); 17212 return this.finishPostfixExpression(new CallExpression(expr, this.argument s(), this._makeSpan(expr.get$span().start)));
17212 17213
17213 case 4/*TokenKind.LBRACK*/: 17214 case 4/*TokenKind.LBRACK*/:
17214 17215
17215 this._eat(4/*TokenKind.LBRACK*/); 17216 this._eat(4/*TokenKind.LBRACK*/);
17216 var index = this.expression(); 17217 var index = this.expression();
17217 this._eat(5/*TokenKind.RBRACK*/); 17218 this._eat(5/*TokenKind.RBRACK*/);
(...skipping 23 matching lines...) Expand all
17241 17242
17242 if ($notnull_bool(this._peekIdentifier())) { 17243 if ($notnull_bool(this._peekIdentifier())) {
17243 return this.finishPostfixExpression(new DeclaredIdentifier(this._makeTyp e(expr), this.identifier(), this._makeSpan(expr.get$span().start))); 17244 return this.finishPostfixExpression(new DeclaredIdentifier(this._makeTyp e(expr), this.identifier(), this._makeSpan(expr.get$span().start)));
17244 } 17245 }
17245 else { 17246 else {
17246 return expr; 17247 return expr;
17247 } 17248 }
17248 17249
17249 } 17250 }
17250 } 17251 }
17251 Parser.prototype._isBin = function(expr, kind) { 17252 lang_Parser.prototype._isBin = function(expr, kind) {
17252 return (expr instanceof BinaryExpression) && expr.op.kind == kind; 17253 return (expr instanceof BinaryExpression) && expr.op.kind == kind;
17253 } 17254 }
17254 Parser.prototype._boolTypeRef = function(span) { 17255 lang_Parser.prototype._boolTypeRef = function(span) {
17255 return new TypeReference(span, world.nonNullBool); 17256 return new TypeReference(span, world.nonNullBool);
17256 } 17257 }
17257 Parser.prototype._intTypeRef = function(span) { 17258 lang_Parser.prototype._intTypeRef = function(span) {
17258 return new TypeReference(span, world.intType); 17259 return new TypeReference(span, world.intType);
17259 } 17260 }
17260 Parser.prototype._doubleTypeRef = function(span) { 17261 lang_Parser.prototype._doubleTypeRef = function(span) {
17261 return new TypeReference(span, world.doubleType); 17262 return new TypeReference(span, world.doubleType);
17262 } 17263 }
17263 Parser.prototype._stringTypeRef = function(span) { 17264 lang_Parser.prototype._stringTypeRef = function(span) {
17264 return new TypeReference(span, world.stringType); 17265 return new TypeReference(span, world.stringType);
17265 } 17266 }
17266 Parser.prototype.primary = function() { 17267 lang_Parser.prototype.primary = function() {
17267 var start = this._peekToken.start; 17268 var start = this._peekToken.start;
17268 switch (this._peek()) { 17269 switch (this._peek()) {
17269 case 108/*TokenKind.THIS*/: 17270 case 108/*TokenKind.THIS*/:
17270 17271
17271 this._eat(108/*TokenKind.THIS*/); 17272 this._eat(108/*TokenKind.THIS*/);
17272 return new ThisExpression(this._makeSpan(start)); 17273 return new ThisExpression(this._makeSpan(start));
17273 17274
17274 case 106/*TokenKind.SUPER*/: 17275 case 106/*TokenKind.SUPER*/:
17275 17276
17276 this._eat(106/*TokenKind.SUPER*/); 17277 this._eat(106/*TokenKind.SUPER*/);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
17321 return new LiteralExpression(true, this._boolTypeRef(this._makeSpan(start) ), 'true', this._makeSpan(start)); 17322 return new LiteralExpression(true, this._boolTypeRef(this._makeSpan(start) ), 'true', this._makeSpan(start));
17322 17323
17323 case 96/*TokenKind.FALSE*/: 17324 case 96/*TokenKind.FALSE*/:
17324 17325
17325 this._eat(96/*TokenKind.FALSE*/); 17326 this._eat(96/*TokenKind.FALSE*/);
17326 return new LiteralExpression(false, this._boolTypeRef(this._makeSpan(start )), 'false', this._makeSpan(start)); 17327 return new LiteralExpression(false, this._boolTypeRef(this._makeSpan(start )), 'false', this._makeSpan(start));
17327 17328
17328 case 61/*TokenKind.HEX_INTEGER*/: 17329 case 61/*TokenKind.HEX_INTEGER*/:
17329 17330
17330 var t = this._lang_next(); 17331 var t = this._lang_next();
17331 return new LiteralExpression(Parser.parseHex(t.get$text().substring(2)), t his._intTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start)); 17332 return new LiteralExpression(lang_Parser.parseHex(t.get$text().substring(2 )), this._intTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start) );
17332 17333
17333 case 60/*TokenKind.INTEGER*/: 17334 case 60/*TokenKind.INTEGER*/:
17334 17335
17335 var t = this._lang_next(); 17336 var t = this._lang_next();
17336 return new LiteralExpression(Math.parseInt(t.get$text()), this._intTypeRef (this._makeSpan(start)), t.get$text(), this._makeSpan(start)); 17337 return new LiteralExpression(Math.parseInt(t.get$text()), this._intTypeRef (this._makeSpan(start)), t.get$text(), this._makeSpan(start));
17337 17338
17338 case 62/*TokenKind.DOUBLE*/: 17339 case 62/*TokenKind.DOUBLE*/:
17339 17340
17340 var t = this._lang_next(); 17341 var t = this._lang_next();
17341 return new LiteralExpression(Math.parseDouble(t.get$text()), this._doubleT ypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start)); 17342 return new LiteralExpression(Math.parseDouble(t.get$text()), this._doubleT ypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start));
(...skipping 18 matching lines...) Expand all
17360 17361
17361 default: 17362 default:
17362 17363
17363 if (!$notnull_bool(this._peekIdentifier())) { 17364 if (!$notnull_bool(this._peekIdentifier())) {
17364 this._errorExpected('expression'); 17365 this._errorExpected('expression');
17365 } 17366 }
17366 return new VarExpression(this.identifier(), this._makeSpan(start)); 17367 return new VarExpression(this.identifier(), this._makeSpan(start));
17367 17368
17368 } 17369 }
17369 } 17370 }
17370 Parser.prototype.stringInterpolation = function() { 17371 lang_Parser.prototype.stringInterpolation = function() {
17371 var start = this._peekToken.start; 17372 var start = this._peekToken.start;
17372 var lits = []; 17373 var lits = [];
17373 var startQuote = null, endQuote = null; 17374 var startQuote = null, endQuote = null;
17374 while ($notnull_bool(this._peekKind(66/*TokenKind.INCOMPLETE_STRING*/))) { 17375 while ($notnull_bool(this._peekKind(66/*TokenKind.INCOMPLETE_STRING*/))) {
17375 var token = this._lang_next(); 17376 var token = this._lang_next();
17376 var text = token.get$text(); 17377 var text = token.get$text();
17377 if ($notnull_bool(startQuote == null)) { 17378 if ($notnull_bool(startQuote == null)) {
17378 if ($notnull_bool(isMultilineString($assert_String(text)))) { 17379 if ($notnull_bool(isMultilineString($assert_String(text)))) {
17379 endQuote = text.substring$2(0, 3); 17380 endQuote = text.substring$2(0, 3);
17380 startQuote = $add(endQuote, '\n'); 17381 startQuote = $add(endQuote, '\n');
(...skipping 21 matching lines...) Expand all
17402 } 17403 }
17403 var tok = this._lang_next(); 17404 var tok = this._lang_next();
17404 if ($notnull_bool($ne(tok.kind, 58/*TokenKind.STRING*/))) { 17405 if ($notnull_bool($ne(tok.kind, 58/*TokenKind.STRING*/))) {
17405 this._errorExpected('interpolated string'); 17406 this._errorExpected('interpolated string');
17406 } 17407 }
17407 var text = $add(startQuote, tok.get$text()); 17408 var text = $add(startQuote, tok.get$text());
17408 lits.add$1(this.makeStringLiteral($assert_String(text), tok.get$span())); 17409 lits.add$1(this.makeStringLiteral($assert_String(text), tok.get$span()));
17409 var span = this._makeSpan(start); 17410 var span = this._makeSpan(start);
17410 return new LiteralExpression(lits, this._stringTypeRef((span && span.is$Source Span())), '\$\$\$', (span && span.is$SourceSpan())); 17411 return new LiteralExpression(lits, this._stringTypeRef((span && span.is$Source Span())), '\$\$\$', (span && span.is$SourceSpan()));
17411 } 17412 }
17412 Parser.prototype.makeStringLiteral = function(text, span) { 17413 lang_Parser.prototype.makeStringLiteral = function(text, span) {
17413 return new LiteralExpression(text, this._stringTypeRef(span), text, span); 17414 return new LiteralExpression(text, this._stringTypeRef(span), text, span);
17414 } 17415 }
17415 Parser.prototype.stringLiteralExpr = function() { 17416 lang_Parser.prototype.stringLiteralExpr = function() {
17416 var token = this._lang_next(); 17417 var token = this._lang_next();
17417 return this.makeStringLiteral(token.get$text(), token.get$span()); 17418 return this.makeStringLiteral(token.get$text(), token.get$span());
17418 } 17419 }
17419 Parser.prototype.maybeStringLiteral = function() { 17420 lang_Parser.prototype.maybeStringLiteral = function() {
17420 var kind = this._peek(); 17421 var kind = this._peek();
17421 if ($notnull_bool($eq(kind, 58/*TokenKind.STRING*/))) { 17422 if ($notnull_bool($eq(kind, 58/*TokenKind.STRING*/))) {
17422 return parseStringLiteral(this._lang_next().get$text()); 17423 return parseStringLiteral(this._lang_next().get$text());
17423 } 17424 }
17424 else if ($notnull_bool($eq(kind, 59/*TokenKind.STRING_PART*/))) { 17425 else if ($notnull_bool($eq(kind, 59/*TokenKind.STRING_PART*/))) {
17425 this._lang_next(); 17426 this._lang_next();
17426 this._errorExpected('string literal, but found interpolated string start'); 17427 this._errorExpected('string literal, but found interpolated string start');
17427 } 17428 }
17428 else if ($notnull_bool($eq(kind, 66/*TokenKind.INCOMPLETE_STRING*/))) { 17429 else if ($notnull_bool($eq(kind, 66/*TokenKind.INCOMPLETE_STRING*/))) {
17429 this._lang_next(); 17430 this._lang_next();
17430 this._errorExpected('string literal, but found incomplete string'); 17431 this._errorExpected('string literal, but found incomplete string');
17431 } 17432 }
17432 return null; 17433 return null;
17433 } 17434 }
17434 Parser.prototype._parenOrLambda = function() { 17435 lang_Parser.prototype._parenOrLambda = function() {
17435 var start = this._peekToken.start; 17436 var start = this._peekToken.start;
17436 var args = this.arguments(); 17437 var args = this.arguments();
17437 if (!$notnull_bool(this._inInitializers) && ($notnull_bool(this._peekKind(9/*T okenKind.ARROW*/)) || $notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/)))) { 17438 if (!$notnull_bool(this._inInitializers) && ($notnull_bool(this._peekKind(9/*T okenKind.ARROW*/)) || $notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/)))) {
17438 var body = this.functionBody(true); 17439 var body = this.functionBody(true);
17439 var formals = this._makeFormals(args); 17440 var formals = this._makeFormals(args);
17440 var func = new FunctionDefinition(null, null, null, formals, null, body, thi s._makeSpan(start)); 17441 var func = new FunctionDefinition(null, null, null, formals, null, body, thi s._makeSpan(start));
17441 return new LambdaExpression(func, func.get$span()); 17442 return new LambdaExpression(func, func.get$span());
17442 } 17443 }
17443 else { 17444 else {
17444 if (args.length == 1) { 17445 if (args.length == 1) {
17445 return new ParenExpression(args.$index(0).get$value(), this._makeSpan(star t)); 17446 return new ParenExpression(args.$index(0).get$value(), this._makeSpan(star t));
17446 } 17447 }
17447 else { 17448 else {
17448 this._lang_error('unexpected comma expression'); 17449 this._lang_error('unexpected comma expression');
17449 return args.$index(0).get$value(); 17450 return args.$index(0).get$value();
17450 } 17451 }
17451 } 17452 }
17452 } 17453 }
17453 Parser.prototype._typeAsIdentifier = function(type) { 17454 lang_Parser.prototype._typeAsIdentifier = function(type) {
17454 return type.get$name(); 17455 return type.get$name();
17455 } 17456 }
17456 Parser.prototype._specialIdentifier = function(includeOperators) { 17457 lang_Parser.prototype._specialIdentifier = function(includeOperators) {
17457 var start = this._peekToken.start; 17458 var start = this._peekToken.start;
17458 var name; 17459 var name;
17459 switch (this._peek()) { 17460 switch (this._peek()) {
17460 case 15/*TokenKind.ELLIPSIS*/: 17461 case 15/*TokenKind.ELLIPSIS*/:
17461 17462
17462 this._eat(15/*TokenKind.ELLIPSIS*/); 17463 this._eat(15/*TokenKind.ELLIPSIS*/);
17463 this._lang_error('rest no longer supported', this._previousToken.get$span( )); 17464 this._lang_error('rest no longer supported', this._previousToken.get$span( ));
17464 name = $assert_String(this.identifier().get$name()); 17465 name = $assert_String(this.identifier().get$name());
17465 break; 17466 break;
17466 17467
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
17513 this._lang_next(); 17514 this._lang_next();
17514 } 17515 }
17515 } 17516 }
17516 break; 17517 break;
17517 17518
17518 default: 17519 default:
17519 17520
17520 return null; 17521 return null;
17521 17522
17522 } 17523 }
17523 return new Identifier(name, this._makeSpan(start)); 17524 return new lang_Identifier(name, this._makeSpan(start));
17524 } 17525 }
17525 Parser.prototype.declaredIdentifier = function(includeOperators) { 17526 lang_Parser.prototype.declaredIdentifier = function(includeOperators) {
17526 var start = this._peekToken.start; 17527 var start = this._peekToken.start;
17527 var myType = null; 17528 var myType = null;
17528 var name = this._specialIdentifier(includeOperators); 17529 var name = this._specialIdentifier(includeOperators);
17529 if (name == null) { 17530 if (name == null) {
17530 myType = this.type(0); 17531 myType = this.type(0);
17531 name = this._specialIdentifier(includeOperators); 17532 name = this._specialIdentifier(includeOperators);
17532 if (name == null) { 17533 if (name == null) {
17533 if ($notnull_bool(this._peekIdentifier())) { 17534 if ($notnull_bool(this._peekIdentifier())) {
17534 name = this.identifier(); 17535 name = this.identifier();
17535 } 17536 }
17536 else if ((myType instanceof NameTypeReference) && $notnull_bool(myType.nam es == null)) { 17537 else if ((myType instanceof NameTypeReference) && $notnull_bool(myType.nam es == null)) {
17537 name = this._typeAsIdentifier(myType); 17538 name = this._typeAsIdentifier(myType);
17538 myType = null; 17539 myType = null;
17539 } 17540 }
17540 else { 17541 else {
17541 } 17542 }
17542 } 17543 }
17543 } 17544 }
17544 return new DeclaredIdentifier(myType, name, this._makeSpan(start)); 17545 return new DeclaredIdentifier(myType, name, this._makeSpan(start));
17545 } 17546 }
17546 Parser._hexDigit = function(c) { 17547 lang_Parser._hexDigit = function(c) {
17547 if (c >= 48 && c <= 57) { 17548 if (c >= 48 && c <= 57) {
17548 return c - 48; 17549 return c - 48;
17549 } 17550 }
17550 else if (c >= 97 && c <= 102) { 17551 else if (c >= 97 && c <= 102) {
17551 return c - 87; 17552 return c - 87;
17552 } 17553 }
17553 else if (c >= 65 && c <= 70) { 17554 else if (c >= 65 && c <= 70) {
17554 return c - 55; 17555 return c - 55;
17555 } 17556 }
17556 else { 17557 else {
17557 return -1; 17558 return -1;
17558 } 17559 }
17559 } 17560 }
17560 Parser.parseHex = function(hex) { 17561 lang_Parser.parseHex = function(hex) {
17561 var result = 0; 17562 var result = 0;
17562 for (var i = 0; 17563 for (var i = 0;
17563 i < hex.length; i++) { 17564 i < hex.length; i++) {
17564 var digit = Parser._hexDigit(hex.charCodeAt(i)); 17565 var digit = lang_Parser._hexDigit(hex.charCodeAt(i));
17565 $assert($ne(digit, -1), "digit != -1", "parser.dart", 1261, 14); 17566 $assert($ne(digit, -1), "digit != -1", "parser.dart", 1261, 14);
17566 result = (result << 4) + $assert_num(digit); 17567 result = (result << 4) + $assert_num(digit);
17567 } 17568 }
17568 return $assert_num(result); 17569 return $assert_num(result);
17569 } 17570 }
17570 Parser.prototype.finishNewExpression = function(start, isConst) { 17571 lang_Parser.prototype.finishNewExpression = function(start, isConst) {
17571 var type = this.type(0); 17572 var type = this.type(0);
17572 var name = null; 17573 var name = null;
17573 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { 17574 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
17574 name = this.identifier(); 17575 name = this.identifier();
17575 } 17576 }
17576 var args = this.arguments(); 17577 var args = this.arguments();
17577 return new NewExpression(isConst, type, name, args, this._makeSpan(start)); 17578 return new lang_NewExpression(isConst, type, name, args, this._makeSpan(start) );
17578 } 17579 }
17579 Parser.prototype.finishListLiteral = function(start, isConst, type) { 17580 lang_Parser.prototype.finishListLiteral = function(start, isConst, type) {
17580 if ($notnull_bool(this._maybeEat(56/*TokenKind.INDEX*/))) { 17581 if ($notnull_bool(this._maybeEat(56/*TokenKind.INDEX*/))) {
17581 return new ListExpression(isConst, type, [], this._makeSpan(start)); 17582 return new ListExpression(isConst, type, [], this._makeSpan(start));
17582 } 17583 }
17583 var values = []; 17584 var values = [];
17584 this._eat(4/*TokenKind.LBRACK*/); 17585 this._eat(4/*TokenKind.LBRACK*/);
17585 while (!$notnull_bool(this._maybeEat(5/*TokenKind.RBRACK*/))) { 17586 while (!$notnull_bool(this._maybeEat(5/*TokenKind.RBRACK*/))) {
17586 if ($notnull_bool(this.isPrematureEndOfFile())) break; 17587 if ($notnull_bool(this.isPrematureEndOfFile())) break;
17587 values.add$1(this.expression()); 17588 values.add$1(this.expression());
17588 if (!$notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 17589 if (!$notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
17589 this._eat(5/*TokenKind.RBRACK*/); 17590 this._eat(5/*TokenKind.RBRACK*/);
17590 break; 17591 break;
17591 } 17592 }
17592 } 17593 }
17593 return new ListExpression(isConst, type, values, this._makeSpan(start)); 17594 return new ListExpression(isConst, type, values, this._makeSpan(start));
17594 } 17595 }
17595 Parser.prototype.finishMapLiteral = function(start, isConst, type) { 17596 lang_Parser.prototype.finishMapLiteral = function(start, isConst, type) {
17596 var items = []; 17597 var items = [];
17597 this._eat(6/*TokenKind.LBRACE*/); 17598 this._eat(6/*TokenKind.LBRACE*/);
17598 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) { 17599 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) {
17599 if ($notnull_bool(this.isPrematureEndOfFile())) break; 17600 if ($notnull_bool(this.isPrematureEndOfFile())) break;
17600 items.add$1(this.expression()); 17601 items.add$1(this.expression());
17601 this._eat(8/*TokenKind.COLON*/); 17602 this._eat(8/*TokenKind.COLON*/);
17602 items.add$1(this.expression()); 17603 items.add$1(this.expression());
17603 if (!$notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 17604 if (!$notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
17604 this._eat(7/*TokenKind.RBRACE*/); 17605 this._eat(7/*TokenKind.RBRACE*/);
17605 break; 17606 break;
17606 } 17607 }
17607 } 17608 }
17608 return new MapExpression(isConst, type, items, this._makeSpan(start)); 17609 return new MapExpression(isConst, type, items, this._makeSpan(start));
17609 } 17610 }
17610 Parser.prototype.finishTypedLiteral = function(start, isConst) { 17611 lang_Parser.prototype.finishTypedLiteral = function(start, isConst) {
17611 var span = this._makeSpan(start); 17612 var span = this._makeSpan(start);
17612 var typeToBeNamedLater = new NameTypeReference(false, null, null, (span && spa n.is$SourceSpan())); 17613 var typeToBeNamedLater = new NameTypeReference(false, null, null, (span && spa n.is$SourceSpan()));
17613 var genericType = this.addTypeArguments((typeToBeNamedLater && typeToBeNamedLa ter.is$TypeReference()), 0); 17614 var genericType = this.addTypeArguments((typeToBeNamedLater && typeToBeNamedLa ter.is$TypeReference()), 0);
17614 if ($notnull_bool(this._peekKind(4/*TokenKind.LBRACK*/)) || $notnull_bool(this ._peekKind(56/*TokenKind.INDEX*/))) { 17615 if ($notnull_bool(this._peekKind(4/*TokenKind.LBRACK*/)) || $notnull_bool(this ._peekKind(56/*TokenKind.INDEX*/))) {
17615 return this.finishListLiteral(start, isConst, (genericType && genericType.is $TypeReference())); 17616 return this.finishListLiteral(start, isConst, (genericType && genericType.is $TypeReference()));
17616 } 17617 }
17617 else if ($notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/))) { 17618 else if ($notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/))) {
17618 return this.finishMapLiteral(start, isConst, (genericType && genericType.is$ TypeReference())); 17619 return this.finishMapLiteral(start, isConst, (genericType && genericType.is$ TypeReference()));
17619 } 17620 }
17620 else { 17621 else {
17621 this._errorExpected('array or map literal'); 17622 this._errorExpected('array or map literal');
17622 } 17623 }
17623 } 17624 }
17624 Parser.prototype._readModifiers = function() { 17625 lang_Parser.prototype._readModifiers = function() {
17625 var modifiers = null; 17626 var modifiers = null;
17626 while (true) { 17627 while (true) {
17627 switch (this._peek()) { 17628 switch (this._peek()) {
17628 case 86/*TokenKind.STATIC*/: 17629 case 86/*TokenKind.STATIC*/:
17629 case 97/*TokenKind.FINAL*/: 17630 case 97/*TokenKind.FINAL*/:
17630 case 91/*TokenKind.CONST*/: 17631 case 91/*TokenKind.CONST*/:
17631 case 71/*TokenKind.ABSTRACT*/: 17632 case 71/*TokenKind.ABSTRACT*/:
17632 case 75/*TokenKind.FACTORY*/: 17633 case 75/*TokenKind.FACTORY*/:
17633 17634
17634 if (modifiers == null) modifiers = []; 17635 if (modifiers == null) modifiers = [];
17635 modifiers.add$1(this._lang_next()); 17636 modifiers.add$1(this._lang_next());
17636 break; 17637 break;
17637 17638
17638 default: 17639 default:
17639 17640
17640 return modifiers; 17641 return modifiers;
17641 17642
17642 } 17643 }
17643 } 17644 }
17644 return null; 17645 return null;
17645 } 17646 }
17646 Parser.prototype.typeParameter = function() { 17647 lang_Parser.prototype.typeParameter = function() {
17647 var start = this._peekToken.start; 17648 var start = this._peekToken.start;
17648 var name = this.identifier(); 17649 var name = this.identifier();
17649 var myType = null; 17650 var myType = null;
17650 if ($notnull_bool(this._maybeEat(74/*TokenKind.EXTENDS*/))) { 17651 if ($notnull_bool(this._maybeEat(74/*TokenKind.EXTENDS*/))) {
17651 myType = this.type(1); 17652 myType = this.type(1);
17652 } 17653 }
17653 return new TypeParameter(name, myType, this._makeSpan(start)); 17654 return new TypeParameter(name, myType, this._makeSpan(start));
17654 } 17655 }
17655 Parser.prototype.typeParameters = function() { 17656 lang_Parser.prototype.typeParameters = function() {
17656 this._eat(52/*TokenKind.LT*/); 17657 this._eat(52/*TokenKind.LT*/);
17657 var closed = false; 17658 var closed = false;
17658 var ret = []; 17659 var ret = [];
17659 do { 17660 do {
17660 var tp = this.typeParameter(); 17661 var tp = this.typeParameter();
17661 ret.add$1(tp); 17662 ret.add$1(tp);
17662 if ((tp.extendsType instanceof GenericTypeReference) && tp.extendsType.depth == 0) { 17663 if ((tp.extendsType instanceof GenericTypeReference) && tp.extendsType.depth == 0) {
17663 closed = true; 17664 closed = true;
17664 break; 17665 break;
17665 } 17666 }
17666 } 17667 }
17667 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) 17668 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
17668 if (!$notnull_bool(closed)) { 17669 if (!$notnull_bool(closed)) {
17669 this._eat(53/*TokenKind.GT*/); 17670 this._eat(53/*TokenKind.GT*/);
17670 } 17671 }
17671 return ret; 17672 return ret;
17672 } 17673 }
17673 Parser.prototype.get$typeParameters = function() { 17674 lang_Parser.prototype.get$typeParameters = function() {
17674 return Parser.prototype.typeParameters.bind(this); 17675 return lang_Parser.prototype.typeParameters.bind(this);
17675 } 17676 }
17676 Parser.prototype._eatClosingAngle = function(depth) { 17677 lang_Parser.prototype._eatClosingAngle = function(depth) {
17677 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) { 17678 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) {
17678 return depth; 17679 return depth;
17679 } 17680 }
17680 else if (depth > 0 && $notnull_bool(this._maybeEat(40/*TokenKind.SAR*/))) { 17681 else if (depth > 0 && $notnull_bool(this._maybeEat(40/*TokenKind.SAR*/))) {
17681 return depth - 1; 17682 return depth - 1;
17682 } 17683 }
17683 else if (depth > 1 && $notnull_bool(this._maybeEat(41/*TokenKind.SHR*/))) { 17684 else if (depth > 1 && $notnull_bool(this._maybeEat(41/*TokenKind.SHR*/))) {
17684 return depth - 2; 17685 return depth - 2;
17685 } 17686 }
17686 else { 17687 else {
17687 this._errorExpected('>'); 17688 this._errorExpected('>');
17688 return depth; 17689 return depth;
17689 } 17690 }
17690 } 17691 }
17691 Parser.prototype.addTypeArguments = function(baseType, depth) { 17692 lang_Parser.prototype.addTypeArguments = function(baseType, depth) {
17692 this._eat(52/*TokenKind.LT*/); 17693 this._eat(52/*TokenKind.LT*/);
17693 return this._finishTypeArguments(baseType, depth, []); 17694 return this._finishTypeArguments(baseType, depth, []);
17694 } 17695 }
17695 Parser.prototype._finishTypeArguments = function(baseType, depth, types) { 17696 lang_Parser.prototype._finishTypeArguments = function(baseType, depth, types) {
17696 var delta = -1; 17697 var delta = -1;
17697 do { 17698 do {
17698 var myType = this.type(depth + 1); 17699 var myType = this.type(depth + 1);
17699 types.add$1(myType); 17700 types.add$1(myType);
17700 if ((myType instanceof GenericTypeReference) && myType.depth <= depth) { 17701 if ((myType instanceof GenericTypeReference) && myType.depth <= depth) {
17701 delta = depth - myType.depth; 17702 delta = depth - myType.depth;
17702 break; 17703 break;
17703 } 17704 }
17704 } 17705 }
17705 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) 17706 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
17706 if (delta >= 0) { 17707 if (delta >= 0) {
17707 depth -= $assert_num(delta); 17708 depth -= $assert_num(delta);
17708 } 17709 }
17709 else { 17710 else {
17710 depth = this._eatClosingAngle(depth); 17711 depth = this._eatClosingAngle(depth);
17711 } 17712 }
17712 var span = this._makeSpan(baseType.span.start); 17713 var span = this._makeSpan(baseType.span.start);
17713 return new GenericTypeReference(baseType, types, depth, (span && span.is$Sourc eSpan())); 17714 return new GenericTypeReference(baseType, types, depth, (span && span.is$Sourc eSpan()));
17714 } 17715 }
17715 Parser.prototype.typeList = function() { 17716 lang_Parser.prototype.typeList = function() {
17716 var types = []; 17717 var types = [];
17717 do { 17718 do {
17718 types.add$1(this.type(0)); 17719 types.add$1(this.type(0));
17719 } 17720 }
17720 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) 17721 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
17721 return types; 17722 return types;
17722 } 17723 }
17723 Parser.prototype.type = function(depth) { 17724 lang_Parser.prototype.type = function(depth) {
17724 var start = this._peekToken.start; 17725 var start = this._peekToken.start;
17725 var name; 17726 var name;
17726 var names = null; 17727 var names = null;
17727 var typeArgs = null; 17728 var typeArgs = null;
17728 var isFinal = false; 17729 var isFinal = false;
17729 switch (this._peek()) { 17730 switch (this._peek()) {
17730 case 113/*TokenKind.VOID*/: 17731 case 113/*TokenKind.VOID*/:
17731 17732
17732 return new TypeReference(this._lang_next().get$span(), world.voidType); 17733 return new TypeReference(this._lang_next().get$span(), world.voidType);
17733 17734
(...skipping 19 matching lines...) Expand all
17753 names.add$1(this.identifier()); 17754 names.add$1(this.identifier());
17754 } 17755 }
17755 var typeRef = new NameTypeReference(isFinal, name, names, this._makeSpan(start )); 17756 var typeRef = new NameTypeReference(isFinal, name, names, this._makeSpan(start ));
17756 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { 17757 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
17757 return this.addTypeArguments((typeRef && typeRef.is$TypeReference()), depth) ; 17758 return this.addTypeArguments((typeRef && typeRef.is$TypeReference()), depth) ;
17758 } 17759 }
17759 else { 17760 else {
17760 return typeRef; 17761 return typeRef;
17761 } 17762 }
17762 } 17763 }
17763 Parser.prototype.get$type = function() { 17764 lang_Parser.prototype.get$type = function() {
17764 return Parser.prototype.type.bind(this); 17765 return lang_Parser.prototype.type.bind(this);
17765 } 17766 }
17766 Parser.prototype.formalParameter = function(inOptionalBlock) { 17767 lang_Parser.prototype.formalParameter = function(inOptionalBlock) {
17767 var start = this._peekToken.start; 17768 var start = this._peekToken.start;
17768 var isThis = false; 17769 var isThis = false;
17769 var isRest = false; 17770 var isRest = false;
17770 var di = this.declaredIdentifier(false); 17771 var di = this.declaredIdentifier(false);
17771 var type = di.type; 17772 var type = di.type;
17772 var name = di.get$name(); 17773 var name = di.get$name();
17773 var value = null; 17774 var value = null;
17774 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { 17775 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
17775 if (!$notnull_bool(inOptionalBlock)) { 17776 if (!$notnull_bool(inOptionalBlock)) {
17776 this._lang_error('default values only allowed inside [optional] section'); 17777 this._lang_error('default values only allowed inside [optional] section');
17777 } 17778 }
17778 value = this.expression(); 17779 value = this.expression();
17779 } 17780 }
17780 else if ($notnull_bool(this._peekKind(2/*TokenKind.LPAREN*/))) { 17781 else if ($notnull_bool(this._peekKind(2/*TokenKind.LPAREN*/))) {
17781 var formals = this.formalParameterList(); 17782 var formals = this.formalParameterList();
17782 var func = new FunctionDefinition(null, type, name, formals, null, null, thi s._makeSpan(start)); 17783 var func = new FunctionDefinition(null, type, name, formals, null, null, thi s._makeSpan(start));
17783 type = new FunctionTypeReference(false, func, func.get$span()); 17784 type = new FunctionTypeReference(false, func, func.get$span());
17784 } 17785 }
17785 if ($notnull_bool(inOptionalBlock) && $notnull_bool(value == null)) { 17786 if ($notnull_bool(inOptionalBlock) && $notnull_bool(value == null)) {
17786 value = new NullExpression(this._makeSpan(start)); 17787 value = new NullExpression(this._makeSpan(start));
17787 } 17788 }
17788 return new FormalNode(isThis, isRest, type, name, value, this._makeSpan(start) ); 17789 return new FormalNode(isThis, isRest, type, name, value, this._makeSpan(start) );
17789 } 17790 }
17790 Parser.prototype.formalParameterList = function() { 17791 lang_Parser.prototype.formalParameterList = function() {
17791 this._eat(2/*TokenKind.LPAREN*/); 17792 this._eat(2/*TokenKind.LPAREN*/);
17792 var formals = []; 17793 var formals = [];
17793 var inOptionalBlock = false; 17794 var inOptionalBlock = false;
17794 if (!$notnull_bool(this._maybeEat(3/*TokenKind.RPAREN*/))) { 17795 if (!$notnull_bool(this._maybeEat(3/*TokenKind.RPAREN*/))) {
17795 if ($notnull_bool(this._maybeEat(4/*TokenKind.LBRACK*/))) { 17796 if ($notnull_bool(this._maybeEat(4/*TokenKind.LBRACK*/))) {
17796 inOptionalBlock = true; 17797 inOptionalBlock = true;
17797 } 17798 }
17798 formals.add$1(this.formalParameter($assert_bool(inOptionalBlock))); 17799 formals.add$1(this.formalParameter($assert_bool(inOptionalBlock)));
17799 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 17800 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
17800 if ($notnull_bool(this._maybeEat(4/*TokenKind.LBRACK*/))) { 17801 if ($notnull_bool(this._maybeEat(4/*TokenKind.LBRACK*/))) {
17801 if ($notnull_bool(inOptionalBlock)) { 17802 if ($notnull_bool(inOptionalBlock)) {
17802 this._lang_error('already inside an optional block', this._previousTok en.get$span()); 17803 this._lang_error('already inside an optional block', this._previousTok en.get$span());
17803 } 17804 }
17804 inOptionalBlock = true; 17805 inOptionalBlock = true;
17805 } 17806 }
17806 formals.add$1(this.formalParameter($assert_bool(inOptionalBlock))); 17807 formals.add$1(this.formalParameter($assert_bool(inOptionalBlock)));
17807 } 17808 }
17808 if ($notnull_bool(inOptionalBlock)) { 17809 if ($notnull_bool(inOptionalBlock)) {
17809 this._eat(5/*TokenKind.RBRACK*/); 17810 this._eat(5/*TokenKind.RBRACK*/);
17810 } 17811 }
17811 this._eat(3/*TokenKind.RPAREN*/); 17812 this._eat(3/*TokenKind.RPAREN*/);
17812 } 17813 }
17813 return formals; 17814 return formals;
17814 } 17815 }
17815 Parser.prototype.identifier = function() { 17816 lang_Parser.prototype.identifier = function() {
17816 var tok = this._lang_next(); 17817 var tok = this._lang_next();
17817 if (!$notnull_bool(TokenKind.isIdentifier($assert_num(tok.kind)))) { 17818 if (!$notnull_bool(TokenKind.isIdentifier($assert_num(tok.kind)))) {
17818 this._lang_error(('expected identifier, but found ' + tok + ''), tok.get$spa n()); 17819 this._lang_error(('expected identifier, but found ' + tok + ''), tok.get$spa n());
17819 } 17820 }
17820 return new Identifier(tok.get$text(), this._makeSpan(tok.start)); 17821 return new lang_Identifier(tok.get$text(), this._makeSpan(tok.start));
17821 } 17822 }
17822 Parser.prototype._makeFunction = function(expr, body) { 17823 lang_Parser.prototype._makeFunction = function(expr, body) {
17823 var name, type; 17824 var name, type;
17824 if ((expr instanceof CallExpression)) { 17825 if ((expr instanceof CallExpression)) {
17825 if ((expr.target instanceof VarExpression)) { 17826 if ((expr.target instanceof VarExpression)) {
17826 name = expr.target.get$name(); 17827 name = expr.target.get$name();
17827 type = null; 17828 type = null;
17828 } 17829 }
17829 else if ((expr.target instanceof DeclaredIdentifier)) { 17830 else if ((expr.target instanceof DeclaredIdentifier)) {
17830 name = expr.target.get$name(); 17831 name = expr.target.get$name();
17831 type = expr.target.type; 17832 type = expr.target.type;
17832 } 17833 }
17833 else { 17834 else {
17834 this._lang_error('bad function'); 17835 this._lang_error('bad function');
17835 } 17836 }
17836 var formals = this._makeFormals(expr.get$arguments()); 17837 var formals = this._makeFormals(expr.get$arguments());
17837 var span = new SourceSpan(expr.get$span().file, expr.get$span().start, body. get$span().end); 17838 var span = new SourceSpan(expr.get$span().file, expr.get$span().start, body. get$span().end);
17838 var func = new FunctionDefinition(null, type, name, formals, null, body, (sp an && span.is$SourceSpan())); 17839 var func = new FunctionDefinition(null, type, name, formals, null, body, (sp an && span.is$SourceSpan()));
17839 return new LambdaExpression(func, func.get$span()); 17840 return new LambdaExpression(func, func.get$span());
17840 } 17841 }
17841 else { 17842 else {
17842 this._lang_error('expected function'); 17843 this._lang_error('expected function');
17843 } 17844 }
17844 } 17845 }
17845 Parser.prototype._makeFormal = function(expr) { 17846 lang_Parser.prototype._makeFormal = function(expr) {
17846 var $0; 17847 var $0;
17847 if ((expr instanceof VarExpression)) { 17848 if ((expr instanceof VarExpression)) {
17848 return new FormalNode(false, false, null, expr.get$name(), null, expr.get$sp an()); 17849 return new FormalNode(false, false, null, expr.get$name(), null, expr.get$sp an());
17849 } 17850 }
17850 else if ((expr instanceof DeclaredIdentifier)) { 17851 else if ((expr instanceof DeclaredIdentifier)) {
17851 return new FormalNode(false, false, expr.type, expr.get$name(), null, expr.g et$span()); 17852 return new FormalNode(false, false, expr.type, expr.get$name(), null, expr.g et$span());
17852 } 17853 }
17853 else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/)) && ((expr.x instanceof DeclaredIdentifier))) { 17854 else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/)) && ((expr.x instanceof DeclaredIdentifier))) {
17854 var di = (($0 = expr.x) && $0.is$DeclaredIdentifier()); 17855 var di = (($0 = expr.x) && $0.is$DeclaredIdentifier());
17855 return new FormalNode(false, false, di.type, di.name, expr.y, expr.get$span( )); 17856 return new FormalNode(false, false, di.type, di.name, expr.y, expr.get$span( ));
17856 } 17857 }
17857 else if ($notnull_bool(this._isBin(expr, 52/*TokenKind.LT*/))) { 17858 else if ($notnull_bool(this._isBin(expr, 52/*TokenKind.LT*/))) {
17858 return null; 17859 return null;
17859 } 17860 }
17860 else if ((expr instanceof ListExpression)) { 17861 else if ((expr instanceof ListExpression)) {
17861 return this._makeFormalsFromList(expr); 17862 return this._makeFormalsFromList(expr);
17862 } 17863 }
17863 else { 17864 else {
17864 this._lang_error('expected formal', expr.get$span()); 17865 this._lang_error('expected formal', expr.get$span());
17865 } 17866 }
17866 } 17867 }
17867 Parser.prototype._makeFormalsFromList = function(expr) { 17868 lang_Parser.prototype._makeFormalsFromList = function(expr) {
17868 if ($notnull_bool(expr.get$isConst())) { 17869 if ($notnull_bool(expr.get$isConst())) {
17869 this._lang_error('expected formal, but found "const"', expr.get$span()); 17870 this._lang_error('expected formal, but found "const"', expr.get$span());
17870 } 17871 }
17871 else if ($notnull_bool($ne(expr.type, null))) { 17872 else if ($notnull_bool($ne(expr.type, null))) {
17872 this._lang_error('expected formal, but found generic type arguments', expr.t ype.get$span()); 17873 this._lang_error('expected formal, but found generic type arguments', expr.t ype.get$span());
17873 } 17874 }
17874 return this._makeFormalsFromExpressions(expr.values, false); 17875 return this._makeFormalsFromExpressions(expr.values, false);
17875 } 17876 }
17876 Parser.prototype._makeFormals = function(arguments) { 17877 lang_Parser.prototype._makeFormals = function(arguments) {
17877 var expressions = []; 17878 var expressions = [];
17878 for (var i = 0; 17879 for (var i = 0;
17879 i < arguments.length; i++) { 17880 i < arguments.length; i++) {
17880 var arg = arguments.$index(i); 17881 var arg = arguments.$index(i);
17881 if (arg.label != null) { 17882 if (arg.label != null) {
17882 this._lang_error('expected formal, but found ":"'); 17883 this._lang_error('expected formal, but found ":"');
17883 } 17884 }
17884 expressions.add$1(arg.get$value()); 17885 expressions.add$1(arg.get$value());
17885 } 17886 }
17886 return this._makeFormalsFromExpressions(expressions, true); 17887 return this._makeFormalsFromExpressions(expressions, true);
17887 } 17888 }
17888 Parser.prototype._makeFormalsFromExpressions = function(expressions, allowOption al) { 17889 lang_Parser.prototype._makeFormalsFromExpressions = function(expressions, allowO ptional) {
17889 var $0; 17890 var $0;
17890 var formals = []; 17891 var formals = [];
17891 for (var i = 0; 17892 for (var i = 0;
17892 i < expressions.length; i++) { 17893 i < expressions.length; i++) {
17893 var formal = this._makeFormal(expressions.$index(i)); 17894 var formal = this._makeFormal(expressions.$index(i));
17894 if ($notnull_bool(formal == null)) { 17895 if ($notnull_bool(formal == null)) {
17895 var baseType = this._makeType(expressions.$index(i).x); 17896 var baseType = this._makeType(expressions.$index(i).x);
17896 var typeParams = [this._makeType(expressions.$index(i).y)]; 17897 var typeParams = [this._makeType(expressions.$index(i).y)];
17897 i++; 17898 i++;
17898 while (i < expressions.length) { 17899 while (i < expressions.length) {
(...skipping 23 matching lines...) Expand all
17922 if (!$notnull_bool(allowOptional)) { 17923 if (!$notnull_bool(allowOptional)) {
17923 this._lang_error('unexpected nested optional formal', expressions.$index (i).get$span()); 17924 this._lang_error('unexpected nested optional formal', expressions.$index (i).get$span());
17924 } 17925 }
17925 } 17926 }
17926 else { 17927 else {
17927 formals.add$1(formal); 17928 formals.add$1(formal);
17928 } 17929 }
17929 } 17930 }
17930 return formals; 17931 return formals;
17931 } 17932 }
17932 Parser.prototype._makeDeclaredIdentifier = function(e) { 17933 lang_Parser.prototype._makeDeclaredIdentifier = function(e) {
17933 if ((e instanceof VarExpression)) { 17934 if ((e instanceof VarExpression)) {
17934 return new DeclaredIdentifier(null, e.get$name(), e.get$span()); 17935 return new DeclaredIdentifier(null, e.get$name(), e.get$span());
17935 } 17936 }
17936 else if ((e instanceof DeclaredIdentifier)) { 17937 else if ((e instanceof DeclaredIdentifier)) {
17937 return e; 17938 return e;
17938 } 17939 }
17939 else { 17940 else {
17940 this._lang_error('expected declared identifier'); 17941 this._lang_error('expected declared identifier');
17941 return new DeclaredIdentifier(null, null, e.get$span()); 17942 return new DeclaredIdentifier(null, null, e.get$span());
17942 } 17943 }
17943 } 17944 }
17944 Parser.prototype._makeLabel = function(expr) { 17945 lang_Parser.prototype._makeLabel = function(expr) {
17945 if ((expr instanceof VarExpression)) { 17946 if ((expr instanceof VarExpression)) {
17946 return expr.get$name(); 17947 return expr.get$name();
17947 } 17948 }
17948 else { 17949 else {
17949 this._errorExpected('label'); 17950 this._errorExpected('label');
17950 return null; 17951 return null;
17951 } 17952 }
17952 } 17953 }
17953 Parser.prototype.block$0 = function() { 17954 lang_Parser.prototype.block$0 = function() {
17954 return this.block(); 17955 return this.block();
17955 }; 17956 };
17956 // ********** Code for IncompleteSourceException ************** 17957 // ********** Code for IncompleteSourceException **************
17957 function IncompleteSourceException(token) { 17958 function IncompleteSourceException(token) {
17958 this.token = token; 17959 this.token = token;
17959 // Initializers done 17960 // Initializers done
17960 } 17961 }
17961 IncompleteSourceException.prototype.toString = function() { 17962 IncompleteSourceException.prototype.toString = function() {
17962 if (this.token.get$span() == null) return ('Unexpected ' + this.token + ''); 17963 if (this.token.get$span() == null) return ('Unexpected ' + this.token + '');
17963 return $assert_String(this.token.get$span().toMessageString(('Unexpected ' + t his.token + ''))); 17964 return $assert_String(this.token.get$span().toMessageString(('Unexpected ' + t his.token + '')));
17964 } 17965 }
17965 IncompleteSourceException.prototype.toString$0 = function() { 17966 IncompleteSourceException.prototype.toString$0 = function() {
17966 return this.toString(); 17967 return this.toString();
17967 }; 17968 };
17968 // ********** Code for Node ************** 17969 // ********** Code for lang_Node **************
17969 function Node(span) { 17970 function lang_Node(span) {
17970 this.span = span; 17971 this.span = span;
17971 // Initializers done 17972 // Initializers done
17972 } 17973 }
17973 Node.prototype.is$Node = function(){return this;}; 17974 lang_Node.prototype.is$lang_Node = function(){return this;};
17974 Node.prototype.get$span = function() { return this.span; }; 17975 lang_Node.prototype.get$span = function() { return this.span; };
17975 Node.prototype.set$span = function(value) { return this.span = value; }; 17976 lang_Node.prototype.set$span = function(value) { return this.span = value; };
17976 Node.prototype.visit$1 = function($0) { 17977 lang_Node.prototype.visit$1 = function($0) {
17977 return this.visit(($0 && $0.is$TreeVisitor())); 17978 return this.visit(($0 && $0.is$TreeVisitor()));
17978 }; 17979 };
17979 // ********** Code for Definition ************** 17980 // ********** Code for Definition **************
17980 function Definition(span) { 17981 function Definition(span) {
17981 // Initializers done 17982 // Initializers done
17982 Statement.call(this, span); 17983 lang_Statement.call(this, span);
17983 } 17984 }
17984 $inherits(Definition, Statement); 17985 $inherits(Definition, lang_Statement);
17985 Definition.prototype.is$Definition = function(){return this;}; 17986 Definition.prototype.is$Definition = function(){return this;};
17986 Definition.prototype.get$typeParameters = function() { 17987 Definition.prototype.get$typeParameters = function() {
17987 return null; 17988 return null;
17988 } 17989 }
17989 Definition.prototype.get$nativeType = function() { 17990 Definition.prototype.get$nativeType = function() {
17990 return null; 17991 return null;
17991 } 17992 }
17992 // ********** Code for Statement ************** 17993 // ********** Code for lang_Statement **************
17993 function Statement(span) { 17994 function lang_Statement(span) {
17994 // Initializers done 17995 // Initializers done
17995 Node.call(this, span); 17996 lang_Node.call(this, span);
17996 } 17997 }
17997 $inherits(Statement, Node); 17998 $inherits(lang_Statement, lang_Node);
17998 Statement.prototype.is$Statement = function(){return this;}; 17999 lang_Statement.prototype.is$lang_Statement = function(){return this;};
17999 // ********** Code for Expression ************** 18000 // ********** Code for lang_Expression **************
18000 function Expression(span) { 18001 function lang_Expression(span) {
18001 // Initializers done 18002 // Initializers done
18002 Node.call(this, span); 18003 lang_Node.call(this, span);
18003 } 18004 }
18004 $inherits(Expression, Node); 18005 $inherits(lang_Expression, lang_Node);
18005 Expression.prototype.is$Expression = function(){return this;}; 18006 lang_Expression.prototype.is$lang_Expression = function(){return this;};
18006 // ********** Code for TypeReference ************** 18007 // ********** Code for TypeReference **************
18007 function TypeReference(span, type) { 18008 function TypeReference(span, type) {
18008 this.type = type; 18009 this.type = type;
18009 // Initializers done 18010 // Initializers done
18010 Node.call(this, span); 18011 lang_Node.call(this, span);
18011 } 18012 }
18012 $inherits(TypeReference, Node); 18013 $inherits(TypeReference, lang_Node);
18013 TypeReference.prototype.is$TypeReference = function(){return this;}; 18014 TypeReference.prototype.is$TypeReference = function(){return this;};
18014 TypeReference.prototype.get$type = function() { return this.type; }; 18015 TypeReference.prototype.get$type = function() { return this.type; };
18015 TypeReference.prototype.set$type = function(value) { return this.type = value; } ; 18016 TypeReference.prototype.set$type = function(value) { return this.type = value; } ;
18016 TypeReference.prototype.visit = function(visitor) { 18017 TypeReference.prototype.visit = function(visitor) {
18017 return visitor.visitTypeReference(this); 18018 return visitor.visitTypeReference(this);
18018 } 18019 }
18019 TypeReference.prototype.get$isFinal = function() { 18020 TypeReference.prototype.get$isFinal = function() {
18020 return false; 18021 return false;
18021 } 18022 }
18022 TypeReference.prototype.visit$1 = function($0) { 18023 TypeReference.prototype.visit$1 = function($0) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
18123 FunctionDefinition.prototype.visit = function(visitor) { 18124 FunctionDefinition.prototype.visit = function(visitor) {
18124 return visitor.visitFunctionDefinition(this); 18125 return visitor.visitFunctionDefinition(this);
18125 } 18126 }
18126 FunctionDefinition.prototype.visit$1 = function($0) { 18127 FunctionDefinition.prototype.visit$1 = function($0) {
18127 return this.visit(($0 && $0.is$TreeVisitor())); 18128 return this.visit(($0 && $0.is$TreeVisitor()));
18128 }; 18129 };
18129 // ********** Code for ReturnStatement ************** 18130 // ********** Code for ReturnStatement **************
18130 function ReturnStatement(value, span) { 18131 function ReturnStatement(value, span) {
18131 this.value = value; 18132 this.value = value;
18132 // Initializers done 18133 // Initializers done
18133 Statement.call(this, span); 18134 lang_Statement.call(this, span);
18134 } 18135 }
18135 $inherits(ReturnStatement, Statement); 18136 $inherits(ReturnStatement, lang_Statement);
18136 ReturnStatement.prototype.get$value = function() { return this.value; }; 18137 ReturnStatement.prototype.get$value = function() { return this.value; };
18137 ReturnStatement.prototype.set$value = function(value) { return this.value = valu e; }; 18138 ReturnStatement.prototype.set$value = function(value) { return this.value = valu e; };
18138 ReturnStatement.prototype.visit = function(visitor) { 18139 ReturnStatement.prototype.visit = function(visitor) {
18139 return visitor.visitReturnStatement(this); 18140 return visitor.visitReturnStatement(this);
18140 } 18141 }
18141 ReturnStatement.prototype.visit$1 = function($0) { 18142 ReturnStatement.prototype.visit$1 = function($0) {
18142 return this.visit(($0 && $0.is$TreeVisitor())); 18143 return this.visit(($0 && $0.is$TreeVisitor()));
18143 }; 18144 };
18144 // ********** Code for ThrowStatement ************** 18145 // ********** Code for ThrowStatement **************
18145 function ThrowStatement(value, span) { 18146 function ThrowStatement(value, span) {
18146 this.value = value; 18147 this.value = value;
18147 // Initializers done 18148 // Initializers done
18148 Statement.call(this, span); 18149 lang_Statement.call(this, span);
18149 } 18150 }
18150 $inherits(ThrowStatement, Statement); 18151 $inherits(ThrowStatement, lang_Statement);
18151 ThrowStatement.prototype.get$value = function() { return this.value; }; 18152 ThrowStatement.prototype.get$value = function() { return this.value; };
18152 ThrowStatement.prototype.set$value = function(value) { return this.value = value ; }; 18153 ThrowStatement.prototype.set$value = function(value) { return this.value = value ; };
18153 ThrowStatement.prototype.visit = function(visitor) { 18154 ThrowStatement.prototype.visit = function(visitor) {
18154 return visitor.visitThrowStatement(this); 18155 return visitor.visitThrowStatement(this);
18155 } 18156 }
18156 ThrowStatement.prototype.visit$1 = function($0) { 18157 ThrowStatement.prototype.visit$1 = function($0) {
18157 return this.visit(($0 && $0.is$TreeVisitor())); 18158 return this.visit(($0 && $0.is$TreeVisitor()));
18158 }; 18159 };
18159 // ********** Code for AssertStatement ************** 18160 // ********** Code for AssertStatement **************
18160 function AssertStatement(test, span) { 18161 function AssertStatement(test, span) {
18161 this.test = test; 18162 this.test = test;
18162 // Initializers done 18163 // Initializers done
18163 Statement.call(this, span); 18164 lang_Statement.call(this, span);
18164 } 18165 }
18165 $inherits(AssertStatement, Statement); 18166 $inherits(AssertStatement, lang_Statement);
18166 AssertStatement.prototype.visit = function(visitor) { 18167 AssertStatement.prototype.visit = function(visitor) {
18167 return visitor.visitAssertStatement(this); 18168 return visitor.visitAssertStatement(this);
18168 } 18169 }
18169 AssertStatement.prototype.visit$1 = function($0) { 18170 AssertStatement.prototype.visit$1 = function($0) {
18170 return this.visit(($0 && $0.is$TreeVisitor())); 18171 return this.visit(($0 && $0.is$TreeVisitor()));
18171 }; 18172 };
18172 // ********** Code for BreakStatement ************** 18173 // ********** Code for BreakStatement **************
18173 function BreakStatement(label, span) { 18174 function BreakStatement(label, span) {
18174 this.label = label; 18175 this.label = label;
18175 // Initializers done 18176 // Initializers done
18176 Statement.call(this, span); 18177 lang_Statement.call(this, span);
18177 } 18178 }
18178 $inherits(BreakStatement, Statement); 18179 $inherits(BreakStatement, lang_Statement);
18179 BreakStatement.prototype.visit = function(visitor) { 18180 BreakStatement.prototype.visit = function(visitor) {
18180 return visitor.visitBreakStatement(this); 18181 return visitor.visitBreakStatement(this);
18181 } 18182 }
18182 BreakStatement.prototype.visit$1 = function($0) { 18183 BreakStatement.prototype.visit$1 = function($0) {
18183 return this.visit(($0 && $0.is$TreeVisitor())); 18184 return this.visit(($0 && $0.is$TreeVisitor()));
18184 }; 18185 };
18185 // ********** Code for ContinueStatement ************** 18186 // ********** Code for ContinueStatement **************
18186 function ContinueStatement(label, span) { 18187 function ContinueStatement(label, span) {
18187 this.label = label; 18188 this.label = label;
18188 // Initializers done 18189 // Initializers done
18189 Statement.call(this, span); 18190 lang_Statement.call(this, span);
18190 } 18191 }
18191 $inherits(ContinueStatement, Statement); 18192 $inherits(ContinueStatement, lang_Statement);
18192 ContinueStatement.prototype.visit = function(visitor) { 18193 ContinueStatement.prototype.visit = function(visitor) {
18193 return visitor.visitContinueStatement(this); 18194 return visitor.visitContinueStatement(this);
18194 } 18195 }
18195 ContinueStatement.prototype.visit$1 = function($0) { 18196 ContinueStatement.prototype.visit$1 = function($0) {
18196 return this.visit(($0 && $0.is$TreeVisitor())); 18197 return this.visit(($0 && $0.is$TreeVisitor()));
18197 }; 18198 };
18198 // ********** Code for IfStatement ************** 18199 // ********** Code for IfStatement **************
18199 function IfStatement(test, trueBranch, falseBranch, span) { 18200 function IfStatement(test, trueBranch, falseBranch, span) {
18200 this.test = test; 18201 this.test = test;
18201 this.trueBranch = trueBranch; 18202 this.trueBranch = trueBranch;
18202 this.falseBranch = falseBranch; 18203 this.falseBranch = falseBranch;
18203 // Initializers done 18204 // Initializers done
18204 Statement.call(this, span); 18205 lang_Statement.call(this, span);
18205 } 18206 }
18206 $inherits(IfStatement, Statement); 18207 $inherits(IfStatement, lang_Statement);
18207 IfStatement.prototype.visit = function(visitor) { 18208 IfStatement.prototype.visit = function(visitor) {
18208 return visitor.visitIfStatement(this); 18209 return visitor.visitIfStatement(this);
18209 } 18210 }
18210 IfStatement.prototype.visit$1 = function($0) { 18211 IfStatement.prototype.visit$1 = function($0) {
18211 return this.visit(($0 && $0.is$TreeVisitor())); 18212 return this.visit(($0 && $0.is$TreeVisitor()));
18212 }; 18213 };
18213 // ********** Code for WhileStatement ************** 18214 // ********** Code for WhileStatement **************
18214 function WhileStatement(test, body, span) { 18215 function WhileStatement(test, body, span) {
18215 this.test = test; 18216 this.test = test;
18216 this.body = body; 18217 this.body = body;
18217 // Initializers done 18218 // Initializers done
18218 Statement.call(this, span); 18219 lang_Statement.call(this, span);
18219 } 18220 }
18220 $inherits(WhileStatement, Statement); 18221 $inherits(WhileStatement, lang_Statement);
18221 WhileStatement.prototype.visit = function(visitor) { 18222 WhileStatement.prototype.visit = function(visitor) {
18222 return visitor.visitWhileStatement(this); 18223 return visitor.visitWhileStatement(this);
18223 } 18224 }
18224 WhileStatement.prototype.visit$1 = function($0) { 18225 WhileStatement.prototype.visit$1 = function($0) {
18225 return this.visit(($0 && $0.is$TreeVisitor())); 18226 return this.visit(($0 && $0.is$TreeVisitor()));
18226 }; 18227 };
18227 // ********** Code for DoStatement ************** 18228 // ********** Code for DoStatement **************
18228 function DoStatement(body, test, span) { 18229 function DoStatement(body, test, span) {
18229 this.body = body; 18230 this.body = body;
18230 this.test = test; 18231 this.test = test;
18231 // Initializers done 18232 // Initializers done
18232 Statement.call(this, span); 18233 lang_Statement.call(this, span);
18233 } 18234 }
18234 $inherits(DoStatement, Statement); 18235 $inherits(DoStatement, lang_Statement);
18235 DoStatement.prototype.visit = function(visitor) { 18236 DoStatement.prototype.visit = function(visitor) {
18236 return visitor.visitDoStatement(this); 18237 return visitor.visitDoStatement(this);
18237 } 18238 }
18238 DoStatement.prototype.visit$1 = function($0) { 18239 DoStatement.prototype.visit$1 = function($0) {
18239 return this.visit(($0 && $0.is$TreeVisitor())); 18240 return this.visit(($0 && $0.is$TreeVisitor()));
18240 }; 18241 };
18241 // ********** Code for ForStatement ************** 18242 // ********** Code for ForStatement **************
18242 function ForStatement(init, test, step, body, span) { 18243 function ForStatement(init, test, step, body, span) {
18243 this.init = init; 18244 this.init = init;
18244 this.test = test; 18245 this.test = test;
18245 this.step = step; 18246 this.step = step;
18246 this.body = body; 18247 this.body = body;
18247 // Initializers done 18248 // Initializers done
18248 Statement.call(this, span); 18249 lang_Statement.call(this, span);
18249 } 18250 }
18250 $inherits(ForStatement, Statement); 18251 $inherits(ForStatement, lang_Statement);
18251 ForStatement.prototype.visit = function(visitor) { 18252 ForStatement.prototype.visit = function(visitor) {
18252 return visitor.visitForStatement(this); 18253 return visitor.visitForStatement(this);
18253 } 18254 }
18254 ForStatement.prototype.visit$1 = function($0) { 18255 ForStatement.prototype.visit$1 = function($0) {
18255 return this.visit(($0 && $0.is$TreeVisitor())); 18256 return this.visit(($0 && $0.is$TreeVisitor()));
18256 }; 18257 };
18257 // ********** Code for ForInStatement ************** 18258 // ********** Code for ForInStatement **************
18258 function ForInStatement(item, list, body, span) { 18259 function ForInStatement(item, list, body, span) {
18259 this.item = item; 18260 this.item = item;
18260 this.list = list; 18261 this.list = list;
18261 this.body = body; 18262 this.body = body;
18262 // Initializers done 18263 // Initializers done
18263 Statement.call(this, span); 18264 lang_Statement.call(this, span);
18264 } 18265 }
18265 $inherits(ForInStatement, Statement); 18266 $inherits(ForInStatement, lang_Statement);
18266 ForInStatement.prototype.visit = function(visitor) { 18267 ForInStatement.prototype.visit = function(visitor) {
18267 return visitor.visitForInStatement(this); 18268 return visitor.visitForInStatement(this);
18268 } 18269 }
18269 ForInStatement.prototype.visit$1 = function($0) { 18270 ForInStatement.prototype.visit$1 = function($0) {
18270 return this.visit(($0 && $0.is$TreeVisitor())); 18271 return this.visit(($0 && $0.is$TreeVisitor()));
18271 }; 18272 };
18272 // ********** Code for TryStatement ************** 18273 // ********** Code for TryStatement **************
18273 function TryStatement(body, catches, finallyBlock, span) { 18274 function TryStatement(body, catches, finallyBlock, span) {
18274 this.body = body; 18275 this.body = body;
18275 this.catches = catches; 18276 this.catches = catches;
18276 this.finallyBlock = finallyBlock; 18277 this.finallyBlock = finallyBlock;
18277 // Initializers done 18278 // Initializers done
18278 Statement.call(this, span); 18279 lang_Statement.call(this, span);
18279 } 18280 }
18280 $inherits(TryStatement, Statement); 18281 $inherits(TryStatement, lang_Statement);
18281 TryStatement.prototype.visit = function(visitor) { 18282 TryStatement.prototype.visit = function(visitor) {
18282 return visitor.visitTryStatement(this); 18283 return visitor.visitTryStatement(this);
18283 } 18284 }
18284 TryStatement.prototype.visit$1 = function($0) { 18285 TryStatement.prototype.visit$1 = function($0) {
18285 return this.visit(($0 && $0.is$TreeVisitor())); 18286 return this.visit(($0 && $0.is$TreeVisitor()));
18286 }; 18287 };
18287 // ********** Code for SwitchStatement ************** 18288 // ********** Code for SwitchStatement **************
18288 function SwitchStatement(test, cases, span) { 18289 function SwitchStatement(test, cases, span) {
18289 this.test = test; 18290 this.test = test;
18290 this.cases = cases; 18291 this.cases = cases;
18291 // Initializers done 18292 // Initializers done
18292 Statement.call(this, span); 18293 lang_Statement.call(this, span);
18293 } 18294 }
18294 $inherits(SwitchStatement, Statement); 18295 $inherits(SwitchStatement, lang_Statement);
18295 SwitchStatement.prototype.visit = function(visitor) { 18296 SwitchStatement.prototype.visit = function(visitor) {
18296 return visitor.visitSwitchStatement(this); 18297 return visitor.visitSwitchStatement(this);
18297 } 18298 }
18298 SwitchStatement.prototype.visit$1 = function($0) { 18299 SwitchStatement.prototype.visit$1 = function($0) {
18299 return this.visit(($0 && $0.is$TreeVisitor())); 18300 return this.visit(($0 && $0.is$TreeVisitor()));
18300 }; 18301 };
18301 // ********** Code for BlockStatement ************** 18302 // ********** Code for BlockStatement **************
18302 function BlockStatement(body, span) { 18303 function BlockStatement(body, span) {
18303 this.body = body; 18304 this.body = body;
18304 // Initializers done 18305 // Initializers done
18305 Statement.call(this, span); 18306 lang_Statement.call(this, span);
18306 } 18307 }
18307 $inherits(BlockStatement, Statement); 18308 $inherits(BlockStatement, lang_Statement);
18308 BlockStatement.prototype.is$BlockStatement = function(){return this;}; 18309 BlockStatement.prototype.is$BlockStatement = function(){return this;};
18309 BlockStatement.prototype.visit = function(visitor) { 18310 BlockStatement.prototype.visit = function(visitor) {
18310 return visitor.visitBlockStatement(this); 18311 return visitor.visitBlockStatement(this);
18311 } 18312 }
18312 BlockStatement.prototype.visit$1 = function($0) { 18313 BlockStatement.prototype.visit$1 = function($0) {
18313 return this.visit(($0 && $0.is$TreeVisitor())); 18314 return this.visit(($0 && $0.is$TreeVisitor()));
18314 }; 18315 };
18315 // ********** Code for LabeledStatement ************** 18316 // ********** Code for LabeledStatement **************
18316 function LabeledStatement(name, body, span) { 18317 function LabeledStatement(name, body, span) {
18317 this.name = name; 18318 this.name = name;
18318 this.body = body; 18319 this.body = body;
18319 // Initializers done 18320 // Initializers done
18320 Statement.call(this, span); 18321 lang_Statement.call(this, span);
18321 } 18322 }
18322 $inherits(LabeledStatement, Statement); 18323 $inherits(LabeledStatement, lang_Statement);
18323 LabeledStatement.prototype.get$name = function() { return this.name; }; 18324 LabeledStatement.prototype.get$name = function() { return this.name; };
18324 LabeledStatement.prototype.set$name = function(value) { return this.name = value ; }; 18325 LabeledStatement.prototype.set$name = function(value) { return this.name = value ; };
18325 LabeledStatement.prototype.visit = function(visitor) { 18326 LabeledStatement.prototype.visit = function(visitor) {
18326 return visitor.visitLabeledStatement(this); 18327 return visitor.visitLabeledStatement(this);
18327 } 18328 }
18328 LabeledStatement.prototype.visit$1 = function($0) { 18329 LabeledStatement.prototype.visit$1 = function($0) {
18329 return this.visit(($0 && $0.is$TreeVisitor())); 18330 return this.visit(($0 && $0.is$TreeVisitor()));
18330 }; 18331 };
18331 // ********** Code for ExpressionStatement ************** 18332 // ********** Code for lang_ExpressionStatement **************
18332 function ExpressionStatement(body, span) { 18333 function lang_ExpressionStatement(body, span) {
18333 this.body = body; 18334 this.body = body;
18334 // Initializers done 18335 // Initializers done
18335 Statement.call(this, span); 18336 lang_Statement.call(this, span);
18336 } 18337 }
18337 $inherits(ExpressionStatement, Statement); 18338 $inherits(lang_ExpressionStatement, lang_Statement);
18338 ExpressionStatement.prototype.visit = function(visitor) { 18339 lang_ExpressionStatement.prototype.visit = function(visitor) {
18339 return visitor.visitExpressionStatement(this); 18340 return visitor.visitExpressionStatement(this);
18340 } 18341 }
18341 ExpressionStatement.prototype.visit$1 = function($0) { 18342 lang_ExpressionStatement.prototype.visit$1 = function($0) {
18342 return this.visit(($0 && $0.is$TreeVisitor())); 18343 return this.visit(($0 && $0.is$TreeVisitor()));
18343 }; 18344 };
18344 // ********** Code for EmptyStatement ************** 18345 // ********** Code for EmptyStatement **************
18345 function EmptyStatement(span) { 18346 function EmptyStatement(span) {
18346 // Initializers done 18347 // Initializers done
18347 Statement.call(this, span); 18348 lang_Statement.call(this, span);
18348 } 18349 }
18349 $inherits(EmptyStatement, Statement); 18350 $inherits(EmptyStatement, lang_Statement);
18350 EmptyStatement.prototype.visit = function(visitor) { 18351 EmptyStatement.prototype.visit = function(visitor) {
18351 return visitor.visitEmptyStatement(this); 18352 return visitor.visitEmptyStatement(this);
18352 } 18353 }
18353 EmptyStatement.prototype.visit$1 = function($0) { 18354 EmptyStatement.prototype.visit$1 = function($0) {
18354 return this.visit(($0 && $0.is$TreeVisitor())); 18355 return this.visit(($0 && $0.is$TreeVisitor()));
18355 }; 18356 };
18356 // ********** Code for DietStatement ************** 18357 // ********** Code for DietStatement **************
18357 function DietStatement(span) { 18358 function DietStatement(span) {
18358 // Initializers done 18359 // Initializers done
18359 Statement.call(this, span); 18360 lang_Statement.call(this, span);
18360 } 18361 }
18361 $inherits(DietStatement, Statement); 18362 $inherits(DietStatement, lang_Statement);
18362 DietStatement.prototype.visit = function(visitor) { 18363 DietStatement.prototype.visit = function(visitor) {
18363 return visitor.visitDietStatement(this); 18364 return visitor.visitDietStatement(this);
18364 } 18365 }
18365 DietStatement.prototype.visit$1 = function($0) { 18366 DietStatement.prototype.visit$1 = function($0) {
18366 return this.visit(($0 && $0.is$TreeVisitor())); 18367 return this.visit(($0 && $0.is$TreeVisitor()));
18367 }; 18368 };
18368 // ********** Code for NativeStatement ************** 18369 // ********** Code for NativeStatement **************
18369 function NativeStatement(body, span) { 18370 function NativeStatement(body, span) {
18370 this.body = body; 18371 this.body = body;
18371 // Initializers done 18372 // Initializers done
18372 Statement.call(this, span); 18373 lang_Statement.call(this, span);
18373 } 18374 }
18374 $inherits(NativeStatement, Statement); 18375 $inherits(NativeStatement, lang_Statement);
18375 NativeStatement.prototype.visit = function(visitor) { 18376 NativeStatement.prototype.visit = function(visitor) {
18376 return visitor.visitNativeStatement(this); 18377 return visitor.visitNativeStatement(this);
18377 } 18378 }
18378 NativeStatement.prototype.visit$1 = function($0) { 18379 NativeStatement.prototype.visit$1 = function($0) {
18379 return this.visit(($0 && $0.is$TreeVisitor())); 18380 return this.visit(($0 && $0.is$TreeVisitor()));
18380 }; 18381 };
18381 // ********** Code for LambdaExpression ************** 18382 // ********** Code for LambdaExpression **************
18382 function LambdaExpression(func, span) { 18383 function LambdaExpression(func, span) {
18383 this.func = func; 18384 this.func = func;
18384 // Initializers done 18385 // Initializers done
18385 Expression.call(this, span); 18386 lang_Expression.call(this, span);
18386 } 18387 }
18387 $inherits(LambdaExpression, Expression); 18388 $inherits(LambdaExpression, lang_Expression);
18388 LambdaExpression.prototype.is$LambdaExpression = function(){return this;}; 18389 LambdaExpression.prototype.is$LambdaExpression = function(){return this;};
18389 LambdaExpression.prototype.visit = function(visitor) { 18390 LambdaExpression.prototype.visit = function(visitor) {
18390 return visitor.visitLambdaExpression(this); 18391 return visitor.visitLambdaExpression(this);
18391 } 18392 }
18392 LambdaExpression.prototype.visit$1 = function($0) { 18393 LambdaExpression.prototype.visit$1 = function($0) {
18393 return this.visit(($0 && $0.is$TreeVisitor())); 18394 return this.visit(($0 && $0.is$TreeVisitor()));
18394 }; 18395 };
18395 // ********** Code for CallExpression ************** 18396 // ********** Code for CallExpression **************
18396 function CallExpression(target, arguments, span) { 18397 function CallExpression(target, arguments, span) {
18397 this.target = target; 18398 this.target = target;
18398 this.arguments = arguments; 18399 this.arguments = arguments;
18399 // Initializers done 18400 // Initializers done
18400 Expression.call(this, span); 18401 lang_Expression.call(this, span);
18401 } 18402 }
18402 $inherits(CallExpression, Expression); 18403 $inherits(CallExpression, lang_Expression);
18403 CallExpression.prototype.is$CallExpression = function(){return this;}; 18404 CallExpression.prototype.is$CallExpression = function(){return this;};
18404 CallExpression.prototype.get$arguments = function() { return this.arguments; }; 18405 CallExpression.prototype.get$arguments = function() { return this.arguments; };
18405 CallExpression.prototype.set$arguments = function(value) { return this.arguments = value; }; 18406 CallExpression.prototype.set$arguments = function(value) { return this.arguments = value; };
18406 CallExpression.prototype.visit = function(visitor) { 18407 CallExpression.prototype.visit = function(visitor) {
18407 return visitor.visitCallExpression(this); 18408 return visitor.visitCallExpression(this);
18408 } 18409 }
18409 CallExpression.prototype.visit$1 = function($0) { 18410 CallExpression.prototype.visit$1 = function($0) {
18410 return this.visit(($0 && $0.is$TreeVisitor())); 18411 return this.visit(($0 && $0.is$TreeVisitor()));
18411 }; 18412 };
18412 // ********** Code for IndexExpression ************** 18413 // ********** Code for IndexExpression **************
18413 function IndexExpression(target, index, span) { 18414 function IndexExpression(target, index, span) {
18414 this.target = target; 18415 this.target = target;
18415 this.index = index; 18416 this.index = index;
18416 // Initializers done 18417 // Initializers done
18417 Expression.call(this, span); 18418 lang_Expression.call(this, span);
18418 } 18419 }
18419 $inherits(IndexExpression, Expression); 18420 $inherits(IndexExpression, lang_Expression);
18420 IndexExpression.prototype.is$IndexExpression = function(){return this;}; 18421 IndexExpression.prototype.is$IndexExpression = function(){return this;};
18421 IndexExpression.prototype.visit = function(visitor) { 18422 IndexExpression.prototype.visit = function(visitor) {
18422 return visitor.visitIndexExpression(this); 18423 return visitor.visitIndexExpression(this);
18423 } 18424 }
18424 IndexExpression.prototype.visit$1 = function($0) { 18425 IndexExpression.prototype.visit$1 = function($0) {
18425 return this.visit(($0 && $0.is$TreeVisitor())); 18426 return this.visit(($0 && $0.is$TreeVisitor()));
18426 }; 18427 };
18427 // ********** Code for BinaryExpression ************** 18428 // ********** Code for BinaryExpression **************
18428 function BinaryExpression(op, x, y, span) { 18429 function BinaryExpression(op, x, y, span) {
18429 this.op = op; 18430 this.op = op;
18430 this.x = x; 18431 this.x = x;
18431 this.y = y; 18432 this.y = y;
18432 // Initializers done 18433 // Initializers done
18433 Expression.call(this, span); 18434 lang_Expression.call(this, span);
18434 } 18435 }
18435 $inherits(BinaryExpression, Expression); 18436 $inherits(BinaryExpression, lang_Expression);
18436 BinaryExpression.prototype.is$BinaryExpression = function(){return this;}; 18437 BinaryExpression.prototype.is$BinaryExpression = function(){return this;};
18437 BinaryExpression.prototype.visit = function(visitor) { 18438 BinaryExpression.prototype.visit = function(visitor) {
18438 return visitor.visitBinaryExpression(this); 18439 return visitor.visitBinaryExpression(this);
18439 } 18440 }
18440 BinaryExpression.prototype.visit$1 = function($0) { 18441 BinaryExpression.prototype.visit$1 = function($0) {
18441 return this.visit(($0 && $0.is$TreeVisitor())); 18442 return this.visit(($0 && $0.is$TreeVisitor()));
18442 }; 18443 };
18443 // ********** Code for UnaryExpression ************** 18444 // ********** Code for UnaryExpression **************
18444 function UnaryExpression(op, self, span) { 18445 function UnaryExpression(op, self, span) {
18445 this.op = op; 18446 this.op = op;
18446 this.self = self; 18447 this.self = self;
18447 // Initializers done 18448 // Initializers done
18448 Expression.call(this, span); 18449 lang_Expression.call(this, span);
18449 } 18450 }
18450 $inherits(UnaryExpression, Expression); 18451 $inherits(UnaryExpression, lang_Expression);
18451 UnaryExpression.prototype.visit = function(visitor) { 18452 UnaryExpression.prototype.visit = function(visitor) {
18452 return visitor.visitUnaryExpression(this); 18453 return visitor.visitUnaryExpression(this);
18453 } 18454 }
18454 UnaryExpression.prototype.visit$1 = function($0) { 18455 UnaryExpression.prototype.visit$1 = function($0) {
18455 return this.visit(($0 && $0.is$TreeVisitor())); 18456 return this.visit(($0 && $0.is$TreeVisitor()));
18456 }; 18457 };
18457 // ********** Code for PostfixExpression ************** 18458 // ********** Code for PostfixExpression **************
18458 function PostfixExpression(body, op, span) { 18459 function PostfixExpression(body, op, span) {
18459 this.body = body; 18460 this.body = body;
18460 this.op = op; 18461 this.op = op;
18461 // Initializers done 18462 // Initializers done
18462 Expression.call(this, span); 18463 lang_Expression.call(this, span);
18463 } 18464 }
18464 $inherits(PostfixExpression, Expression); 18465 $inherits(PostfixExpression, lang_Expression);
18465 PostfixExpression.prototype.is$PostfixExpression = function(){return this;}; 18466 PostfixExpression.prototype.is$PostfixExpression = function(){return this;};
18466 PostfixExpression.prototype.visit = function(visitor) { 18467 PostfixExpression.prototype.visit = function(visitor) {
18467 return visitor.visitPostfixExpression$1(this); 18468 return visitor.visitPostfixExpression$1(this);
18468 } 18469 }
18469 PostfixExpression.prototype.visit$1 = function($0) { 18470 PostfixExpression.prototype.visit$1 = function($0) {
18470 return this.visit(($0 && $0.is$TreeVisitor())); 18471 return this.visit(($0 && $0.is$TreeVisitor()));
18471 }; 18472 };
18472 // ********** Code for NewExpression ************** 18473 // ********** Code for lang_NewExpression **************
18473 function NewExpression(isConst, type, name, arguments, span) { 18474 function lang_NewExpression(isConst, type, name, arguments, span) {
18474 this.isConst = isConst; 18475 this.isConst = isConst;
18475 this.type = type; 18476 this.type = type;
18476 this.name = name; 18477 this.name = name;
18477 this.arguments = arguments; 18478 this.arguments = arguments;
18478 // Initializers done 18479 // Initializers done
18479 Expression.call(this, span); 18480 lang_Expression.call(this, span);
18480 } 18481 }
18481 $inherits(NewExpression, Expression); 18482 $inherits(lang_NewExpression, lang_Expression);
18482 NewExpression.prototype.get$isConst = function() { return this.isConst; }; 18483 lang_NewExpression.prototype.get$isConst = function() { return this.isConst; };
18483 NewExpression.prototype.set$isConst = function(value) { return this.isConst = va lue; }; 18484 lang_NewExpression.prototype.set$isConst = function(value) { return this.isConst = value; };
18484 NewExpression.prototype.get$type = function() { return this.type; }; 18485 lang_NewExpression.prototype.get$type = function() { return this.type; };
18485 NewExpression.prototype.set$type = function(value) { return this.type = value; } ; 18486 lang_NewExpression.prototype.set$type = function(value) { return this.type = val ue; };
18486 NewExpression.prototype.get$name = function() { return this.name; }; 18487 lang_NewExpression.prototype.get$name = function() { return this.name; };
18487 NewExpression.prototype.set$name = function(value) { return this.name = value; } ; 18488 lang_NewExpression.prototype.set$name = function(value) { return this.name = val ue; };
18488 NewExpression.prototype.get$arguments = function() { return this.arguments; }; 18489 lang_NewExpression.prototype.get$arguments = function() { return this.arguments; };
18489 NewExpression.prototype.set$arguments = function(value) { return this.arguments = value; }; 18490 lang_NewExpression.prototype.set$arguments = function(value) { return this.argum ents = value; };
18490 NewExpression.prototype.visit = function(visitor) { 18491 lang_NewExpression.prototype.visit = function(visitor) {
18491 return visitor.visitNewExpression(this); 18492 return visitor.visitNewExpression(this);
18492 } 18493 }
18493 NewExpression.prototype.visit$1 = function($0) { 18494 lang_NewExpression.prototype.visit$1 = function($0) {
18494 return this.visit(($0 && $0.is$TreeVisitor())); 18495 return this.visit(($0 && $0.is$TreeVisitor()));
18495 }; 18496 };
18496 // ********** Code for ListExpression ************** 18497 // ********** Code for ListExpression **************
18497 function ListExpression(isConst, type, values, span) { 18498 function ListExpression(isConst, type, values, span) {
18498 this.isConst = isConst; 18499 this.isConst = isConst;
18499 this.type = type; 18500 this.type = type;
18500 this.values = values; 18501 this.values = values;
18501 // Initializers done 18502 // Initializers done
18502 Expression.call(this, span); 18503 lang_Expression.call(this, span);
18503 } 18504 }
18504 $inherits(ListExpression, Expression); 18505 $inherits(ListExpression, lang_Expression);
18505 ListExpression.prototype.get$isConst = function() { return this.isConst; }; 18506 ListExpression.prototype.get$isConst = function() { return this.isConst; };
18506 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v alue; }; 18507 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v alue; };
18507 ListExpression.prototype.get$type = function() { return this.type; }; 18508 ListExpression.prototype.get$type = function() { return this.type; };
18508 ListExpression.prototype.set$type = function(value) { return this.type = value; }; 18509 ListExpression.prototype.set$type = function(value) { return this.type = value; };
18509 ListExpression.prototype.visit = function(visitor) { 18510 ListExpression.prototype.visit = function(visitor) {
18510 return visitor.visitListExpression(this); 18511 return visitor.visitListExpression(this);
18511 } 18512 }
18512 ListExpression.prototype.visit$1 = function($0) { 18513 ListExpression.prototype.visit$1 = function($0) {
18513 return this.visit(($0 && $0.is$TreeVisitor())); 18514 return this.visit(($0 && $0.is$TreeVisitor()));
18514 }; 18515 };
18515 // ********** Code for MapExpression ************** 18516 // ********** Code for MapExpression **************
18516 function MapExpression(isConst, type, items, span) { 18517 function MapExpression(isConst, type, items, span) {
18517 this.isConst = isConst; 18518 this.isConst = isConst;
18518 this.type = type; 18519 this.type = type;
18519 this.items = items; 18520 this.items = items;
18520 // Initializers done 18521 // Initializers done
18521 Expression.call(this, span); 18522 lang_Expression.call(this, span);
18522 } 18523 }
18523 $inherits(MapExpression, Expression); 18524 $inherits(MapExpression, lang_Expression);
18524 MapExpression.prototype.get$isConst = function() { return this.isConst; }; 18525 MapExpression.prototype.get$isConst = function() { return this.isConst; };
18525 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va lue; }; 18526 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va lue; };
18526 MapExpression.prototype.get$type = function() { return this.type; }; 18527 MapExpression.prototype.get$type = function() { return this.type; };
18527 MapExpression.prototype.set$type = function(value) { return this.type = value; } ; 18528 MapExpression.prototype.set$type = function(value) { return this.type = value; } ;
18528 MapExpression.prototype.visit = function(visitor) { 18529 MapExpression.prototype.visit = function(visitor) {
18529 return visitor.visitMapExpression(this); 18530 return visitor.visitMapExpression(this);
18530 } 18531 }
18531 MapExpression.prototype.visit$1 = function($0) { 18532 MapExpression.prototype.visit$1 = function($0) {
18532 return this.visit(($0 && $0.is$TreeVisitor())); 18533 return this.visit(($0 && $0.is$TreeVisitor()));
18533 }; 18534 };
18534 // ********** Code for ConditionalExpression ************** 18535 // ********** Code for ConditionalExpression **************
18535 function ConditionalExpression(test, trueBranch, falseBranch, span) { 18536 function ConditionalExpression(test, trueBranch, falseBranch, span) {
18536 this.test = test; 18537 this.test = test;
18537 this.trueBranch = trueBranch; 18538 this.trueBranch = trueBranch;
18538 this.falseBranch = falseBranch; 18539 this.falseBranch = falseBranch;
18539 // Initializers done 18540 // Initializers done
18540 Expression.call(this, span); 18541 lang_Expression.call(this, span);
18541 } 18542 }
18542 $inherits(ConditionalExpression, Expression); 18543 $inherits(ConditionalExpression, lang_Expression);
18543 ConditionalExpression.prototype.visit = function(visitor) { 18544 ConditionalExpression.prototype.visit = function(visitor) {
18544 return visitor.visitConditionalExpression(this); 18545 return visitor.visitConditionalExpression(this);
18545 } 18546 }
18546 ConditionalExpression.prototype.visit$1 = function($0) { 18547 ConditionalExpression.prototype.visit$1 = function($0) {
18547 return this.visit(($0 && $0.is$TreeVisitor())); 18548 return this.visit(($0 && $0.is$TreeVisitor()));
18548 }; 18549 };
18549 // ********** Code for IsExpression ************** 18550 // ********** Code for IsExpression **************
18550 function IsExpression(isTrue, x, type, span) { 18551 function IsExpression(isTrue, x, type, span) {
18551 this.isTrue = isTrue; 18552 this.isTrue = isTrue;
18552 this.x = x; 18553 this.x = x;
18553 this.type = type; 18554 this.type = type;
18554 // Initializers done 18555 // Initializers done
18555 Expression.call(this, span); 18556 lang_Expression.call(this, span);
18556 } 18557 }
18557 $inherits(IsExpression, Expression); 18558 $inherits(IsExpression, lang_Expression);
18558 IsExpression.prototype.get$type = function() { return this.type; }; 18559 IsExpression.prototype.get$type = function() { return this.type; };
18559 IsExpression.prototype.set$type = function(value) { return this.type = value; }; 18560 IsExpression.prototype.set$type = function(value) { return this.type = value; };
18560 IsExpression.prototype.visit = function(visitor) { 18561 IsExpression.prototype.visit = function(visitor) {
18561 return visitor.visitIsExpression(this); 18562 return visitor.visitIsExpression(this);
18562 } 18563 }
18563 IsExpression.prototype.visit$1 = function($0) { 18564 IsExpression.prototype.visit$1 = function($0) {
18564 return this.visit(($0 && $0.is$TreeVisitor())); 18565 return this.visit(($0 && $0.is$TreeVisitor()));
18565 }; 18566 };
18566 // ********** Code for ParenExpression ************** 18567 // ********** Code for ParenExpression **************
18567 function ParenExpression(body, span) { 18568 function ParenExpression(body, span) {
18568 this.body = body; 18569 this.body = body;
18569 // Initializers done 18570 // Initializers done
18570 Expression.call(this, span); 18571 lang_Expression.call(this, span);
18571 } 18572 }
18572 $inherits(ParenExpression, Expression); 18573 $inherits(ParenExpression, lang_Expression);
18573 ParenExpression.prototype.visit = function(visitor) { 18574 ParenExpression.prototype.visit = function(visitor) {
18574 return visitor.visitParenExpression(this); 18575 return visitor.visitParenExpression(this);
18575 } 18576 }
18576 ParenExpression.prototype.visit$1 = function($0) { 18577 ParenExpression.prototype.visit$1 = function($0) {
18577 return this.visit(($0 && $0.is$TreeVisitor())); 18578 return this.visit(($0 && $0.is$TreeVisitor()));
18578 }; 18579 };
18579 // ********** Code for DotExpression ************** 18580 // ********** Code for DotExpression **************
18580 function DotExpression(self, name, span) { 18581 function DotExpression(self, name, span) {
18581 this.self = self; 18582 this.self = self;
18582 this.name = name; 18583 this.name = name;
18583 // Initializers done 18584 // Initializers done
18584 Expression.call(this, span); 18585 lang_Expression.call(this, span);
18585 } 18586 }
18586 $inherits(DotExpression, Expression); 18587 $inherits(DotExpression, lang_Expression);
18587 DotExpression.prototype.is$DotExpression = function(){return this;}; 18588 DotExpression.prototype.is$DotExpression = function(){return this;};
18588 DotExpression.prototype.get$name = function() { return this.name; }; 18589 DotExpression.prototype.get$name = function() { return this.name; };
18589 DotExpression.prototype.set$name = function(value) { return this.name = value; } ; 18590 DotExpression.prototype.set$name = function(value) { return this.name = value; } ;
18590 DotExpression.prototype.visit = function(visitor) { 18591 DotExpression.prototype.visit = function(visitor) {
18591 return visitor.visitDotExpression(this); 18592 return visitor.visitDotExpression(this);
18592 } 18593 }
18593 DotExpression.prototype.visit$1 = function($0) { 18594 DotExpression.prototype.visit$1 = function($0) {
18594 return this.visit(($0 && $0.is$TreeVisitor())); 18595 return this.visit(($0 && $0.is$TreeVisitor()));
18595 }; 18596 };
18596 // ********** Code for VarExpression ************** 18597 // ********** Code for VarExpression **************
18597 function VarExpression(name, span) { 18598 function VarExpression(name, span) {
18598 this.name = name; 18599 this.name = name;
18599 // Initializers done 18600 // Initializers done
18600 Expression.call(this, span); 18601 lang_Expression.call(this, span);
18601 } 18602 }
18602 $inherits(VarExpression, Expression); 18603 $inherits(VarExpression, lang_Expression);
18603 VarExpression.prototype.is$VarExpression = function(){return this;}; 18604 VarExpression.prototype.is$VarExpression = function(){return this;};
18604 VarExpression.prototype.get$name = function() { return this.name; }; 18605 VarExpression.prototype.get$name = function() { return this.name; };
18605 VarExpression.prototype.set$name = function(value) { return this.name = value; } ; 18606 VarExpression.prototype.set$name = function(value) { return this.name = value; } ;
18606 VarExpression.prototype.visit = function(visitor) { 18607 VarExpression.prototype.visit = function(visitor) {
18607 return visitor.visitVarExpression(this); 18608 return visitor.visitVarExpression(this);
18608 } 18609 }
18609 VarExpression.prototype.visit$1 = function($0) { 18610 VarExpression.prototype.visit$1 = function($0) {
18610 return this.visit(($0 && $0.is$TreeVisitor())); 18611 return this.visit(($0 && $0.is$TreeVisitor()));
18611 }; 18612 };
18612 // ********** Code for ThisExpression ************** 18613 // ********** Code for ThisExpression **************
18613 function ThisExpression(span) { 18614 function ThisExpression(span) {
18614 // Initializers done 18615 // Initializers done
18615 Expression.call(this, span); 18616 lang_Expression.call(this, span);
18616 } 18617 }
18617 $inherits(ThisExpression, Expression); 18618 $inherits(ThisExpression, lang_Expression);
18618 ThisExpression.prototype.visit = function(visitor) { 18619 ThisExpression.prototype.visit = function(visitor) {
18619 return visitor.visitThisExpression(this); 18620 return visitor.visitThisExpression(this);
18620 } 18621 }
18621 ThisExpression.prototype.visit$1 = function($0) { 18622 ThisExpression.prototype.visit$1 = function($0) {
18622 return this.visit(($0 && $0.is$TreeVisitor())); 18623 return this.visit(($0 && $0.is$TreeVisitor()));
18623 }; 18624 };
18624 // ********** Code for SuperExpression ************** 18625 // ********** Code for SuperExpression **************
18625 function SuperExpression(span) { 18626 function SuperExpression(span) {
18626 // Initializers done 18627 // Initializers done
18627 Expression.call(this, span); 18628 lang_Expression.call(this, span);
18628 } 18629 }
18629 $inherits(SuperExpression, Expression); 18630 $inherits(SuperExpression, lang_Expression);
18630 SuperExpression.prototype.visit = function(visitor) { 18631 SuperExpression.prototype.visit = function(visitor) {
18631 return visitor.visitSuperExpression(this); 18632 return visitor.visitSuperExpression(this);
18632 } 18633 }
18633 SuperExpression.prototype.visit$1 = function($0) { 18634 SuperExpression.prototype.visit$1 = function($0) {
18634 return this.visit(($0 && $0.is$TreeVisitor())); 18635 return this.visit(($0 && $0.is$TreeVisitor()));
18635 }; 18636 };
18636 // ********** Code for NullExpression ************** 18637 // ********** Code for NullExpression **************
18637 function NullExpression(span) { 18638 function NullExpression(span) {
18638 // Initializers done 18639 // Initializers done
18639 Expression.call(this, span); 18640 lang_Expression.call(this, span);
18640 } 18641 }
18641 $inherits(NullExpression, Expression); 18642 $inherits(NullExpression, lang_Expression);
18642 NullExpression.prototype.visit = function(visitor) { 18643 NullExpression.prototype.visit = function(visitor) {
18643 return visitor.visitNullExpression(this); 18644 return visitor.visitNullExpression(this);
18644 } 18645 }
18645 NullExpression.prototype.visit$1 = function($0) { 18646 NullExpression.prototype.visit$1 = function($0) {
18646 return this.visit(($0 && $0.is$TreeVisitor())); 18647 return this.visit(($0 && $0.is$TreeVisitor()));
18647 }; 18648 };
18648 // ********** Code for LiteralExpression ************** 18649 // ********** Code for LiteralExpression **************
18649 function LiteralExpression(value, type, text, span) { 18650 function LiteralExpression(value, type, text, span) {
18650 this.value = value; 18651 this.value = value;
18651 this.type = type; 18652 this.type = type;
18652 this.text = text; 18653 this.text = text;
18653 // Initializers done 18654 // Initializers done
18654 Expression.call(this, span); 18655 lang_Expression.call(this, span);
18655 } 18656 }
18656 $inherits(LiteralExpression, Expression); 18657 $inherits(LiteralExpression, lang_Expression);
18657 LiteralExpression.prototype.get$value = function() { return this.value; }; 18658 LiteralExpression.prototype.get$value = function() { return this.value; };
18658 LiteralExpression.prototype.set$value = function(value) { return this.value = va lue; }; 18659 LiteralExpression.prototype.set$value = function(value) { return this.value = va lue; };
18659 LiteralExpression.prototype.get$type = function() { return this.type; }; 18660 LiteralExpression.prototype.get$type = function() { return this.type; };
18660 LiteralExpression.prototype.set$type = function(value) { return this.type = valu e; }; 18661 LiteralExpression.prototype.set$type = function(value) { return this.type = valu e; };
18661 LiteralExpression.prototype.get$text = function() { return this.text; }; 18662 LiteralExpression.prototype.get$text = function() { return this.text; };
18662 LiteralExpression.prototype.set$text = function(value) { return this.text = valu e; }; 18663 LiteralExpression.prototype.set$text = function(value) { return this.text = valu e; };
18663 LiteralExpression.prototype.visit = function(visitor) { 18664 LiteralExpression.prototype.visit = function(visitor) {
18664 return visitor.visitLiteralExpression(this); 18665 return visitor.visitLiteralExpression(this);
18665 } 18666 }
18666 LiteralExpression.prototype.visit$1 = function($0) { 18667 LiteralExpression.prototype.visit$1 = function($0) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
18717 return visitor.visitFunctionTypeReference(this); 18718 return visitor.visitFunctionTypeReference(this);
18718 } 18719 }
18719 FunctionTypeReference.prototype.visit$1 = function($0) { 18720 FunctionTypeReference.prototype.visit$1 = function($0) {
18720 return this.visit(($0 && $0.is$TreeVisitor())); 18721 return this.visit(($0 && $0.is$TreeVisitor()));
18721 }; 18722 };
18722 // ********** Code for ArgumentNode ************** 18723 // ********** Code for ArgumentNode **************
18723 function ArgumentNode(label, value, span) { 18724 function ArgumentNode(label, value, span) {
18724 this.label = label; 18725 this.label = label;
18725 this.value = value; 18726 this.value = value;
18726 // Initializers done 18727 // Initializers done
18727 Node.call(this, span); 18728 lang_Node.call(this, span);
18728 } 18729 }
18729 $inherits(ArgumentNode, Node); 18730 $inherits(ArgumentNode, lang_Node);
18730 ArgumentNode.prototype.is$ArgumentNode = function(){return this;}; 18731 ArgumentNode.prototype.is$ArgumentNode = function(){return this;};
18731 ArgumentNode.prototype.get$value = function() { return this.value; }; 18732 ArgumentNode.prototype.get$value = function() { return this.value; };
18732 ArgumentNode.prototype.set$value = function(value) { return this.value = value; }; 18733 ArgumentNode.prototype.set$value = function(value) { return this.value = value; };
18733 ArgumentNode.prototype.visit = function(visitor) { 18734 ArgumentNode.prototype.visit = function(visitor) {
18734 return visitor.visitArgumentNode(this); 18735 return visitor.visitArgumentNode(this);
18735 } 18736 }
18736 ArgumentNode.prototype.visit$1 = function($0) { 18737 ArgumentNode.prototype.visit$1 = function($0) {
18737 return this.visit(($0 && $0.is$TreeVisitor())); 18738 return this.visit(($0 && $0.is$TreeVisitor()));
18738 }; 18739 };
18739 // ********** Code for FormalNode ************** 18740 // ********** Code for FormalNode **************
18740 function FormalNode(isThis, isRest, type, name, value, span) { 18741 function FormalNode(isThis, isRest, type, name, value, span) {
18741 this.isThis = isThis; 18742 this.isThis = isThis;
18742 this.isRest = isRest; 18743 this.isRest = isRest;
18743 this.type = type; 18744 this.type = type;
18744 this.name = name; 18745 this.name = name;
18745 this.value = value; 18746 this.value = value;
18746 // Initializers done 18747 // Initializers done
18747 Node.call(this, span); 18748 lang_Node.call(this, span);
18748 } 18749 }
18749 $inherits(FormalNode, Node); 18750 $inherits(FormalNode, lang_Node);
18750 FormalNode.prototype.get$type = function() { return this.type; }; 18751 FormalNode.prototype.get$type = function() { return this.type; };
18751 FormalNode.prototype.set$type = function(value) { return this.type = value; }; 18752 FormalNode.prototype.set$type = function(value) { return this.type = value; };
18752 FormalNode.prototype.get$name = function() { return this.name; }; 18753 FormalNode.prototype.get$name = function() { return this.name; };
18753 FormalNode.prototype.set$name = function(value) { return this.name = value; }; 18754 FormalNode.prototype.set$name = function(value) { return this.name = value; };
18754 FormalNode.prototype.get$value = function() { return this.value; }; 18755 FormalNode.prototype.get$value = function() { return this.value; };
18755 FormalNode.prototype.set$value = function(value) { return this.value = value; }; 18756 FormalNode.prototype.set$value = function(value) { return this.value = value; };
18756 FormalNode.prototype.visit = function(visitor) { 18757 FormalNode.prototype.visit = function(visitor) {
18757 return visitor.visitFormalNode(this); 18758 return visitor.visitFormalNode(this);
18758 } 18759 }
18759 FormalNode.prototype.visit$1 = function($0) { 18760 FormalNode.prototype.visit$1 = function($0) {
18760 return this.visit(($0 && $0.is$TreeVisitor())); 18761 return this.visit(($0 && $0.is$TreeVisitor()));
18761 }; 18762 };
18762 // ********** Code for CatchNode ************** 18763 // ********** Code for CatchNode **************
18763 function CatchNode(exception, trace, body, span) { 18764 function CatchNode(exception, trace, body, span) {
18764 this.exception = exception; 18765 this.exception = exception;
18765 this.trace = trace; 18766 this.trace = trace;
18766 this.body = body; 18767 this.body = body;
18767 // Initializers done 18768 // Initializers done
18768 Node.call(this, span); 18769 lang_Node.call(this, span);
18769 } 18770 }
18770 $inherits(CatchNode, Node); 18771 $inherits(CatchNode, lang_Node);
18771 CatchNode.prototype.get$exception = function() { return this.exception; }; 18772 CatchNode.prototype.get$exception = function() { return this.exception; };
18772 CatchNode.prototype.set$exception = function(value) { return this.exception = va lue; }; 18773 CatchNode.prototype.set$exception = function(value) { return this.exception = va lue; };
18773 CatchNode.prototype.visit = function(visitor) { 18774 CatchNode.prototype.visit = function(visitor) {
18774 return visitor.visitCatchNode(this); 18775 return visitor.visitCatchNode(this);
18775 } 18776 }
18776 CatchNode.prototype.visit$1 = function($0) { 18777 CatchNode.prototype.visit$1 = function($0) {
18777 return this.visit(($0 && $0.is$TreeVisitor())); 18778 return this.visit(($0 && $0.is$TreeVisitor()));
18778 }; 18779 };
18779 // ********** Code for CaseNode ************** 18780 // ********** Code for CaseNode **************
18780 function CaseNode(label, cases, statements, span) { 18781 function CaseNode(label, cases, statements, span) {
18781 this.label = label; 18782 this.label = label;
18782 this.cases = cases; 18783 this.cases = cases;
18783 this.statements = statements; 18784 this.statements = statements;
18784 // Initializers done 18785 // Initializers done
18785 Node.call(this, span); 18786 lang_Node.call(this, span);
18786 } 18787 }
18787 $inherits(CaseNode, Node); 18788 $inherits(CaseNode, lang_Node);
18788 CaseNode.prototype.visit = function(visitor) { 18789 CaseNode.prototype.visit = function(visitor) {
18789 return visitor.visitCaseNode(this); 18790 return visitor.visitCaseNode(this);
18790 } 18791 }
18791 CaseNode.prototype.visit$1 = function($0) { 18792 CaseNode.prototype.visit$1 = function($0) {
18792 return this.visit(($0 && $0.is$TreeVisitor())); 18793 return this.visit(($0 && $0.is$TreeVisitor()));
18793 }; 18794 };
18794 // ********** Code for TypeParameter ************** 18795 // ********** Code for TypeParameter **************
18795 function TypeParameter(name, extendsType, span) { 18796 function TypeParameter(name, extendsType, span) {
18796 this.name = name; 18797 this.name = name;
18797 this.extendsType = extendsType; 18798 this.extendsType = extendsType;
18798 // Initializers done 18799 // Initializers done
18799 Node.call(this, span); 18800 lang_Node.call(this, span);
18800 } 18801 }
18801 $inherits(TypeParameter, Node); 18802 $inherits(TypeParameter, lang_Node);
18802 TypeParameter.prototype.get$name = function() { return this.name; }; 18803 TypeParameter.prototype.get$name = function() { return this.name; };
18803 TypeParameter.prototype.set$name = function(value) { return this.name = value; } ; 18804 TypeParameter.prototype.set$name = function(value) { return this.name = value; } ;
18804 TypeParameter.prototype.visit = function(visitor) { 18805 TypeParameter.prototype.visit = function(visitor) {
18805 return visitor.visitTypeParameter(this); 18806 return visitor.visitTypeParameter(this);
18806 } 18807 }
18807 TypeParameter.prototype.visit$1 = function($0) { 18808 TypeParameter.prototype.visit$1 = function($0) {
18808 return this.visit(($0 && $0.is$TreeVisitor())); 18809 return this.visit(($0 && $0.is$TreeVisitor()));
18809 }; 18810 };
18810 // ********** Code for Identifier ************** 18811 // ********** Code for lang_Identifier **************
18811 function Identifier(name, span) { 18812 function lang_Identifier(name, span) {
18812 this.name = name; 18813 this.name = name;
18813 // Initializers done 18814 // Initializers done
18814 Node.call(this, span); 18815 lang_Node.call(this, span);
18815 } 18816 }
18816 $inherits(Identifier, Node); 18817 $inherits(lang_Identifier, lang_Node);
18817 Identifier.prototype.is$Identifier = function(){return this;}; 18818 lang_Identifier.prototype.is$lang_Identifier = function(){return this;};
18818 Identifier.prototype.get$name = function() { return this.name; }; 18819 lang_Identifier.prototype.get$name = function() { return this.name; };
18819 Identifier.prototype.set$name = function(value) { return this.name = value; }; 18820 lang_Identifier.prototype.set$name = function(value) { return this.name = value; };
18820 Identifier.prototype.visit = function(visitor) { 18821 lang_Identifier.prototype.visit = function(visitor) {
18821 return visitor.visitIdentifier(this); 18822 return visitor.visitIdentifier(this);
18822 } 18823 }
18823 Identifier.prototype.visit$1 = function($0) { 18824 lang_Identifier.prototype.visit$1 = function($0) {
18824 return this.visit(($0 && $0.is$TreeVisitor())); 18825 return this.visit(($0 && $0.is$TreeVisitor()));
18825 }; 18826 };
18826 // ********** Code for DeclaredIdentifier ************** 18827 // ********** Code for DeclaredIdentifier **************
18827 function DeclaredIdentifier(type, name, span) { 18828 function DeclaredIdentifier(type, name, span) {
18828 this.type = type; 18829 this.type = type;
18829 this.name = name; 18830 this.name = name;
18830 // Initializers done 18831 // Initializers done
18831 Expression.call(this, span); 18832 lang_Expression.call(this, span);
18832 } 18833 }
18833 $inherits(DeclaredIdentifier, Expression); 18834 $inherits(DeclaredIdentifier, lang_Expression);
18834 DeclaredIdentifier.prototype.is$DeclaredIdentifier = function(){return this;}; 18835 DeclaredIdentifier.prototype.is$DeclaredIdentifier = function(){return this;};
18835 DeclaredIdentifier.prototype.get$type = function() { return this.type; }; 18836 DeclaredIdentifier.prototype.get$type = function() { return this.type; };
18836 DeclaredIdentifier.prototype.set$type = function(value) { return this.type = val ue; }; 18837 DeclaredIdentifier.prototype.set$type = function(value) { return this.type = val ue; };
18837 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; 18838 DeclaredIdentifier.prototype.get$name = function() { return this.name; };
18838 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val ue; }; 18839 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val ue; };
18839 DeclaredIdentifier.prototype.visit = function(visitor) { 18840 DeclaredIdentifier.prototype.visit = function(visitor) {
18840 return visitor.visitDeclaredIdentifier(this); 18841 return visitor.visitDeclaredIdentifier(this);
18841 } 18842 }
18842 DeclaredIdentifier.prototype.visit$1 = function($0) { 18843 DeclaredIdentifier.prototype.visit$1 = function($0) {
18843 return this.visit(($0 && $0.is$TreeVisitor())); 18844 return this.visit(($0 && $0.is$TreeVisitor()));
18844 }; 18845 };
18845 // ********** Code for Type ************** 18846 // ********** Code for lang_Type **************
18846 function Type(name) { 18847 function lang_Type(name) {
18847 this.name = name; 18848 this.name = name;
18848 this.isTested = false; 18849 this.isTested = false;
18849 // Initializers done 18850 // Initializers done
18850 } 18851 }
18851 Type.prototype.is$Type = function(){return this;}; 18852 lang_Type.prototype.is$lang_Type = function(){return this;};
18852 Type.prototype.is$Named = function(){return this;}; 18853 lang_Type.prototype.is$Named = function(){return this;};
18853 Type.prototype.get$name = function() { return this.name; }; 18854 lang_Type.prototype.get$name = function() { return this.name; };
18854 Type.prototype.markUsed = function() { 18855 lang_Type.prototype.markUsed = function() {
18855 18856
18856 } 18857 }
18857 Type.prototype.get$typeMember = function() { 18858 lang_Type.prototype.get$typeMember = function() {
18858 var $0; 18859 var $0;
18859 if (this._typeMember == null) { 18860 if (this._typeMember == null) {
18860 this._typeMember = new TypeMember((this && this.is$DefinedType())); 18861 this._typeMember = new TypeMember((this && this.is$DefinedType()));
18861 } 18862 }
18862 return (($0 = this._typeMember) && $0.is$TypeMember()); 18863 return (($0 = this._typeMember) && $0.is$TypeMember());
18863 } 18864 }
18864 Type.prototype.getMember = function(name) { 18865 lang_Type.prototype.getMember = function(name) {
18865 return null; 18866 return null;
18866 } 18867 }
18867 Type.prototype.get$isVar = function() { 18868 lang_Type.prototype.get$isVar = function() {
18868 return false; 18869 return false;
18869 } 18870 }
18870 Type.prototype.get$isTop = function() { 18871 lang_Type.prototype.get$isTop = function() {
18871 return false; 18872 return false;
18872 } 18873 }
18873 Type.prototype.get$isObject = function() { 18874 lang_Type.prototype.get$isObject = function() {
18874 return false; 18875 return false;
18875 } 18876 }
18876 Type.prototype.get$isString = function() { 18877 lang_Type.prototype.get$isString = function() {
18877 return false; 18878 return false;
18878 } 18879 }
18879 Type.prototype.get$isBool = function() { 18880 lang_Type.prototype.get$isBool = function() {
18880 return false; 18881 return false;
18881 } 18882 }
18882 Type.prototype.get$isFunction = function() { 18883 lang_Type.prototype.get$isFunction = function() {
18883 return false; 18884 return false;
18884 } 18885 }
18885 Type.prototype.get$isList = function() { 18886 lang_Type.prototype.get$isList = function() {
18886 return false; 18887 return false;
18887 } 18888 }
18888 Type.prototype.get$isNum = function() { 18889 lang_Type.prototype.get$isNum = function() {
18889 return false; 18890 return false;
18890 } 18891 }
18891 Type.prototype.get$isVoid = function() { 18892 lang_Type.prototype.get$isVoid = function() {
18892 return false; 18893 return false;
18893 } 18894 }
18894 Type.prototype.get$isNullable = function() { 18895 lang_Type.prototype.get$isNullable = function() {
18895 return true; 18896 return true;
18896 } 18897 }
18897 Type.prototype.get$isVarOrFunction = function() { 18898 lang_Type.prototype.get$isVarOrFunction = function() {
18898 return $notnull_bool(this.get$isVar()) || $notnull_bool(this.get$isFunction()) ; 18899 return $notnull_bool(this.get$isVar()) || $notnull_bool(this.get$isFunction()) ;
18899 } 18900 }
18900 Type.prototype.get$isVarOrObject = function() { 18901 lang_Type.prototype.get$isVarOrObject = function() {
18901 return $notnull_bool(this.get$isVar()) || $notnull_bool(this.get$isObject()); 18902 return $notnull_bool(this.get$isVar()) || $notnull_bool(this.get$isObject());
18902 } 18903 }
18903 Type.prototype.getCallMethod = function() { 18904 lang_Type.prototype.getCallMethod = function() {
18904 return null; 18905 return null;
18905 } 18906 }
18906 Type.prototype.get$isClosed = function() { 18907 lang_Type.prototype.get$isClosed = function() {
18907 return $notnull_bool(this.get$isString()) || $notnull_bool(this.get$isBool()) || $notnull_bool(this.get$isNum()) || $notnull_bool(this.get$isFunction()) || $n otnull_bool(this.get$isVar()); 18908 return $notnull_bool(this.get$isString()) || $notnull_bool(this.get$isBool()) || $notnull_bool(this.get$isNum()) || $notnull_bool(this.get$isFunction()) || $n otnull_bool(this.get$isVar());
18908 } 18909 }
18909 Type.prototype.get$isUsed = function() { 18910 lang_Type.prototype.get$isUsed = function() {
18910 return false; 18911 return false;
18911 } 18912 }
18912 Type.prototype.get$isGeneric = function() { 18913 lang_Type.prototype.get$isGeneric = function() {
18913 return false; 18914 return false;
18914 } 18915 }
18915 Type.prototype.get$isNativeType = function() { 18916 lang_Type.prototype.get$isNativeType = function() {
18916 return false; 18917 return false;
18917 } 18918 }
18918 Type.prototype.get$isNative = function() { 18919 lang_Type.prototype.get$isNative = function() {
18919 return this.get$isNativeType(); 18920 return this.get$isNativeType();
18920 } 18921 }
18921 Type.prototype.get$hasTypeParams = function() { 18922 lang_Type.prototype.get$hasTypeParams = function() {
18922 return false; 18923 return false;
18923 } 18924 }
18924 Type.prototype.get$typeofName = function() { 18925 lang_Type.prototype.get$typeofName = function() {
18925 return null; 18926 return null;
18926 } 18927 }
18927 Type.prototype.get$jsname = function() { 18928 lang_Type.prototype.get$jsname = function() {
18928 return this._jsname == null ? this.name : this._jsname; 18929 return this._jsname == null ? this.name : this._jsname;
18929 } 18930 }
18930 Type.prototype.set$jsname = function(name) { 18931 lang_Type.prototype.set$jsname = function(name) {
18931 return this._jsname = name; 18932 return this._jsname = name;
18932 } 18933 }
18933 Type.prototype.get$members = function() { 18934 lang_Type.prototype.get$members = function() {
18934 return null; 18935 return null;
18935 } 18936 }
18936 Type.prototype.get$definition = function() { 18937 lang_Type.prototype.get$definition = function() {
18937 return null; 18938 return null;
18938 } 18939 }
18939 Type.prototype.get$factories = function() { 18940 lang_Type.prototype.get$factories = function() {
18940 return null; 18941 return null;
18941 } 18942 }
18942 Type.prototype.get$typeArgsInOrder = function() { 18943 lang_Type.prototype.get$typeArgsInOrder = function() {
18943 return null; 18944 return null;
18944 } 18945 }
18945 Type.prototype.get$genericType = function() { 18946 lang_Type.prototype.get$genericType = function() {
18946 return (this && this.is$DefinedType()); 18947 return (this && this.is$DefinedType());
18947 } 18948 }
18948 Type.prototype.get$interfaces = function() { 18949 lang_Type.prototype.get$interfaces = function() {
18949 return null; 18950 return null;
18950 } 18951 }
18951 Type.prototype.get$parent = function() { 18952 lang_Type.prototype.get$parent = function() {
18952 return null; 18953 return null;
18953 } 18954 }
18954 Type.prototype.getAllMembers = function() { 18955 lang_Type.prototype.getAllMembers = function() {
18955 return $map([]); 18956 return $map([]);
18956 } 18957 }
18957 Type.prototype.hashCode = function() { 18958 lang_Type.prototype.hashCode = function() {
18958 return this.name.hashCode(); 18959 return this.name.hashCode();
18959 } 18960 }
18960 Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) { 18961 lang_Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) {
18961 if (!$notnull_bool(this.isSubtypeOf(other))) { 18962 if (!$notnull_bool(this.isSubtypeOf(other))) {
18962 var msg = ('type ' + this.name + ' is not a subtype of ' + other.name + ''); 18963 var msg = ('type ' + this.name + ' is not a subtype of ' + other.name + '');
18963 if ($notnull_bool(typeErrors)) { 18964 if ($notnull_bool(typeErrors)) {
18964 world.error($assert_String(msg), span); 18965 world.error($assert_String(msg), span);
18965 } 18966 }
18966 else { 18967 else {
18967 world.warning($assert_String(msg), span); 18968 world.warning($assert_String(msg), span);
18968 } 18969 }
18969 } 18970 }
18970 } 18971 }
18971 Type.prototype.needsVarCall = function(args) { 18972 lang_Type.prototype.needsVarCall = function(args) {
18972 if ($notnull_bool(this.get$isVarOrFunction())) { 18973 if ($notnull_bool(this.get$isVarOrFunction())) {
18973 return true; 18974 return true;
18974 } 18975 }
18975 var call = this.getCallMethod(); 18976 var call = this.getCallMethod();
18976 if ($notnull_bool($ne(call, null))) { 18977 if ($notnull_bool($ne(call, null))) {
18977 if (args.get$length() != call.get$parameters().length || !$notnull_bool(call .namesInOrder$1(args))) { 18978 if (args.get$length() != call.get$parameters().length || !$notnull_bool(call .namesInOrder$1(args))) {
18978 return true; 18979 return true;
18979 } 18980 }
18980 } 18981 }
18981 return false; 18982 return false;
18982 } 18983 }
18983 Type.union = function(x, y) { 18984 lang_Type.union = function(x, y) {
18984 if ($eq(x, y)) return x; 18985 if ($eq(x, y)) return x;
18985 if ($notnull_bool(x.get$isNum()) && $notnull_bool(y.get$isNum())) return world .numType; 18986 if ($notnull_bool(x.get$isNum()) && $notnull_bool(y.get$isNum())) return world .numType;
18986 if ($notnull_bool(x.get$isString()) && $notnull_bool(y.get$isString())) return world.stringType; 18987 if ($notnull_bool(x.get$isString()) && $notnull_bool(y.get$isString())) return world.stringType;
18987 return world.varType; 18988 return world.varType;
18988 } 18989 }
18989 Type.prototype.isAssignable = function(other) { 18990 lang_Type.prototype.isAssignable = function(other) {
18990 return $notnull_bool(this.isSubtypeOf(other)) || $notnull_bool(other.isSubtype Of(this)); 18991 return $notnull_bool(this.isSubtypeOf(other)) || $notnull_bool(other.isSubtype Of(this));
18991 } 18992 }
18992 Type.prototype._isDirectSupertypeOf = function(other) { 18993 lang_Type.prototype._isDirectSupertypeOf = function(other) {
18993 var $this = this; // closure support 18994 var $this = this; // closure support
18994 if ($notnull_bool(other.get$isClass())) { 18995 if ($notnull_bool(other.get$isClass())) {
18995 return $eq(other.get$parent(), this) || $notnull_bool(this.get$isObject()) & & other.get$parent() == null; 18996 return $eq(other.get$parent(), this) || $notnull_bool(this.get$isObject()) & & other.get$parent() == null;
18996 } 18997 }
18997 else { 18998 else {
18998 if (other.get$interfaces() == null || other.get$interfaces().isEmpty()) { 18999 if (other.get$interfaces() == null || other.get$interfaces().isEmpty()) {
18999 return this.get$isObject(); 19000 return this.get$isObject();
19000 } 19001 }
19001 else { 19002 else {
19002 return other.get$interfaces().some((function (i) { 19003 return other.get$interfaces().some((function (i) {
19003 return $eq(i, $this); 19004 return $eq(i, $this);
19004 }) 19005 })
19005 ); 19006 );
19006 } 19007 }
19007 } 19008 }
19008 } 19009 }
19009 Type.prototype.isSubtypeOf = function(other) { 19010 lang_Type.prototype.isSubtypeOf = function(other) {
19010 if ((other instanceof ParameterType)) { 19011 if ((other instanceof ParameterType)) {
19011 return true; 19012 return true;
19012 } 19013 }
19013 if ($eq(this, other)) return true; 19014 if ($eq(this, other)) return true;
19014 if ($notnull_bool(this.get$isVar())) return true; 19015 if ($notnull_bool(this.get$isVar())) return true;
19015 if ($notnull_bool(other.get$isVar())) return true; 19016 if ($notnull_bool(other.get$isVar())) return true;
19016 if ($notnull_bool(other._isDirectSupertypeOf(this))) return true; 19017 if ($notnull_bool(other._isDirectSupertypeOf(this))) return true;
19017 var call = this.getCallMethod(); 19018 var call = this.getCallMethod();
19018 var otherCall = other.getCallMethod(); 19019 var otherCall = other.getCallMethod();
19019 if ($notnull_bool($ne(call, null)) && $notnull_bool($ne(otherCall, null))) { 19020 if ($notnull_bool($ne(call, null)) && $notnull_bool($ne(otherCall, null))) {
19020 return Type._isFunctionSubtypeOf((call && call.is$MethodMember()), (otherCal l && otherCall.is$MethodMember())); 19021 return lang_Type._isFunctionSubtypeOf((call && call.is$MethodMember()), (oth erCall && otherCall.is$MethodMember()));
19021 } 19022 }
19022 if ($eq(this.get$genericType(), other.get$genericType()) && $notnull_bool($ne( this.get$typeArgsInOrder(), null)) && $notnull_bool($ne(other.get$typeArgsInOrde r(), null)) && this.get$typeArgsInOrder().length == other.get$typeArgsInOrder(). length) { 19023 if ($eq(this.get$genericType(), other.get$genericType()) && $notnull_bool($ne( this.get$typeArgsInOrder(), null)) && $notnull_bool($ne(other.get$typeArgsInOrde r(), null)) && this.get$typeArgsInOrder().length == other.get$typeArgsInOrder(). length) {
19023 var t = this.get$typeArgsInOrder().iterator$0(); 19024 var t = this.get$typeArgsInOrder().iterator$0();
19024 var s = other.get$typeArgsInOrder().iterator$0(); 19025 var s = other.get$typeArgsInOrder().iterator$0();
19025 while ($notnull_bool(t.hasNext$0())) { 19026 while ($notnull_bool(t.hasNext$0())) {
19026 if (!$notnull_bool(t.next$0().isSubtypeOf$1(s.next$0()))) return false; 19027 if (!$notnull_bool(t.next$0().isSubtypeOf$1(s.next$0()))) return false;
19027 } 19028 }
19028 return true; 19029 return true;
19029 } 19030 }
19030 if (this.get$parent() != null && $notnull_bool(this.get$parent().isSubtypeOf(o ther))) { 19031 if (this.get$parent() != null && $notnull_bool(this.get$parent().isSubtypeOf(o ther))) {
19031 return true; 19032 return true;
19032 } 19033 }
19033 if (this.get$interfaces() != null && this.get$interfaces().some((function (i) { 19034 if (this.get$interfaces() != null && this.get$interfaces().some((function (i) {
19034 return i.isSubtypeOf$1(other); 19035 return i.isSubtypeOf$1(other);
19035 }) 19036 })
19036 )) { 19037 )) {
19037 return true; 19038 return true;
19038 } 19039 }
19039 return false; 19040 return false;
19040 } 19041 }
19041 Type._isFunctionSubtypeOf = function(t, s) { 19042 lang_Type._isFunctionSubtypeOf = function(t, s) {
19042 if (!$notnull_bool(s.returnType.get$isVoid()) && !$notnull_bool(s.returnType.i sAssignable(t.returnType))) { 19043 if (!$notnull_bool(s.returnType.get$isVoid()) && !$notnull_bool(s.returnType.i sAssignable(t.returnType))) {
19043 return false; 19044 return false;
19044 } 19045 }
19045 var tp = t.parameters; 19046 var tp = t.parameters;
19046 var sp = s.parameters; 19047 var sp = s.parameters;
19047 if (tp.length < sp.length) return false; 19048 if (tp.length < sp.length) return false;
19048 for (var i = 0; 19049 for (var i = 0;
19049 i < sp.length; i++) { 19050 i < sp.length; i++) {
19050 if ($ne(tp.$index(i).get$isOptional(), sp.$index(i).get$isOptional())) retur n false; 19051 if ($ne(tp.$index(i).get$isOptional(), sp.$index(i).get$isOptional())) retur n false;
19051 if ($notnull_bool(tp.$index(i).get$isOptional()) && $notnull_bool($ne(tp.$in dex(i).get$name(), sp.$index(i).get$name()))) return false; 19052 if ($notnull_bool(tp.$index(i).get$isOptional()) && $notnull_bool($ne(tp.$in dex(i).get$name(), sp.$index(i).get$name()))) return false;
19052 if (!$notnull_bool(tp.$index(i).type.isAssignable$1(sp.$index(i).type))) ret urn false; 19053 if (!$notnull_bool(tp.$index(i).type.isAssignable$1(sp.$index(i).type))) ret urn false;
19053 } 19054 }
19054 if (tp.length > sp.length && !$notnull_bool(tp.$index(sp.length).get$isOptiona l())) return false; 19055 if (tp.length > sp.length && !$notnull_bool(tp.$index(sp.length).get$isOptiona l())) return false;
19055 return true; 19056 return true;
19056 } 19057 }
19057 Type.prototype.addDirectSubtype$1 = function($0) { 19058 lang_Type.prototype.addDirectSubtype$1 = function($0) {
19058 return this.addDirectSubtype(($0 && $0.is$Type())); 19059 return this.addDirectSubtype(($0 && $0.is$lang_Type()));
19059 }; 19060 };
19060 Type.prototype.ensureSubtypeOf$3 = function($0, $1, $2) { 19061 lang_Type.prototype.ensureSubtypeOf$3 = function($0, $1, $2) {
19061 return this.ensureSubtypeOf(($0 && $0.is$Type()), ($1 && $1.is$SourceSpan()), $assert_bool($2)); 19062 return this.ensureSubtypeOf(($0 && $0.is$lang_Type()), ($1 && $1.is$SourceSpan ()), $assert_bool($2));
19062 }; 19063 };
19063 Type.prototype.getConstructor$1 = function($0) { 19064 lang_Type.prototype.getConstructor$1 = function($0) {
19064 return this.getConstructor($assert_String($0)); 19065 return this.getConstructor($assert_String($0));
19065 }; 19066 };
19066 Type.prototype.getFactory$2 = function($0, $1) { 19067 lang_Type.prototype.getFactory$2 = function($0, $1) {
19067 return this.getFactory(($0 && $0.is$Type()), $assert_String($1)); 19068 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1));
19068 }; 19069 };
19069 Type.prototype.getMember$1 = function($0) { 19070 lang_Type.prototype.getMember$1 = function($0) {
19070 return this.getMember($assert_String($0)); 19071 return this.getMember($assert_String($0));
19071 }; 19072 };
19072 Type.prototype.getOrMakeConcreteType$1 = function($0) { 19073 lang_Type.prototype.getOrMakeConcreteType$1 = function($0) {
19073 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); 19074 return this.getOrMakeConcreteType(($0 && $0.is$List$Type()));
19074 }; 19075 };
19075 Type.prototype.hashCode$0 = function() { 19076 lang_Type.prototype.hashCode$0 = function() {
19076 return this.hashCode(); 19077 return this.hashCode();
19077 }; 19078 };
19078 Type.prototype.isAssignable$1 = function($0) { 19079 lang_Type.prototype.isAssignable$1 = function($0) {
19079 return this.isAssignable(($0 && $0.is$Type())); 19080 return this.isAssignable(($0 && $0.is$lang_Type()));
19080 }; 19081 };
19081 Type.prototype.isSubtypeOf$1 = function($0) { 19082 lang_Type.prototype.isSubtypeOf$1 = function($0) {
19082 return this.isSubtypeOf(($0 && $0.is$Type())); 19083 return this.isSubtypeOf(($0 && $0.is$lang_Type()));
19083 }; 19084 };
19084 Type.prototype.markUsed$0 = function() { 19085 lang_Type.prototype.markUsed$0 = function() {
19085 return this.markUsed(); 19086 return this.markUsed();
19086 }; 19087 };
19087 Type.prototype.resolveMember$1 = function($0) { 19088 lang_Type.prototype.resolveMember$1 = function($0) {
19088 return this.resolveMember($assert_String($0)); 19089 return this.resolveMember($assert_String($0));
19089 }; 19090 };
19090 Type.prototype.resolveTypeParams$1 = function($0) { 19091 lang_Type.prototype.resolveTypeParams$1 = function($0) {
19091 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); 19092 return this.resolveTypeParams(($0 && $0.is$ConcreteType()));
19092 }; 19093 };
19093 // ********** Code for ParameterType ************** 19094 // ********** Code for ParameterType **************
19094 function ParameterType(name, typeParameter) { 19095 function ParameterType(name, typeParameter) {
19095 this.typeParameter = typeParameter; 19096 this.typeParameter = typeParameter;
19096 // Initializers done 19097 // Initializers done
19097 Type.call(this, name); 19098 lang_Type.call(this, name);
19098 } 19099 }
19099 $inherits(ParameterType, Type); 19100 $inherits(ParameterType, lang_Type);
19100 ParameterType.prototype.is$ParameterType = function(){return this;}; 19101 ParameterType.prototype.is$ParameterType = function(){return this;};
19101 ParameterType.prototype.get$isClass = function() { 19102 ParameterType.prototype.get$isClass = function() {
19102 return false; 19103 return false;
19103 } 19104 }
19104 ParameterType.prototype.get$library = function() { 19105 ParameterType.prototype.get$library = function() {
19105 return null; 19106 return null;
19106 } 19107 }
19107 ParameterType.prototype.get$span = function() { 19108 ParameterType.prototype.get$span = function() {
19108 return this.typeParameter.span; 19109 return this.typeParameter.span;
19109 } 19110 }
(...skipping 13 matching lines...) Expand all
19123 return this.extendsType.resolveMember(memberName); 19124 return this.extendsType.resolveMember(memberName);
19124 } 19125 }
19125 ParameterType.prototype.getConstructor = function(constructorName) { 19126 ParameterType.prototype.getConstructor = function(constructorName) {
19126 world.internalError('no constructors on type parameters yet'); 19127 world.internalError('no constructors on type parameters yet');
19127 } 19128 }
19128 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) { 19129 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) {
19129 world.internalError('no concrete types of type parameters yet', this.get$span( )); 19130 world.internalError('no concrete types of type parameters yet', this.get$span( ));
19130 } 19131 }
19131 ParameterType.prototype.resolveTypeParams = function(inType) { 19132 ParameterType.prototype.resolveTypeParams = function(inType) {
19132 var $0; 19133 var $0;
19133 return (($0 = inType.typeArguments.$index(this.name)) && $0.is$Type()); 19134 return (($0 = inType.typeArguments.$index(this.name)) && $0.is$lang_Type());
19134 } 19135 }
19135 ParameterType.prototype.addDirectSubtype = function(type) { 19136 ParameterType.prototype.addDirectSubtype = function(type) {
19136 world.internalError('no subtypes of type parameters yet', this.get$span()); 19137 world.internalError('no subtypes of type parameters yet', this.get$span());
19137 } 19138 }
19138 ParameterType.prototype.resolve = function(inType) { 19139 ParameterType.prototype.resolve = function(inType) {
19139 if (this.typeParameter.extendsType != null) { 19140 if (this.typeParameter.extendsType != null) {
19140 this.extendsType = inType.resolveType(this.typeParameter.extendsType, true); 19141 this.extendsType = inType.resolveType(this.typeParameter.extendsType, true);
19141 } 19142 }
19142 else { 19143 else {
19143 this.extendsType = world.objectType; 19144 this.extendsType = world.objectType;
19144 } 19145 }
19145 } 19146 }
19146 ParameterType.prototype.addDirectSubtype$1 = function($0) { 19147 ParameterType.prototype.addDirectSubtype$1 = function($0) {
19147 return this.addDirectSubtype(($0 && $0.is$Type())); 19148 return this.addDirectSubtype(($0 && $0.is$lang_Type()));
19148 }; 19149 };
19149 ParameterType.prototype.getConstructor$1 = function($0) { 19150 ParameterType.prototype.getConstructor$1 = function($0) {
19150 return this.getConstructor($assert_String($0)); 19151 return this.getConstructor($assert_String($0));
19151 }; 19152 };
19152 ParameterType.prototype.getOrMakeConcreteType$1 = function($0) { 19153 ParameterType.prototype.getOrMakeConcreteType$1 = function($0) {
19153 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); 19154 return this.getOrMakeConcreteType(($0 && $0.is$List$Type()));
19154 }; 19155 };
19155 ParameterType.prototype.isSubtypeOf$1 = function($0) { 19156 ParameterType.prototype.isSubtypeOf$1 = function($0) {
19156 return this.isSubtypeOf(($0 && $0.is$Type())); 19157 return this.isSubtypeOf(($0 && $0.is$lang_Type()));
19157 }; 19158 };
19158 ParameterType.prototype.resolve$1 = function($0) { 19159 ParameterType.prototype.resolve$1 = function($0) {
19159 return this.resolve(($0 && $0.is$Type())); 19160 return this.resolve(($0 && $0.is$lang_Type()));
19160 }; 19161 };
19161 ParameterType.prototype.resolveMember$1 = function($0) { 19162 ParameterType.prototype.resolveMember$1 = function($0) {
19162 return this.resolveMember($assert_String($0)); 19163 return this.resolveMember($assert_String($0));
19163 }; 19164 };
19164 ParameterType.prototype.resolveTypeParams$1 = function($0) { 19165 ParameterType.prototype.resolveTypeParams$1 = function($0) {
19165 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); 19166 return this.resolveTypeParams(($0 && $0.is$ConcreteType()));
19166 }; 19167 };
19167 // ********** Code for NonNullableType ************** 19168 // ********** Code for NonNullableType **************
19168 function NonNullableType(type) { 19169 function NonNullableType(type) {
19169 this.type = type; 19170 this.type = type;
19170 // Initializers done 19171 // Initializers done
19171 Type.call(this, type.name); 19172 lang_Type.call(this, type.name);
19172 } 19173 }
19173 $inherits(NonNullableType, Type); 19174 $inherits(NonNullableType, lang_Type);
19174 NonNullableType.prototype.get$type = function() { return this.type; }; 19175 NonNullableType.prototype.get$type = function() { return this.type; };
19175 NonNullableType.prototype.get$isNullable = function() { 19176 NonNullableType.prototype.get$isNullable = function() {
19176 return false; 19177 return false;
19177 } 19178 }
19178 NonNullableType.prototype.get$isBool = function() { 19179 NonNullableType.prototype.get$isBool = function() {
19179 return this.type.get$isBool(); 19180 return this.type.get$isBool();
19180 } 19181 }
19181 NonNullableType.prototype.get$isUsed = function() { 19182 NonNullableType.prototype.get$isUsed = function() {
19182 return false; 19183 return false;
19183 } 19184 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
19268 NonNullableType.prototype.get$parent = function() { 19269 NonNullableType.prototype.get$parent = function() {
19269 return this.type.get$parent(); 19270 return this.type.get$parent();
19270 } 19271 }
19271 NonNullableType.prototype.getAllMembers = function() { 19272 NonNullableType.prototype.getAllMembers = function() {
19272 return this.type.getAllMembers(); 19273 return this.type.getAllMembers();
19273 } 19274 }
19274 NonNullableType.prototype.get$isNativeType = function() { 19275 NonNullableType.prototype.get$isNativeType = function() {
19275 return this.type.get$isNativeType(); 19276 return this.type.get$isNativeType();
19276 } 19277 }
19277 NonNullableType.prototype.addDirectSubtype$1 = function($0) { 19278 NonNullableType.prototype.addDirectSubtype$1 = function($0) {
19278 return this.addDirectSubtype(($0 && $0.is$Type())); 19279 return this.addDirectSubtype(($0 && $0.is$lang_Type()));
19279 }; 19280 };
19280 NonNullableType.prototype.getConstructor$1 = function($0) { 19281 NonNullableType.prototype.getConstructor$1 = function($0) {
19281 return this.getConstructor($assert_String($0)); 19282 return this.getConstructor($assert_String($0));
19282 }; 19283 };
19283 NonNullableType.prototype.getFactory$2 = function($0, $1) { 19284 NonNullableType.prototype.getFactory$2 = function($0, $1) {
19284 return this.getFactory(($0 && $0.is$Type()), $assert_String($1)); 19285 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1));
19285 }; 19286 };
19286 NonNullableType.prototype.getMember$1 = function($0) { 19287 NonNullableType.prototype.getMember$1 = function($0) {
19287 return this.getMember($assert_String($0)); 19288 return this.getMember($assert_String($0));
19288 }; 19289 };
19289 NonNullableType.prototype.getOrMakeConcreteType$1 = function($0) { 19290 NonNullableType.prototype.getOrMakeConcreteType$1 = function($0) {
19290 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); 19291 return this.getOrMakeConcreteType(($0 && $0.is$List$Type()));
19291 }; 19292 };
19292 NonNullableType.prototype.isSubtypeOf$1 = function($0) { 19293 NonNullableType.prototype.isSubtypeOf$1 = function($0) {
19293 return this.isSubtypeOf(($0 && $0.is$Type())); 19294 return this.isSubtypeOf(($0 && $0.is$lang_Type()));
19294 }; 19295 };
19295 NonNullableType.prototype.markUsed$0 = function() { 19296 NonNullableType.prototype.markUsed$0 = function() {
19296 return this.markUsed(); 19297 return this.markUsed();
19297 }; 19298 };
19298 NonNullableType.prototype.resolveMember$1 = function($0) { 19299 NonNullableType.prototype.resolveMember$1 = function($0) {
19299 return this.resolveMember($assert_String($0)); 19300 return this.resolveMember($assert_String($0));
19300 }; 19301 };
19301 NonNullableType.prototype.resolveTypeParams$1 = function($0) { 19302 NonNullableType.prototype.resolveTypeParams$1 = function($0) {
19302 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); 19303 return this.resolveTypeParams(($0 && $0.is$ConcreteType()));
19303 }; 19304 };
19304 // ********** Code for ConcreteType ************** 19305 // ********** Code for ConcreteType **************
19305 function ConcreteType(name, genericType, typeArguments, typeArgsInOrder) { 19306 function ConcreteType(name, genericType, typeArguments, typeArgsInOrder) {
19306 this.genericType = genericType; 19307 this.genericType = genericType;
19307 this.typeArguments = typeArguments; 19308 this.typeArguments = typeArguments;
19308 this.typeArgsInOrder = typeArgsInOrder; 19309 this.typeArgsInOrder = typeArgsInOrder;
19309 this.constructors = $map([]); 19310 this.constructors = $map([]);
19310 this.members = $map([]); 19311 this.members = $map([]);
19311 this.factories = new FactoryMap(); 19312 this.factories = new FactoryMap();
19312 // Initializers done 19313 // Initializers done
19313 Type.call(this, name); 19314 lang_Type.call(this, name);
19314 } 19315 }
19315 $inherits(ConcreteType, Type); 19316 $inherits(ConcreteType, lang_Type);
19316 ConcreteType.prototype.is$ConcreteType = function(){return this;}; 19317 ConcreteType.prototype.is$ConcreteType = function(){return this;};
19317 ConcreteType.prototype.get$genericType = function() { return this.genericType; } ; 19318 ConcreteType.prototype.get$genericType = function() { return this.genericType; } ;
19318 ConcreteType.prototype.get$typeArgsInOrder = function() { return this.typeArgsIn Order; }; 19319 ConcreteType.prototype.get$typeArgsInOrder = function() { return this.typeArgsIn Order; };
19319 ConcreteType.prototype.set$typeArgsInOrder = function(value) { return this.typeA rgsInOrder = value; }; 19320 ConcreteType.prototype.set$typeArgsInOrder = function(value) { return this.typeA rgsInOrder = value; };
19320 ConcreteType.prototype.get$isList = function() { 19321 ConcreteType.prototype.get$isList = function() {
19321 return this.genericType.get$isList(); 19322 return this.genericType.get$isList();
19322 } 19323 }
19323 ConcreteType.prototype.get$isClass = function() { 19324 ConcreteType.prototype.get$isClass = function() {
19324 return this.genericType.isClass; 19325 return this.genericType.isClass;
19325 } 19326 }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
19436 var $list = this.genericType.get$subtypes(); 19437 var $list = this.genericType.get$subtypes();
19437 for (var $i = this.genericType.get$subtypes().iterator(); $i.hasNext$0(); ) { 19438 for (var $i = this.genericType.get$subtypes().iterator(); $i.hasNext$0(); ) {
19438 var t = $i.next$0(); 19439 var t = $i.next$0();
19439 var m = t.get$members().$index(memberName); 19440 var m = t.get$members().$index(memberName);
19440 if ($notnull_bool($ne(m, null))) ret.add$1(m); 19441 if ($notnull_bool($ne(m, null))) ret.add$1(m);
19441 } 19442 }
19442 return (ret && ret.is$MemberSet()); 19443 return (ret && ret.is$MemberSet());
19443 } 19444 }
19444 ConcreteType.prototype.resolveType = function(node, isRequired) { 19445 ConcreteType.prototype.resolveType = function(node, isRequired) {
19445 var ret = this.genericType.resolveType(node, isRequired); 19446 var ret = this.genericType.resolveType(node, isRequired);
19446 return (ret && ret.is$Type()); 19447 return (ret && ret.is$lang_Type());
19447 } 19448 }
19448 ConcreteType.prototype.addDirectSubtype = function(type) { 19449 ConcreteType.prototype.addDirectSubtype = function(type) {
19449 this.genericType.addDirectSubtype(type); 19450 this.genericType.addDirectSubtype(type);
19450 } 19451 }
19451 ConcreteType.prototype.addDirectSubtype$1 = function($0) { 19452 ConcreteType.prototype.addDirectSubtype$1 = function($0) {
19452 return this.addDirectSubtype(($0 && $0.is$Type())); 19453 return this.addDirectSubtype(($0 && $0.is$lang_Type()));
19453 }; 19454 };
19454 ConcreteType.prototype.getConstructor$1 = function($0) { 19455 ConcreteType.prototype.getConstructor$1 = function($0) {
19455 return this.getConstructor($assert_String($0)); 19456 return this.getConstructor($assert_String($0));
19456 }; 19457 };
19457 ConcreteType.prototype.getFactory$2 = function($0, $1) { 19458 ConcreteType.prototype.getFactory$2 = function($0, $1) {
19458 return this.getFactory(($0 && $0.is$Type()), $assert_String($1)); 19459 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1));
19459 }; 19460 };
19460 ConcreteType.prototype.getMember$1 = function($0) { 19461 ConcreteType.prototype.getMember$1 = function($0) {
19461 return this.getMember($assert_String($0)); 19462 return this.getMember($assert_String($0));
19462 }; 19463 };
19463 ConcreteType.prototype.getOrMakeConcreteType$1 = function($0) { 19464 ConcreteType.prototype.getOrMakeConcreteType$1 = function($0) {
19464 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); 19465 return this.getOrMakeConcreteType(($0 && $0.is$List$Type()));
19465 }; 19466 };
19466 ConcreteType.prototype.markUsed$0 = function() { 19467 ConcreteType.prototype.markUsed$0 = function() {
19467 return this.markUsed(); 19468 return this.markUsed();
19468 }; 19469 };
19469 ConcreteType.prototype.resolveMember$1 = function($0) { 19470 ConcreteType.prototype.resolveMember$1 = function($0) {
19470 return this.resolveMember($assert_String($0)); 19471 return this.resolveMember($assert_String($0));
19471 }; 19472 };
19472 ConcreteType.prototype.resolveTypeParams$1 = function($0) { 19473 ConcreteType.prototype.resolveTypeParams$1 = function($0) {
19473 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); 19474 return this.resolveTypeParams(($0 && $0.is$ConcreteType()));
19474 }; 19475 };
19475 // ********** Code for DefinedType ************** 19476 // ********** Code for DefinedType **************
19476 function DefinedType(name, library, definition, isClass) { 19477 function DefinedType(name, library, definition, isClass) {
19477 this.isUsed = false 19478 this.isUsed = false
19478 this.isNativeType = false 19479 this.isNativeType = false
19479 this.library = library; 19480 this.library = library;
19480 this.isClass = isClass; 19481 this.isClass = isClass;
19481 this.directSubtypes = new HashSetImplementation(); 19482 this.directSubtypes = new HashSetImplementation();
19482 this.constructors = $map([]); 19483 this.constructors = $map([]);
19483 this.members = $map([]); 19484 this.members = $map([]);
19484 this.factories = new FactoryMap(); 19485 this.factories = new FactoryMap();
19485 this._resolvedMembers = $map([]); 19486 this._resolvedMembers = $map([]);
19486 // Initializers done 19487 // Initializers done
19487 Type.call(this, name); 19488 lang_Type.call(this, name);
19488 this.setDefinition(definition); 19489 this.setDefinition(definition);
19489 } 19490 }
19490 $inherits(DefinedType, Type); 19491 $inherits(DefinedType, lang_Type);
19491 DefinedType.prototype.is$DefinedType = function(){return this;}; 19492 DefinedType.prototype.is$DefinedType = function(){return this;};
19492 DefinedType.prototype.get$definition = function() { return this.definition; }; 19493 DefinedType.prototype.get$definition = function() { return this.definition; };
19493 DefinedType.prototype.set$definition = function(value) { return this.definition = value; }; 19494 DefinedType.prototype.set$definition = function(value) { return this.definition = value; };
19494 DefinedType.prototype.get$library = function() { return this.library; }; 19495 DefinedType.prototype.get$library = function() { return this.library; };
19495 DefinedType.prototype.get$isClass = function() { return this.isClass; }; 19496 DefinedType.prototype.get$isClass = function() { return this.isClass; };
19496 DefinedType.prototype.get$parent = function() { 19497 DefinedType.prototype.get$parent = function() {
19497 return this._parent; 19498 return this._parent;
19498 } 19499 }
19499 DefinedType.prototype.set$parent = function(p) { 19500 DefinedType.prototype.set$parent = function(p) {
19500 this._parent = p; 19501 this._parent = p;
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
19986 name = $assert_String(typeRef.names.last().get$name()); 19987 name = $assert_String(typeRef.names.last().get$name());
19987 } 19988 }
19988 else { 19989 else {
19989 name = typeRef.name.name; 19990 name = typeRef.name.name;
19990 } 19991 }
19991 if (this.typeParameters != null) { 19992 if (this.typeParameters != null) {
19992 var $list = this.typeParameters; 19993 var $list = this.typeParameters;
19993 for (var $i = 0;$i < $list.length; $i++) { 19994 for (var $i = 0;$i < $list.length; $i++) {
19994 var tp = $list.$index($i); 19995 var tp = $list.$index($i);
19995 if ($notnull_bool($eq(tp.get$name(), name))) { 19996 if ($notnull_bool($eq(tp.get$name(), name))) {
19996 typeRef.type = (tp && tp.is$Type()); 19997 typeRef.type = (tp && tp.is$lang_Type());
19997 } 19998 }
19998 } 19999 }
19999 } 20000 }
20000 if (typeRef.type == null) { 20001 if (typeRef.type == null) {
20001 typeRef.type = this.library.findType(typeRef); 20002 typeRef.type = this.library.findType(typeRef);
20002 } 20003 }
20003 if (typeRef.type == null) { 20004 if (typeRef.type == null) {
20004 var message = ('can not find type ' + DefinedType._getDottedName(typeRef) + ''); 20005 var message = ('can not find type ' + DefinedType._getDottedName(typeRef) + '');
20005 if ($notnull_bool(typeErrors)) { 20006 if ($notnull_bool(typeErrors)) {
20006 world.error($assert_String(message), typeRef.span); 20007 world.error($assert_String(message), typeRef.span);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
20058 var paramName = this.typeParameters.$index(i).get$name(); 20059 var paramName = this.typeParameters.$index(i).get$name();
20059 typeMap.$setindex(paramName, typeArgs.$index(i)); 20060 typeMap.$setindex(paramName, typeArgs.$index(i));
20060 names.add$1(typeArgs.$index(i).get$name()); 20061 names.add$1(typeArgs.$index(i).get$name());
20061 } 20062 }
20062 var concreteName = Strings.join((names && names.is$List$String()), '\$'); 20063 var concreteName = Strings.join((names && names.is$List$String()), '\$');
20063 var ret = this._concreteTypes.$index(concreteName); 20064 var ret = this._concreteTypes.$index(concreteName);
20064 if ($notnull_bool(ret == null)) { 20065 if ($notnull_bool(ret == null)) {
20065 ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs ); 20066 ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs );
20066 this._concreteTypes.$setindex(concreteName, ret); 20067 this._concreteTypes.$setindex(concreteName, ret);
20067 } 20068 }
20068 return (ret && ret.is$Type()); 20069 return (ret && ret.is$lang_Type());
20069 } 20070 }
20070 DefinedType.prototype.getCallStub = function(args) { 20071 DefinedType.prototype.getCallStub = function(args) {
20071 $assert(this.get$isFunction(), "isFunction", "type.dart", 1251, 12); 20072 $assert(this.get$isFunction(), "isFunction", "type.dart", 1251, 12);
20072 var name = _getCallStubName('call', args); 20073 var name = _getCallStubName('call', args);
20073 if (this.varStubs == null) this.varStubs = $map([]); 20074 if (this.varStubs == null) this.varStubs = $map([]);
20074 var stub = this.varStubs.$index(name); 20075 var stub = this.varStubs.$index(name);
20075 if ($notnull_bool(stub == null)) { 20076 if ($notnull_bool(stub == null)) {
20076 stub = new VarFunctionStub($assert_String(name), args); 20077 stub = new VarFunctionStub($assert_String(name), args);
20077 this.varStubs.$setindex(name, stub); 20078 this.varStubs.$setindex(name, stub);
20078 } 20079 }
20079 return (stub && stub.is$VarFunctionStub()); 20080 return (stub && stub.is$VarFunctionStub());
20080 } 20081 }
20081 DefinedType.prototype.addDirectSubtype$1 = function($0) { 20082 DefinedType.prototype.addDirectSubtype$1 = function($0) {
20082 return this.addDirectSubtype(($0 && $0.is$Type())); 20083 return this.addDirectSubtype(($0 && $0.is$lang_Type()));
20083 }; 20084 };
20084 DefinedType.prototype.addMethod$2 = function($0, $1) { 20085 DefinedType.prototype.addMethod$2 = function($0, $1) {
20085 return this.addMethod($assert_String($0), ($1 && $1.is$FunctionDefinition())); 20086 return this.addMethod($assert_String($0), ($1 && $1.is$FunctionDefinition()));
20086 }; 20087 };
20087 DefinedType.prototype.getConstructor$1 = function($0) { 20088 DefinedType.prototype.getConstructor$1 = function($0) {
20088 return this.getConstructor($assert_String($0)); 20089 return this.getConstructor($assert_String($0));
20089 }; 20090 };
20090 DefinedType.prototype.getFactory$2 = function($0, $1) { 20091 DefinedType.prototype.getFactory$2 = function($0, $1) {
20091 return this.getFactory(($0 && $0.is$Type()), $assert_String($1)); 20092 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1));
20092 }; 20093 };
20093 DefinedType.prototype.getMember$1 = function($0) { 20094 DefinedType.prototype.getMember$1 = function($0) {
20094 return this.getMember($assert_String($0)); 20095 return this.getMember($assert_String($0));
20095 }; 20096 };
20096 DefinedType.prototype.getOrMakeConcreteType$1 = function($0) { 20097 DefinedType.prototype.getOrMakeConcreteType$1 = function($0) {
20097 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); 20098 return this.getOrMakeConcreteType(($0 && $0.is$List$Type()));
20098 }; 20099 };
20099 DefinedType.prototype.markUsed$0 = function() { 20100 DefinedType.prototype.markUsed$0 = function() {
20100 return this.markUsed(); 20101 return this.markUsed();
20101 }; 20102 };
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
20496 else { 20497 else {
20497 if (argsString.length > 0) argsString = (', ' + argsString + ''); 20498 if (argsString.length > 0) argsString = (', ' + argsString + '');
20498 world.gen.corejs.useOperator(name); 20499 world.gen.corejs.useOperator(name);
20499 return new Value(returnType, ('' + name + '(' + this.code + '' + argsString + ')'), this.span, true); 20500 return new Value(returnType, ('' + name + '(' + this.code + '' + argsString + ')'), this.span, true);
20500 } 20501 }
20501 } 20502 }
20502 Value.prototype.checkFirstClass$1 = function($0) { 20503 Value.prototype.checkFirstClass$1 = function($0) {
20503 return this.checkFirstClass(($0 && $0.is$SourceSpan())); 20504 return this.checkFirstClass(($0 && $0.is$SourceSpan()));
20504 }; 20505 };
20505 Value.prototype.convertTo$3 = function($0, $1, $2) { 20506 Value.prototype.convertTo$3 = function($0, $1, $2) {
20506 return this.convertTo(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Type()), ( $2 && $2.is$Node()), false); 20507 return this.convertTo(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type( )), ($2 && $2.is$lang_Node()), false);
20507 }; 20508 };
20508 Value.prototype.convertTo$4 = function($0, $1, $2, $3) { 20509 Value.prototype.convertTo$4 = function($0, $1, $2, $3) {
20509 return this.convertTo(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Type()), ( $2 && $2.is$Node()), $assert_bool($3)); 20510 return this.convertTo(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type( )), ($2 && $2.is$lang_Node()), $assert_bool($3));
20510 }; 20511 };
20511 Value.prototype.get_$3 = function($0, $1, $2) { 20512 Value.prototype.get_$3 = function($0, $1, $2) {
20512 return this.get_(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $ 2.is$Node())); 20513 return this.get_(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $ 2.is$lang_Node()));
20513 }; 20514 };
20514 Value.prototype.instanceOf$3$isTrue$forceCheck = function($0, $1, $2, isTrue, fo rceCheck) { 20515 Value.prototype.instanceOf$3$isTrue$forceCheck = function($0, $1, $2, isTrue, fo rceCheck) {
20515 return this.instanceOf(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Type()), ($2 && $2.is$SourceSpan()), $assert_bool(isTrue), $assert_bool(forceCheck)); 20516 return this.instanceOf(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type ()), ($2 && $2.is$SourceSpan()), $assert_bool(isTrue), $assert_bool(forceCheck)) ;
20516 }; 20517 };
20517 Value.prototype.instanceOf$4 = function($0, $1, $2, $3) { 20518 Value.prototype.instanceOf$4 = function($0, $1, $2, $3) {
20518 return this.instanceOf(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Type()), ($2 && $2.is$SourceSpan()), $assert_bool($3), false); 20519 return this.instanceOf(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type ()), ($2 && $2.is$SourceSpan()), $assert_bool($3), false);
20519 }; 20520 };
20520 Value.prototype.invoke$4 = function($0, $1, $2, $3) { 20521 Value.prototype.invoke$4 = function($0, $1, $2, $3) {
20521 return this.invoke(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$Node()), ($3 && $3.is$Arguments()), false); 20522 return this.invoke(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$lang_Node()), ($3 && $3.is$Arguments()), false);
20522 }; 20523 };
20523 Value.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 20524 Value.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) {
20524 return this.invoke(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$Node()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic)); 20525 return this.invoke(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$lang_Node()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
20525 }; 20526 };
20526 Value.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 20527 Value.prototype.invoke$5 = function($0, $1, $2, $3, $4) {
20527 return this.invoke(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$Node()), ($3 && $3.is$Arguments()), $assert_bool($4)); 20528 return this.invoke(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$lang_Node()), ($3 && $3.is$Arguments()), $assert_bool($4));
20528 }; 20529 };
20529 Value.prototype.needsConversion$1 = function($0) { 20530 Value.prototype.needsConversion$1 = function($0) {
20530 return this.needsConversion(($0 && $0.is$Type())); 20531 return this.needsConversion(($0 && $0.is$lang_Type()));
20531 }; 20532 };
20532 Value.prototype.set_$4 = function($0, $1, $2, $3) { 20533 Value.prototype.set_$4 = function($0, $1, $2, $3) {
20533 return this.set_(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $ 2.is$Node()), ($3 && $3.is$Value()), false); 20534 return this.set_(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $ 2.is$lang_Node()), ($3 && $3.is$Value()), false);
20534 }; 20535 };
20535 // ********** Code for EvaluatedValue ************** 20536 // ********** Code for EvaluatedValue **************
20536 function EvaluatedValue() {} 20537 function EvaluatedValue() {}
20537 EvaluatedValue._internal$ctor = function(type, actualValue, canonicalCode, span, code) { 20538 EvaluatedValue._internal$ctor = function(type, actualValue, canonicalCode, span, code) {
20538 this.actualValue = actualValue; 20539 this.actualValue = actualValue;
20539 this.canonicalCode = canonicalCode; 20540 this.canonicalCode = canonicalCode;
20540 // Initializers done 20541 // Initializers done
20541 Value.call(this, type, code, span, false); 20542 Value.call(this, type, code, span, false);
20542 } 20543 }
20543 EvaluatedValue._internal$ctor.prototype = EvaluatedValue.prototype; 20544 EvaluatedValue._internal$ctor.prototype = EvaluatedValue.prototype;
20544 $inherits(EvaluatedValue, Value); 20545 $inherits(EvaluatedValue, Value);
20545 EvaluatedValue.EvaluatedValue$factory = function(type, actualValue, canonicalCod e, span) { 20546 EvaluatedValue.EvaluatedValue$factory = function(type, actualValue, canonicalCod e, span) {
20546 return new EvaluatedValue._internal$ctor(type, actualValue, canonicalCode, spa n, EvaluatedValue.codeWithComments(canonicalCode, span)); 20547 return new EvaluatedValue._internal$ctor(type, actualValue, canonicalCode, spa n, EvaluatedValue.codeWithComments(canonicalCode, span));
20547 } 20548 }
20548 EvaluatedValue.prototype.get$actualValue = function() { return this.actualValue; }; 20549 EvaluatedValue.prototype.get$actualValue = function() { return this.actualValue; };
20549 EvaluatedValue.prototype.set$actualValue = function(value) { return this.actualV alue = value; }; 20550 EvaluatedValue.prototype.set$actualValue = function(value) { return this.actualV alue = value; };
20550 EvaluatedValue.prototype.get$isConst = function() { 20551 EvaluatedValue.prototype.get$isConst = function() {
20551 return true; 20552 return true;
20552 } 20553 }
20553 EvaluatedValue.prototype.get$canonicalCode = function() { return this.canonicalC ode; }; 20554 EvaluatedValue.prototype.get$canonicalCode = function() { return this.canonicalC ode; };
20554 EvaluatedValue.prototype.set$canonicalCode = function(value) { return this.canon icalCode = value; }; 20555 EvaluatedValue.prototype.set$canonicalCode = function(value) { return this.canon icalCode = value; };
20555 EvaluatedValue.codeWithComments = function(canonicalCode, span) { 20556 EvaluatedValue.codeWithComments = function(canonicalCode, span) {
20556 return (span != null && span.get$text() != canonicalCode) ? ('' + canonicalCod e + '/*' + span.get$text() + '*/') : canonicalCode; 20557 return (span != null && span.get$text() != canonicalCode) ? ('' + canonicalCod e + '/*' + span.get$text() + '*/') : canonicalCode;
20557 } 20558 }
20558 // ********** Code for ConstListValue ************** 20559 // ********** Code for ConstListValue **************
20559 function ConstListValue() {} 20560 function ConstListValue() {}
20560 ConstListValue._internal$ctor = function(type, values, actualValue, canonicalCod e, span, code) { 20561 ConstListValue._internal$ctor = function(type, values, actualValue, canonicalCod e, span, code) {
20561 this.values = values; 20562 this.values = values;
20562 // Initializers done 20563 // Initializers done
20563 EvaluatedValue._internal$ctor.call(this, (type && type.is$Type()), actualValue , canonicalCode, (span && span.is$SourceSpan()), $assert_String(code)); 20564 EvaluatedValue._internal$ctor.call(this, (type && type.is$lang_Type()), actual Value, canonicalCode, (span && span.is$SourceSpan()), $assert_String(code));
20564 } 20565 }
20565 ConstListValue._internal$ctor.prototype = ConstListValue.prototype; 20566 ConstListValue._internal$ctor.prototype = ConstListValue.prototype;
20566 $inherits(ConstListValue, EvaluatedValue); 20567 $inherits(ConstListValue, EvaluatedValue);
20567 ConstListValue.ConstListValue$factory = function(type, values, actualValue, cano nicalCode, span) { 20568 ConstListValue.ConstListValue$factory = function(type, values, actualValue, cano nicalCode, span) {
20568 return new ConstListValue._internal$ctor(type, values, actualValue, canonicalC ode, span, EvaluatedValue.codeWithComments(canonicalCode, span)); 20569 return new ConstListValue._internal$ctor(type, values, actualValue, canonicalC ode, span, EvaluatedValue.codeWithComments(canonicalCode, span));
20569 } 20570 }
20570 // ********** Code for ConstMapValue ************** 20571 // ********** Code for ConstMapValue **************
20571 function ConstMapValue() {} 20572 function ConstMapValue() {}
20572 ConstMapValue._internal$ctor = function(type, values, actualValue, canonicalCode , span, code) { 20573 ConstMapValue._internal$ctor = function(type, values, actualValue, canonicalCode , span, code) {
20573 this.values = values; 20574 this.values = values;
20574 // Initializers done 20575 // Initializers done
20575 EvaluatedValue._internal$ctor.call(this, (type && type.is$Type()), actualValue , canonicalCode, (span && span.is$SourceSpan()), $assert_String(code)); 20576 EvaluatedValue._internal$ctor.call(this, (type && type.is$lang_Type()), actual Value, canonicalCode, (span && span.is$SourceSpan()), $assert_String(code));
20576 } 20577 }
20577 ConstMapValue._internal$ctor.prototype = ConstMapValue.prototype; 20578 ConstMapValue._internal$ctor.prototype = ConstMapValue.prototype;
20578 $inherits(ConstMapValue, EvaluatedValue); 20579 $inherits(ConstMapValue, EvaluatedValue);
20579 ConstMapValue.ConstMapValue$factory = function(type, keyValuePairs, actualValue, canonicalCode, span) { 20580 ConstMapValue.ConstMapValue$factory = function(type, keyValuePairs, actualValue, canonicalCode, span) {
20580 var values = new HashMapImplementation(); 20581 var values = new HashMapImplementation();
20581 for (var i = 0; 20582 for (var i = 0;
20582 i < keyValuePairs.length; i += 2) { 20583 i < keyValuePairs.length; i += 2) {
20583 values.$setindex(keyValuePairs.$index(i).get$actualValue(), keyValuePairs.$i ndex(i + 1)); 20584 values.$setindex(keyValuePairs.$index(i).get$actualValue(), keyValuePairs.$i ndex(i + 1));
20584 } 20585 }
20585 return new ConstMapValue._internal$ctor(type, values, actualValue, canonicalCo de, span, EvaluatedValue.codeWithComments(canonicalCode, span)); 20586 return new ConstMapValue._internal$ctor(type, values, actualValue, canonicalCo de, span, EvaluatedValue.codeWithComments(canonicalCode, span));
20586 } 20587 }
20587 // ********** Code for ConstObjectValue ************** 20588 // ********** Code for ConstObjectValue **************
20588 function ConstObjectValue() {} 20589 function ConstObjectValue() {}
20589 ConstObjectValue._internal$ctor = function(type, fields, actualValue, canonicalC ode, span, code) { 20590 ConstObjectValue._internal$ctor = function(type, fields, actualValue, canonicalC ode, span, code) {
20590 this.fields = fields; 20591 this.fields = fields;
20591 // Initializers done 20592 // Initializers done
20592 EvaluatedValue._internal$ctor.call(this, (type && type.is$Type()), actualValue , canonicalCode, (span && span.is$SourceSpan()), $assert_String(code)); 20593 EvaluatedValue._internal$ctor.call(this, (type && type.is$lang_Type()), actual Value, canonicalCode, (span && span.is$SourceSpan()), $assert_String(code));
20593 } 20594 }
20594 ConstObjectValue._internal$ctor.prototype = ConstObjectValue.prototype; 20595 ConstObjectValue._internal$ctor.prototype = ConstObjectValue.prototype;
20595 $inherits(ConstObjectValue, EvaluatedValue); 20596 $inherits(ConstObjectValue, EvaluatedValue);
20596 ConstObjectValue.ConstObjectValue$factory = function(type, fields, canonicalCode , span) { 20597 ConstObjectValue.ConstObjectValue$factory = function(type, fields, canonicalCode , span) {
20597 var fieldValues = []; 20598 var fieldValues = [];
20598 var $list = fields.getKeys(); 20599 var $list = fields.getKeys();
20599 for (var $i = fields.getKeys().iterator$0(); $i.hasNext$0(); ) { 20600 for (var $i = fields.getKeys().iterator$0(); $i.hasNext$0(); ) {
20600 var f = $i.next$0(); 20601 var f = $i.next$0();
20601 fieldValues.add(('' + f + ' = ' + fields.$index(f).get$actualValue() + '')); 20602 fieldValues.add(('' + f + ' = ' + fields.$index(f).get$actualValue() + ''));
20602 } 20603 }
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
20856 throw exc; 20857 throw exc;
20857 } 20858 }
20858 } 20859 }
20859 this.printStatus(); 20860 this.printStatus();
20860 return !$notnull_bool(this.get$hasErrors()); 20861 return !$notnull_bool(this.get$hasErrors());
20861 } 20862 }
20862 World.prototype.runLeg = function() { 20863 World.prototype.runLeg = function() {
20863 var $this = this; // closure support 20864 var $this = this; // closure support
20864 if (!$notnull_bool(options.enableLeg)) return false; 20865 if (!$notnull_bool(options.enableLeg)) return false;
20865 var res = $assert_bool(this.withTiming('try leg compile', (function () { 20866 var res = $assert_bool(this.withTiming('try leg compile', (function () {
20866 return leg_compile($this); 20867 return compile($this);
20867 }) 20868 })
20868 )); 20869 ));
20869 if (!$notnull_bool(res) && $notnull_bool(options.legOnly)) { 20870 if (!$notnull_bool(res) && $notnull_bool(options.legOnly)) {
20870 this.fatal(("Leg could not compile " + options.dartScript + "")); 20871 this.fatal(("Leg could not compile " + options.dartScript + ""));
20871 return true; 20872 return true;
20872 } 20873 }
20873 return res; 20874 return res;
20874 } 20875 }
20875 World.prototype.runCompilationPhases = function() { 20876 World.prototype.runCompilationPhases = function() {
20876 var $this = this; // closure support 20877 var $this = this; // closure support
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
21150 this.libDir = $assert_String(temp); 21151 this.libDir = $assert_String(temp);
21151 } 21152 }
21152 else { 21153 else {
21153 this.libDir = 'lib'; 21154 this.libDir = 'lib';
21154 } 21155 }
21155 } 21156 }
21156 } 21157 }
21157 // ********** Code for LibraryReader ************** 21158 // ********** Code for LibraryReader **************
21158 function LibraryReader() { 21159 function LibraryReader() {
21159 // Initializers done 21160 // Initializers done
21160 this._specialLibs = $map(['dart:core', joinPaths(options.libDir, 'corelib.dart '), 'dart:coreimpl', joinPaths(options.libDir, 'corelib_impl.dart'), 'dart:html' , joinPaths(options.libDir, '../../client/html/release/html.dart'), 'dart:dom', joinPaths(options.libDir, 'dom/dom.dart'), 'dart:json', joinPaths(options.libDir , 'json.dart')]); 21161 this._specialLibs = $map(['dart:core', joinPaths(options.libDir, 'corelib.dart '), 'dart:coreimpl', joinPaths(options.libDir, 'corelib_impl.dart'), 'dart:html' , joinPaths(options.libDir, '../../client/html/release/html.dart'), 'dart:dom', joinPaths(options.libDir, '../../client/dom/frog/frog_dom.dart'), 'dart:json', j oinPaths(options.libDir, 'json.dart')]);
21161 } 21162 }
21162 LibraryReader.prototype.readFile = function(fullname) { 21163 LibraryReader.prototype.readFile = function(fullname) {
21163 var filename = this._specialLibs.$index(fullname); 21164 var filename = this._specialLibs.$index(fullname);
21164 if ($notnull_bool(filename == null)) { 21165 if ($notnull_bool(filename == null)) {
21165 filename = fullname; 21166 filename = fullname;
21166 } 21167 }
21167 if ($notnull_bool(world.files.fileExists($assert_String(filename)))) { 21168 if ($notnull_bool(world.files.fileExists($assert_String(filename)))) {
21168 return new SourceFile(filename, world.files.readAll($assert_String(filename) )); 21169 return new SourceFile(filename, world.files.readAll($assert_String(filename) ));
21169 } 21170 }
21170 else { 21171 else {
(...skipping 11 matching lines...) Expand all
21182 VarMember.prototype.get$returnType = function() { 21183 VarMember.prototype.get$returnType = function() {
21183 return world.varType; 21184 return world.varType;
21184 } 21185 }
21185 VarMember.prototype.invoke = function(context, node, target, args) { 21186 VarMember.prototype.invoke = function(context, node, target, args) {
21186 return new Value(this.get$returnType(), ('' + target.code + '.' + this.name + '(' + args.getCode() + ')'), node.span, true); 21187 return new Value(this.get$returnType(), ('' + target.code + '.' + this.name + '(' + args.getCode() + ')'), node.span, true);
21187 } 21188 }
21188 VarMember.prototype.generate$1 = function($0) { 21189 VarMember.prototype.generate$1 = function($0) {
21189 return this.generate(($0 && $0.is$CodeWriter())); 21190 return this.generate(($0 && $0.is$CodeWriter()));
21190 }; 21191 };
21191 VarMember.prototype.invoke$4 = function($0, $1, $2, $3) { 21192 VarMember.prototype.invoke$4 = function($0, $1, $2, $3) {
21192 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments())); 21193 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()));
21193 }; 21194 };
21194 // ********** Code for VarFunctionStub ************** 21195 // ********** Code for VarFunctionStub **************
21195 function VarFunctionStub(name, callArgs) { 21196 function VarFunctionStub(name, callArgs) {
21196 this.args = callArgs.toCallStubArgs(); 21197 this.args = callArgs.toCallStubArgs();
21197 // Initializers done 21198 // Initializers done
21198 VarMember.call(this, name); 21199 VarMember.call(this, name);
21199 world.gen.corejs.useGenStub = true; 21200 world.gen.corejs.useGenStub = true;
21200 } 21201 }
21201 $inherits(VarFunctionStub, VarMember); 21202 $inherits(VarFunctionStub, VarMember);
21202 VarFunctionStub.prototype.is$VarFunctionStub = function(){return this;}; 21203 VarFunctionStub.prototype.is$VarFunctionStub = function(){return this;};
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
21236 function VarMethodStub(name, member, args, body) { 21237 function VarMethodStub(name, member, args, body) {
21237 this.member = member; 21238 this.member = member;
21238 this.args = args; 21239 this.args = args;
21239 this.body = body; 21240 this.body = body;
21240 // Initializers done 21241 // Initializers done
21241 VarMember.call(this, name); 21242 VarMember.call(this, name);
21242 } 21243 }
21243 $inherits(VarMethodStub, VarMember); 21244 $inherits(VarMethodStub, VarMember);
21244 VarMethodStub.prototype.get$returnType = function() { 21245 VarMethodStub.prototype.get$returnType = function() {
21245 var $0; 21246 var $0;
21246 return (($0 = this.member != null ? this.member.get$returnType() : world.varTy pe) && $0.is$Type()); 21247 return (($0 = this.member != null ? this.member.get$returnType() : world.varTy pe) && $0.is$lang_Type());
21247 } 21248 }
21248 VarMethodStub.prototype.get$typeName = function() { 21249 VarMethodStub.prototype.get$typeName = function() {
21249 return this.member != null ? this.member.declaringType.get$jsname() : 'Object' ; 21250 return this.member != null ? this.member.declaringType.get$jsname() : 'Object' ;
21250 } 21251 }
21251 VarMethodStub.prototype.generate = function(code) { 21252 VarMethodStub.prototype.generate = function(code) {
21252 code.write(('' + this.get$typeName() + '.prototype.' + this.name + ' = ')); 21253 code.write(('' + this.get$typeName() + '.prototype.' + this.name + ' = '));
21253 this.generateBody(code, ';'); 21254 this.generateBody(code, ';');
21254 } 21255 }
21255 VarMethodStub.prototype.generateBody = function(code, end) { 21256 VarMethodStub.prototype.generateBody = function(code, end) {
21256 if ($notnull_bool(this._useDirectCall(this.member, this.args))) { 21257 if ($notnull_bool(this._useDirectCall(this.member, this.args))) {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
21312 for (var $i = 0;$i < $list.length; $i++) { 21313 for (var $i = 0;$i < $list.length; $i++) {
21313 var member = $list.$index($i); 21314 var member = $list.$index($i);
21314 var target = new Value(member.declaringType, 'this', node.span, true); 21315 var target = new Value(member.declaringType, 'this', node.span, true);
21315 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru e); 21316 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru e);
21316 var stub = new VarMethodStub(this.name, member, this.args, result); 21317 var stub = new VarMethodStub(this.name, member, this.args, result);
21317 var type = member.declaringType; 21318 var type = member.declaringType;
21318 if ($notnull_bool(type.get$isObject())) { 21319 if ($notnull_bool(type.get$isObject())) {
21319 objectStub = stub; 21320 objectStub = stub;
21320 } 21321 }
21321 else if ($ne(type.get$library(), world.get$dom())) { 21322 else if ($ne(type.get$library(), world.get$dom())) {
21322 VarMethodSet._addVarStub((type && type.is$Type()), (stub && stub.is$VarMem ber())); 21323 VarMethodSet._addVarStub((type && type.is$lang_Type()), (stub && stub.is$V arMember()));
21323 } 21324 }
21324 else { 21325 else {
21325 this._fallbackStubs.add(stub); 21326 this._fallbackStubs.add(stub);
21326 } 21327 }
21327 } 21328 }
21328 if ($notnull_bool(objectStub == null)) { 21329 if ($notnull_bool(objectStub == null)) {
21329 var target = new Value(world.objectType, 'this', node.span, true); 21330 var target = new Value(world.objectType, 'this', node.span, true);
21330 var result = target.invokeNoSuchMethod(context, this.get$baseName(), node, t his.args); 21331 var result = target.invokeNoSuchMethod(context, this.get$baseName(), node, t his.args);
21331 objectStub = new VarMethodStub(this.name, null, this.args, result); 21332 objectStub = new VarMethodStub(this.name, null, this.args, result);
21332 } 21333 }
(...skipping 18 matching lines...) Expand all
21351 var stub = $list.$index($i); 21352 var stub = $list.$index($i);
21352 code.write(('"' + stub.get$typeName() + '": ')); 21353 code.write(('"' + stub.get$typeName() + '": '));
21353 stub.generateBody$2(code, $notnull_bool($eq(stub, lastOne)) ? '' : ','); 21354 stub.generateBody$2(code, $notnull_bool($eq(stub, lastOne)) ? '' : ',');
21354 } 21355 }
21355 code.exitBlock('});'); 21356 code.exitBlock('});');
21356 } 21357 }
21357 VarMethodSet.prototype.generate$1 = function($0) { 21358 VarMethodSet.prototype.generate$1 = function($0) {
21358 return this.generate(($0 && $0.is$CodeWriter())); 21359 return this.generate(($0 && $0.is$CodeWriter()));
21359 }; 21360 };
21360 VarMethodSet.prototype.invoke$4 = function($0, $1, $2, $3) { 21361 VarMethodSet.prototype.invoke$4 = function($0, $1, $2, $3) {
21361 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments())); 21362 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()));
21362 }; 21363 };
21363 // ********** Code for top level ************** 21364 // ********** Code for top level **************
21364 function map(source, mapper) { 21365 function map(source, mapper) {
21365 var result = new ListFactory(); 21366 var result = new ListFactory();
21366 if (!!(source && source.is$List)) { 21367 if (!!(source && source.is$List)) {
21367 var list = (source && source.is$List()); 21368 var list = (source && source.is$List());
21368 result.length = list.length; 21369 result.length = list.length;
21369 for (var i = 0; 21370 for (var i = 0;
21370 i < list.length; i++) { 21371 i < list.length; i++) {
21371 result.$setindex(i, mapper(list.$index(i))); 21372 result.$setindex(i, mapper(list.$index(i)));
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
21442 else { 21443 else {
21443 return text; 21444 return text;
21444 } 21445 }
21445 } 21446 }
21446 var world; 21447 var world;
21447 function initializeWorld(files) { 21448 function initializeWorld(files) {
21448 $assert(world == null, "world == null", "world.dart", 13, 10); 21449 $assert(world == null, "world == null", "world.dart", 13, 10);
21449 world = new World(files); 21450 world = new World(files);
21450 world.init(); 21451 world.init();
21451 } 21452 }
21452 function compile(homedir, args, files) { 21453 function lang_compile(homedir, args, files) {
21453 parseOptions(homedir, args, files); 21454 parseOptions(homedir, args, files);
21454 initializeWorld(files); 21455 initializeWorld(files);
21455 var success = world.compile(); 21456 var success = world.compile();
21456 if (options.outfile != null) { 21457 if (options.outfile != null) {
21457 if ($notnull_bool(success)) { 21458 if ($notnull_bool(success)) {
21458 var code = world.getGeneratedCode(); 21459 var code = world.getGeneratedCode();
21459 if (!options.outfile.endsWith('.js')) { 21460 if (!options.outfile.endsWith('.js')) {
21460 code = '#!/usr/bin/env node\n' + code; 21461 code = '#!/usr/bin/env node\n' + code;
21461 } 21462 }
21462 world.files.writeString(options.outfile, $assert_String(code)); 21463 world.files.writeString(options.outfile, $assert_String(code));
(...skipping 15 matching lines...) Expand all
21478 i < args.get$length(); i++) { 21479 i < args.get$length(); i++) {
21479 nameBuilder.add('\$').add(args.getName(i)); 21480 nameBuilder.add('\$').add(args.getName(i));
21480 } 21481 }
21481 return nameBuilder.toString(); 21482 return nameBuilder.toString();
21482 } 21483 }
21483 // ********** Library frog ************** 21484 // ********** Library frog **************
21484 // ********** Code for top level ************** 21485 // ********** Code for top level **************
21485 function main() { 21486 function main() {
21486 var homedir = path.dirname(fs.realpathSync($assert_String(process.argv.$index( 1)))); 21487 var homedir = path.dirname(fs.realpathSync($assert_String(process.argv.$index( 1))));
21487 var argv = ListFactory.ListFactory$from$factory(process.argv); 21488 var argv = ListFactory.ListFactory$from$factory(process.argv);
21488 if ($notnull_bool(compile($assert_String(homedir), (argv && argv.is$List$Strin g()), new NodeFileSystem()))) { 21489 if ($notnull_bool(lang_compile($assert_String(homedir), (argv && argv.is$List$ String()), new NodeFileSystem()))) {
21489 var code = world.getGeneratedCode(); 21490 var code = world.getGeneratedCode();
21490 if (!$notnull_bool(options.compileOnly)) { 21491 if (!$notnull_bool(options.compileOnly)) {
21491 process.argv = [argv.$index(0), argv.$index(1)]; 21492 process.argv = [argv.$index(0), argv.$index(1)];
21492 process.argv.addAll(options.childArgs); 21493 process.argv.addAll(options.childArgs);
21493 vm.runInNewContext($assert_String(code), createSandbox()); 21494 vm.runInNewContext($assert_String(code), createSandbox());
21494 } 21495 }
21495 } 21496 }
21496 else { 21497 else {
21497 process.exit(1); 21498 process.exit(1);
21498 } 21499 }
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
21786 INTERFACE, 21787 INTERFACE,
21787 LIBRARY, 21788 LIBRARY,
21788 NATIVE, 21789 NATIVE,
21789 NEGATE, 21790 NEGATE,
21790 OPERATOR, 21791 OPERATOR,
21791 SET, 21792 SET,
21792 SOURCE, 21793 SOURCE,
21793 STATIC, 21794 STATIC,
21794 TYPEDEF ]*/; 21795 TYPEDEF ]*/;
21795 main(); 21796 main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698