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

Side by Side Diff: frog/frogsh

Issue 8585044: Fixes issues in string interpolation tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove debugging code 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
« no previous file with comments | « no previous file | frog/gen.dart » ('j') | frog/tokenizer.g.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env node 1 #!/usr/bin/env node
2 // ********** Library dart:core ************** 2 // ********** Library dart:core **************
3 // ********** Natives dart:core ************** 3 // ********** Natives dart:core **************
4 /** 4 /**
5 * Generates a dynamic call stub for a function. 5 * Generates a dynamic call stub for a function.
6 * Our goal is to create a stub method like this on-the-fly: 6 * Our goal is to create a stub method like this on-the-fly:
7 * function($0, $1, capture) { 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
7566 SsaCodeGenerator.prototype.parameter = function(index) { 7566 SsaCodeGenerator.prototype.parameter = function(index) {
7567 return $assert_String(this.parameterNames.$index(index)); 7567 return $assert_String(this.parameterNames.$index(index));
7568 } 7568 }
7569 SsaCodeGenerator.prototype.temporary = function(instruction) { 7569 SsaCodeGenerator.prototype.temporary = function(instruction) {
7570 var $0, $1; 7570 var $0, $1;
7571 var id = instruction.id; 7571 var id = instruction.id;
7572 var name = $assert_String(this.names.$index(id)); 7572 var name = $assert_String(this.names.$index(id));
7573 if (name != null) return name; 7573 if (name != null) return name;
7574 var prefix = 't'; 7574 var prefix = 't';
7575 if (!this.prefixes.containsKey(prefix)) this.prefixes.$setindex(prefix, 0); 7575 if (!this.prefixes.containsKey(prefix)) this.prefixes.$setindex(prefix, 0);
7576 return this.newName(id, ('' + prefix + '' + (($0 = this.prefixes).$setindex(pr efix, ($1 = $0.$index(prefix)) + 1), $1) + '')); 7576 return this.newName(id, ('' + prefix + '' + ((($0 = this.prefixes).$setindex(p refix, ($1 = $0.$index(prefix)) + 1), $1)) + ''));
7577 } 7577 }
7578 SsaCodeGenerator.prototype.local = function(local) { 7578 SsaCodeGenerator.prototype.local = function(local) {
7579 var $0, $1; 7579 var $0, $1;
7580 var id = local.id; 7580 var id = local.id;
7581 var name = $assert_String(this.names.$index(id)); 7581 var name = $assert_String(this.names.$index(id));
7582 if (name != null) return name; 7582 if (name != null) return name;
7583 var prefix = local.element.name.get$stringValue(); 7583 var prefix = local.element.name.get$stringValue();
7584 if (!this.prefixes.containsKey(prefix)) { 7584 if (!this.prefixes.containsKey(prefix)) {
7585 this.prefixes.$setindex(prefix, 0); 7585 this.prefixes.$setindex(prefix, 0);
7586 return this.newName(id, prefix); 7586 return this.newName(id, prefix);
7587 } 7587 }
7588 else { 7588 else {
7589 return this.newName(id, ('' + prefix + '_' + (($0 = this.prefixes).$setindex (prefix, ($1 = $0.$index(prefix)) + 1), $1) + '')); 7589 return this.newName(id, ('' + prefix + '_' + ((($0 = this.prefixes).$setinde x(prefix, ($1 = $0.$index(prefix)) + 1), $1)) + ''));
7590 } 7590 }
7591 } 7591 }
7592 SsaCodeGenerator.prototype.newName = function(id, name) { 7592 SsaCodeGenerator.prototype.newName = function(id, name) {
7593 var result = JsNames.getValid(name); 7593 var result = JsNames.getValid(name);
7594 this.names.$setindex(id, result); 7594 this.names.$setindex(id, result);
7595 return result; 7595 return result;
7596 } 7596 }
7597 SsaCodeGenerator.prototype.invoke = function(element, arguments) { 7597 SsaCodeGenerator.prototype.invoke = function(element, arguments) {
7598 var $0; 7598 var $0;
7599 this.buffer.add(('' + element.name + '(')); 7599 this.buffer.add(('' + element.name + '('));
(...skipping 678 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
10106 // Initializers done 10106 // Initializers done
10107 } 10107 }
10108 TypeWarning.prototype.get$arguments = function() { return this.arguments; }; 10108 TypeWarning.prototype.get$arguments = function() { return this.arguments; };
10109 TypeWarning.prototype.getMessage = function() { 10109 TypeWarning.prototype.getMessage = function() {
10110 if (this.message == null) { 10110 if (this.message == null) {
10111 this.message = this.kind.template; 10111 this.message = this.kind.template;
10112 var position = 1; 10112 var position = 1;
10113 var $list = this.arguments; 10113 var $list = this.arguments;
10114 for (var $i0 = 0;$i0 < $list.length; $i0++) { 10114 for (var $i0 = 0;$i0 < $list.length; $i0++) {
10115 var argument = $list.$index($i0); 10115 var argument = $list.$index($i0);
10116 this.message = this.message.replaceAll(('#{' + position++ + '}'), argument .toString$0()); 10116 this.message = this.message.replaceAll(('#{' + (position++) + '}'), argume nt.toString$0());
10117 } 10117 }
10118 } 10118 }
10119 return this.message; 10119 return this.message;
10120 } 10120 }
10121 // ********** Code for SimpleType ************** 10121 // ********** Code for SimpleType **************
10122 function SimpleType(name, element) { 10122 function SimpleType(name, element) {
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
10991 return false; 10991 return false;
10992 } 10992 }
10993 BlockScope.prototype.create = function(name, type, span, isFinal, isParameter) { 10993 BlockScope.prototype.create = function(name, type, span, isFinal, isParameter) {
10994 var jsName = world.toJsIdentifier(name); 10994 var jsName = world.toJsIdentifier(name);
10995 if (this._vars.containsKey(name)) { 10995 if (this._vars.containsKey(name)) {
10996 world.error(('duplicate name "' + name + '"'), span); 10996 world.error(('duplicate name "' + name + '"'), span);
10997 } 10997 }
10998 if (!$notnull_bool(isParameter)) { 10998 if (!$notnull_bool(isParameter)) {
10999 var index = 0; 10999 var index = 0;
11000 while ($notnull_bool(this._isDefinedInParent($assert_String(jsName)))) { 11000 while ($notnull_bool(this._isDefinedInParent($assert_String(jsName)))) {
11001 jsName = ('' + name + '' + index++ + ''); 11001 jsName = ('' + name + '' + (index++) + '');
11002 } 11002 }
11003 } 11003 }
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);
12313 if ($notnull_bool($ne(ret, null))) return ret; 12313 if ($notnull_bool($ne(ret, null))) return ret;
12314 return this._makeThisOrType(node.span).get_$3(this, name, node); 12314 return this._makeThisOrType(node.span).get_$3(this, name, node);
12315 } 12315 }
12316 MethodGenerator.prototype._makeMissingValue = function(name) { 12316 MethodGenerator.prototype._makeMissingValue = function(name) {
12317 return new Value(world.varType, ('' + name + '()/*NotFound*/'), null, true); 12317 return new Value(world.varType, ('' + name + '()/*NotFound*/'), null, true);
12318 } 12318 }
12319 MethodGenerator.prototype._makeThisOrType = function(span) { 12319 MethodGenerator.prototype._makeThisOrType = function(span) {
12320 var $0; 12320 var $0;
12321 return new BareValue(this, (($0 = this._getOutermostMethod()) && $0.is$MethodG enerator()), span); 12321 return new BareValue(this, (($0 = this._getOutermostMethod()) && $0.is$MethodG enerator()), span);
12322 } 12322 }
12323 MethodGenerator.prototype.visitThisExpression = function(node) { 12323 MethodGenerator.prototype.visitThisExpression = function(node) {
12324 return this._makeThisValue(node); 12324 return this._makeThisValue(node);
12325 } 12325 }
12326 MethodGenerator.prototype.visitSuperExpression = function(node) { 12326 MethodGenerator.prototype.visitSuperExpression = function(node) {
12327 return this._makeSuperValue(node); 12327 return this._makeSuperValue(node);
12328 } 12328 }
12329 MethodGenerator.prototype.visitNullExpression = function(node) { 12329 MethodGenerator.prototype.visitNullExpression = function(node) {
12330 return EvaluatedValue.EvaluatedValue$factory(world.varType, null, 'null', null ); 12330 return EvaluatedValue.EvaluatedValue$factory(world.varType, null, 'null', null );
12331 } 12331 }
12332 MethodGenerator.prototype._isUnaryIncrement = function(item) {
12333 if ((item instanceof UnaryExpression)) {
12334 var u = (item && item.is$UnaryExpression());
12335 return u.op.kind == 16/*TokenKind.INCR*/ || u.op.kind == 17/*TokenKind.DECR* /;
12336 }
12337 else {
12338 return false;
12339 }
12340 }
12332 MethodGenerator.prototype.visitLiteralExpression = function(node) { 12341 MethodGenerator.prototype.visitLiteralExpression = function(node) {
12333 var $0; 12342 var $0;
12334 var type = node.type.type; 12343 var type = node.type.type;
12335 $assert($ne(type, null), "type != null", "gen.dart", 2119, 12); 12344 $assert($ne(type, null), "type != null", "gen.dart", 2128, 12);
12336 if (!!(($0 = node.value) && $0.is$List)) { 12345 if (!!(($0 = node.value) && $0.is$List)) {
12337 var items = []; 12346 var items = [];
12338 var $list = node.value; 12347 var $list = node.value;
12339 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) { 12348 for (var $i = node.value.iterator$0(); $i.hasNext$0(); ) {
12340 var item = $i.next$0(); 12349 var item = $i.next$0();
12341 var val = this.visitValue((item && item.is$Expression())); 12350 var val = this.visitValue((item && item.is$lang_Expression()));
12342 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY()); 12351 val.invoke$4(this, 'toString', item, Arguments.get$EMPTY());
12343 var code = val.code; 12352 var code = val.code;
12344 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr ession)) { 12353 if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpr ession) || (item instanceof PostfixExpression) || $notnull_bool(this._isUnaryInc rement((item && item.is$lang_Expression())))) {
12345 code = ('(' + code + ')'); 12354 code = ('(' + code + ')');
12346 } 12355 }
12347 items.add$1(code); 12356 items.add$1(code);
12348 } 12357 }
12349 return new Value(type, ('(' + Strings.join((items && items.is$List$String()) , " + ") + ')'), node.span, true); 12358 return new Value(type, ('(' + Strings.join((items && items.is$List$String()) , " + ") + ')'), node.span, true);
12350 } 12359 }
12351 var text = node.text; 12360 var text = node.text;
12352 if ($notnull_bool(type.get$isString())) { 12361 if ($notnull_bool(type.get$isString())) {
12353 if ($notnull_bool(text.startsWith$1('@'))) { 12362 if ($notnull_bool(text.startsWith$1('@'))) {
12354 text = MethodGenerator._escapeString(parseStringLiteral($assert_String(tex t))); 12363 text = MethodGenerator._escapeString(parseStringLiteral($assert_String(tex t)));
12355 text = ('"' + text + '"'); 12364 text = ('"' + text + '"');
12356 } 12365 }
12357 else if ($notnull_bool(isMultilineString($assert_String(text)))) { 12366 else if ($notnull_bool(isMultilineString($assert_String(text)))) {
12358 text = parseStringLiteral($assert_String(text)); 12367 text = parseStringLiteral($assert_String(text));
12359 text = text.replaceAll$2('\n', '\\n'); 12368 text = text.replaceAll$2('\n', '\\n');
12360 text = text.replaceAll$2('"', '\\"'); 12369 text = text.replaceAll$2('"', '\\"');
12361 text = ('"' + text + '"'); 12370 text = ('"' + text + '"');
12362 } 12371 }
12363 if (text !== node.text) { 12372 if (text !== node.text) {
12364 node.value = text; 12373 node.value = text;
12365 node.text = $assert_String(text); 12374 node.text = $assert_String(text);
12366 } 12375 }
12367 } 12376 }
12368 return EvaluatedValue.EvaluatedValue$factory((type && type.is$Type()), node.va lue, node.text, null); 12377 return EvaluatedValue.EvaluatedValue$factory((type && type.is$lang_Type()), no de.value, node.text, null);
12369 } 12378 }
12370 MethodGenerator.prototype.visitPostfixExpression$1 = function($0) { 12379 MethodGenerator.prototype.visitPostfixExpression$1 = function($0) {
12371 return this.visitPostfixExpression(($0 && $0.is$PostfixExpression()), false); 12380 return this.visitPostfixExpression(($0 && $0.is$PostfixExpression()), false);
12372 }; 12381 };
12373 MethodGenerator.prototype.writeDefinition$2 = function($0, $1) { 12382 MethodGenerator.prototype.writeDefinition$2 = function($0, $1) {
12374 return this.writeDefinition(($0 && $0.is$CodeWriter()), ($1 && $1.is$LambdaExp ression())); 12383 return this.writeDefinition(($0 && $0.is$CodeWriter()), ($1 && $1.is$LambdaExp ression()));
12375 }; 12384 };
12376 // ********** Code for Arguments ************** 12385 // ********** Code for Arguments **************
12377 function Arguments(nodes, values) { 12386 function Arguments(nodes, values) {
12378 this.nodes = nodes; 12387 this.nodes = nodes;
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
12618 } 12627 }
12619 if ($notnull_bool($ne(newRet, null))) { 12628 if ($notnull_bool($ne(newRet, null))) {
12620 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { 12629 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()); 12630 world.error(('conflicting types for "' + name + '"'), ret.get$span(), ne wRet.get$span());
12622 } 12631 }
12623 else { 12632 else {
12624 ret = newRet; 12633 ret = newRet;
12625 } 12634 }
12626 } 12635 }
12627 } 12636 }
12628 return (ret && ret.is$Type()); 12637 return (ret && ret.is$lang_Type());
12629 } 12638 }
12630 Library.prototype.lookup = function(name, span) { 12639 Library.prototype.lookup = function(name, span) {
12631 var retType = this.findTypeByName(name); 12640 var retType = this.findTypeByName(name);
12632 var ret = null; 12641 var ret = null;
12633 if ($notnull_bool($ne(retType, null))) { 12642 if ($notnull_bool($ne(retType, null))) {
12634 ret = retType.get$typeMember(); 12643 ret = retType.get$typeMember();
12635 } 12644 }
12636 var newRet = this.topType.getMember(name); 12645 var newRet = this.topType.getMember(name);
12637 if ($notnull_bool($ne(newRet, null))) { 12646 if ($notnull_bool($ne(newRet, null))) {
12638 if ($notnull_bool($ne(ret, null)) && $notnull_bool($ne(ret, newRet))) { 12647 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) { 12736 _LibraryVisitor.prototype.addSource = function(source) {
12728 var $this = this; // closure support 12737 var $this = this; // closure support
12729 if (this.library.sources.some((function (s) { 12738 if (this.library.sources.some((function (s) {
12730 return s.filename == source.filename; 12739 return s.filename == source.filename;
12731 }) 12740 })
12732 )) { 12741 )) {
12733 world.error(('duplicate source file "' + source.filename + '"')); 12742 world.error(('duplicate source file "' + source.filename + '"'));
12734 return; 12743 return;
12735 } 12744 }
12736 this.library.sources.add(source); 12745 this.library.sources.add(source);
12737 var parser = new Parser(source, options.dietParse, false, false, 0); 12746 var parser = new lang_Parser(source, options.dietParse, false, false, 0);
12738 var unit = parser.compilationUnit(); 12747 var unit = parser.compilationUnit();
12739 unit.forEach((function (def) { 12748 unit.forEach((function (def) {
12740 return def.visit$1($this); 12749 return def.visit$1($this);
12741 }) 12750 })
12742 ); 12751 );
12743 $assert(this.sources.length == 0 || $notnull_bool(this.isTop), "sources.length == 0 || isTop", "library.dart", 293, 12); 12752 $assert(this.sources.length == 0 || $notnull_bool(this.isTop), "sources.length == 0 || isTop", "library.dart", 293, 12);
12744 this.isTop = false; 12753 this.isTop = false;
12745 var newSources = this.sources; 12754 var newSources = this.sources;
12746 this.sources = []; 12755 this.sources = [];
12747 for (var $i = newSources.iterator$0(); $i.hasNext$0(); ) { 12756 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); 12952 var ret = new Parameter(this.definition);
12944 ret.set$type(newType); 12953 ret.set$type(newType);
12945 ret.set$name(this.name); 12954 ret.set$name(this.name);
12946 ret.isInitializer = this.isInitializer; 12955 ret.isInitializer = this.isInitializer;
12947 return (ret && ret.is$Parameter()); 12956 return (ret && ret.is$Parameter());
12948 } 12957 }
12949 Parameter.prototype.get$isOptional = function() { 12958 Parameter.prototype.get$isOptional = function() {
12950 return this.definition != null && this.definition.value != null; 12959 return this.definition != null && this.definition.value != null;
12951 } 12960 }
12952 Parameter.prototype.copyWithNewType$1 = function($0) { 12961 Parameter.prototype.copyWithNewType$1 = function($0) {
12953 return this.copyWithNewType(($0 && $0.is$Type())); 12962 return this.copyWithNewType(($0 && $0.is$lang_Type()));
12954 }; 12963 };
12955 Parameter.prototype.genValue$2 = function($0, $1) { 12964 Parameter.prototype.genValue$2 = function($0, $1) {
12956 return this.genValue(($0 && $0.is$MethodMember()), ($1 && $1.is$MethodGenerato r())); 12965 return this.genValue(($0 && $0.is$MethodMember()), ($1 && $1.is$MethodGenerato r()));
12957 }; 12966 };
12958 Parameter.prototype.resolve$2 = function($0, $1) { 12967 Parameter.prototype.resolve$2 = function($0, $1) {
12959 return this.resolve(($0 && $0.is$Member()), ($1 && $1.is$Type())); 12968 return this.resolve(($0 && $0.is$Member()), ($1 && $1.is$lang_Type()));
12960 }; 12969 };
12961 // ********** Code for Member ************** 12970 // ********** Code for Member **************
12962 function Member(name, declaringType) { 12971 function Member(name, declaringType) {
12963 this.name = name; 12972 this.name = name;
12964 this.declaringType = declaringType; 12973 this.declaringType = declaringType;
12965 this.isGenerated = false; 12974 this.isGenerated = false;
12966 // Initializers done 12975 // Initializers done
12967 } 12976 }
12968 Member.prototype.is$Member = function(){return this;}; 12977 Member.prototype.is$Member = function(){return this;};
12969 Member.prototype.is$Named = function(){return this;}; 12978 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()); 13038 world.internalError('cannot have initializers', this.get$span());
13030 } 13039 }
13031 Member.prototype.set$initDelegate = function(ctor) { 13040 Member.prototype.set$initDelegate = function(ctor) {
13032 world.internalError('cannot have initializers', this.get$span()); 13041 world.internalError('cannot have initializers', this.get$span());
13033 } 13042 }
13034 Member.prototype.get$inferredResult = function() { 13043 Member.prototype.get$inferredResult = function() {
13035 var t = this.get$returnType(); 13044 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()))) { 13045 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; 13046 return world.nonNullBool;
13038 } 13047 }
13039 return (t && t.is$Type()); 13048 return (t && t.is$lang_Type());
13040 } 13049 }
13041 Member.prototype.get$definition = function() { 13050 Member.prototype.get$definition = function() {
13042 return null; 13051 return null;
13043 } 13052 }
13044 Member.prototype.get$parameters = function() { 13053 Member.prototype.get$parameters = function() {
13045 return []; 13054 return [];
13046 } 13055 }
13047 Member.prototype.canInvoke = function(context, args) { 13056 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)); 13057 return $notnull_bool(this.get$canGet()) && $notnull_bool(new Value(this.get$re turnType(), null, null, true).canInvoke(context, '\$call', args));
13049 } 13058 }
(...skipping 21 matching lines...) Expand all
13071 } 13080 }
13072 else { 13081 else {
13073 return ('' + prefix + '' + this.name + '\$factory'); 13082 return ('' + prefix + '' + this.name + '\$factory');
13074 } 13083 }
13075 } 13084 }
13076 Member.prototype.resolveType = function(node, isRequired) { 13085 Member.prototype.resolveType = function(node, isRequired) {
13077 var type = this.declaringType.resolveType(node, isRequired); 13086 var type = this.declaringType.resolveType(node, isRequired);
13078 if ($notnull_bool(this.get$isStatic()) && $notnull_bool(type.get$hasTypeParams ())) { 13087 if ($notnull_bool(this.get$isStatic()) && $notnull_bool(type.get$hasTypeParams ())) {
13079 world.error('using type parameter in static context', node.span); 13088 world.error('using type parameter in static context', node.span);
13080 } 13089 }
13081 return (type && type.is$Type()); 13090 return (type && type.is$lang_Type());
13082 } 13091 }
13083 Member.prototype._get$3 = function($0, $1, $2) { 13092 Member.prototype._get$3 = function($0, $1, $2) {
13084 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Node()), ($2 && $2.is$Value())); 13093 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()));
13085 }; 13094 };
13086 Member.prototype._set$4 = function($0, $1, $2, $3) { 13095 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())); 13096 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()));
13088 }; 13097 };
13089 Member.prototype.canInvoke$2 = function($0, $1) { 13098 Member.prototype.canInvoke$2 = function($0, $1) {
13090 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 13099 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( )));
13091 }; 13100 };
13092 Member.prototype.invoke$4 = function($0, $1, $2, $3) { 13101 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); 13102 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
13094 }; 13103 };
13095 Member.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 13104 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)); 13105 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
13097 }; 13106 };
13098 Member.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 13107 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)); 13108 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4));
13100 }; 13109 };
13101 Member.prototype.provideFieldSyntax$0 = function() { 13110 Member.prototype.provideFieldSyntax$0 = function() {
13102 return this.provideFieldSyntax(); 13111 return this.provideFieldSyntax();
13103 }; 13112 };
13104 Member.prototype.providePropertySyntax$0 = function() { 13113 Member.prototype.providePropertySyntax$0 = function() {
13105 return this.providePropertySyntax(); 13114 return this.providePropertySyntax();
13106 }; 13115 };
13107 Member.prototype.resolve$1 = function($0) { 13116 Member.prototype.resolve$1 = function($0) {
13108 return this.resolve(($0 && $0.is$Type())); 13117 return this.resolve(($0 && $0.is$lang_Type()));
13109 }; 13118 };
13110 // ********** Code for TypeMember ************** 13119 // ********** Code for TypeMember **************
13111 function TypeMember(type) { 13120 function TypeMember(type) {
13112 this.type = type; 13121 this.type = type;
13113 // Initializers done 13122 // Initializers done
13114 Member.call(this, type.name, type.library.topType); 13123 Member.call(this, type.name, type.library.topType);
13115 } 13124 }
13116 $inherits(TypeMember, Member); 13125 $inherits(TypeMember, Member);
13117 TypeMember.prototype.is$TypeMember = function(){return this;}; 13126 TypeMember.prototype.is$TypeMember = function(){return this;};
13118 TypeMember.prototype.get$type = function() { return this.type; }; 13127 TypeMember.prototype.get$type = function() { return this.type; };
(...skipping 23 matching lines...) Expand all
13142 ret.isType = true; 13151 ret.isType = true;
13143 return (ret && ret.is$Value()); 13152 return (ret && ret.is$Value());
13144 } 13153 }
13145 TypeMember.prototype._set = function(context, node, target, value, isDynamic) { 13154 TypeMember.prototype._set = function(context, node, target, value, isDynamic) {
13146 world.error('can not set type', node.span); 13155 world.error('can not set type', node.span);
13147 } 13156 }
13148 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { 13157 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) {
13149 world.error('can not invoke type', node.span); 13158 world.error('can not invoke type', node.span);
13150 } 13159 }
13151 TypeMember.prototype._get$3 = function($0, $1, $2) { 13160 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); 13161 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
13153 }; 13162 };
13154 TypeMember.prototype._set$4 = function($0, $1, $2, $3) { 13163 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); 13164 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false);
13156 }; 13165 };
13157 TypeMember.prototype.canInvoke$2 = function($0, $1) { 13166 TypeMember.prototype.canInvoke$2 = function($0, $1) {
13158 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 13167 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( )));
13159 }; 13168 };
13160 TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) { 13169 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); 13170 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
13162 }; 13171 };
13163 TypeMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 13172 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)); 13173 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
13165 }; 13174 };
13166 TypeMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 13175 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)); 13176 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4));
13168 }; 13177 };
13169 TypeMember.prototype.resolve$1 = function($0) { 13178 TypeMember.prototype.resolve$1 = function($0) {
13170 return this.resolve(($0 && $0.is$Type())); 13179 return this.resolve(($0 && $0.is$lang_Type()));
13171 }; 13180 };
13172 // ********** Code for FieldMember ************** 13181 // ********** Code for FieldMember **************
13173 function FieldMember(name, declaringType, definition, value) { 13182 function FieldMember(name, declaringType, definition, value) {
13174 this._providePropertySyntax = false 13183 this._providePropertySyntax = false
13175 this._computing = false 13184 this._computing = false
13176 this.definition = definition; 13185 this.definition = definition;
13177 this.value = value; 13186 this.value = value;
13178 this.isNative = false; 13187 this.isNative = false;
13179 // Initializers done 13188 // Initializers done
13180 Member.call(this, name, declaringType); 13189 Member.call(this, name, declaringType);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
13317 } 13326 }
13318 } 13327 }
13319 return new Value(this.type, ('' + target.code + '.' + this.get$jsname() + ''), node.span, true); 13328 return new Value(this.type, ('' + target.code + '.' + this.get$jsname() + ''), node.span, true);
13320 } 13329 }
13321 FieldMember.prototype._set = function(context, node, target, value, isDynamic) { 13330 FieldMember.prototype._set = function(context, node, target, value, isDynamic) {
13322 var lhs = this._get(context, node, target, isDynamic); 13331 var lhs = this._get(context, node, target, isDynamic);
13323 value = value.convertTo(context, this.type, node, isDynamic); 13332 value = value.convertTo(context, this.type, node, isDynamic);
13324 return new Value(this.type, ('' + lhs.code + ' = ' + value.code + ''), node.sp an, true); 13333 return new Value(this.type, ('' + lhs.code + ' = ' + value.code + ''), node.sp an, true);
13325 } 13334 }
13326 FieldMember.prototype._get$3 = function($0, $1, $2) { 13335 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); 13336 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
13328 }; 13337 };
13329 FieldMember.prototype._set$4 = function($0, $1, $2, $3) { 13338 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); 13339 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false);
13331 }; 13340 };
13332 FieldMember.prototype.computeValue$0 = function() { 13341 FieldMember.prototype.computeValue$0 = function() {
13333 return this.computeValue(); 13342 return this.computeValue();
13334 }; 13343 };
13335 FieldMember.prototype.provideFieldSyntax$0 = function() { 13344 FieldMember.prototype.provideFieldSyntax$0 = function() {
13336 return this.provideFieldSyntax(); 13345 return this.provideFieldSyntax();
13337 }; 13346 };
13338 FieldMember.prototype.providePropertySyntax$0 = function() { 13347 FieldMember.prototype.providePropertySyntax$0 = function() {
13339 return this.providePropertySyntax(); 13348 return this.providePropertySyntax();
13340 }; 13349 };
13341 FieldMember.prototype.resolve$1 = function($0) { 13350 FieldMember.prototype.resolve$1 = function($0) {
13342 return this.resolve(($0 && $0.is$Type())); 13351 return this.resolve(($0 && $0.is$lang_Type()));
13343 }; 13352 };
13344 // ********** Code for PropertyMember ************** 13353 // ********** Code for PropertyMember **************
13345 function PropertyMember(name, declaringType) { 13354 function PropertyMember(name, declaringType) {
13346 this._provideFieldSyntax = false 13355 this._provideFieldSyntax = false
13347 // Initializers done 13356 // Initializers done
13348 Member.call(this, name, declaringType); 13357 Member.call(this, name, declaringType);
13349 } 13358 }
13350 $inherits(PropertyMember, Member); 13359 $inherits(PropertyMember, Member);
13351 PropertyMember.prototype.is$PropertyMember = function(){return this;}; 13360 PropertyMember.prototype.is$PropertyMember = function(){return this;};
13352 PropertyMember.prototype.get$span = function() { 13361 PropertyMember.prototype.get$span = function() {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
13422 } 13431 }
13423 if (this.getter == null) this.getter = parent.getter; 13432 if (this.getter == null) this.getter = parent.getter;
13424 if (this.setter == null) this.setter = parent.setter; 13433 if (this.setter == null) this.setter = parent.setter;
13425 } 13434 }
13426 PropertyMember.prototype.resolve = function(inType) { 13435 PropertyMember.prototype.resolve = function(inType) {
13427 if (this.getter != null) this.getter.resolve(inType); 13436 if (this.getter != null) this.getter.resolve(inType);
13428 if (this.setter != null) this.setter.resolve(inType); 13437 if (this.setter != null) this.setter.resolve(inType);
13429 this.get$library()._addMember(this); 13438 this.get$library()._addMember(this);
13430 } 13439 }
13431 PropertyMember.prototype._get$3 = function($0, $1, $2) { 13440 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); 13441 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
13433 }; 13442 };
13434 PropertyMember.prototype._set$4 = function($0, $1, $2, $3) { 13443 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); 13444 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false);
13436 }; 13445 };
13437 PropertyMember.prototype.provideFieldSyntax$0 = function() { 13446 PropertyMember.prototype.provideFieldSyntax$0 = function() {
13438 return this.provideFieldSyntax(); 13447 return this.provideFieldSyntax();
13439 }; 13448 };
13440 PropertyMember.prototype.providePropertySyntax$0 = function() { 13449 PropertyMember.prototype.providePropertySyntax$0 = function() {
13441 return this.providePropertySyntax(); 13450 return this.providePropertySyntax();
13442 }; 13451 };
13443 PropertyMember.prototype.resolve$1 = function($0) { 13452 PropertyMember.prototype.resolve$1 = function($0) {
13444 return this.resolve(($0 && $0.is$Type())); 13453 return this.resolve(($0 && $0.is$lang_Type()));
13445 }; 13454 };
13446 // ********** Code for ConcreteMember ************** 13455 // ********** Code for ConcreteMember **************
13447 function ConcreteMember(name, declaringType, baseMember) { 13456 function ConcreteMember(name, declaringType, baseMember) {
13448 this.baseMember = baseMember; 13457 this.baseMember = baseMember;
13449 // Initializers done 13458 // Initializers done
13450 Member.call(this, name, declaringType); 13459 Member.call(this, name, declaringType);
13451 this.parameters = []; 13460 this.parameters = [];
13452 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring Type); 13461 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring Type);
13453 var $list = this.baseMember.get$parameters(); 13462 var $list = this.baseMember.get$parameters();
13454 for (var $i = 0;$i < $list.length; $i++) { 13463 for (var $i = 0;$i < $list.length; $i++) {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
13531 } 13540 }
13532 ConcreteMember.prototype.get$initDelegate = function() { 13541 ConcreteMember.prototype.get$initDelegate = function() {
13533 return this.baseMember.get$initDelegate(); 13542 return this.baseMember.get$initDelegate();
13534 } 13543 }
13535 ConcreteMember.prototype.set$initDelegate = function(ctor) { 13544 ConcreteMember.prototype.set$initDelegate = function(ctor) {
13536 this.baseMember.set$initDelegate(ctor); 13545 this.baseMember.set$initDelegate(ctor);
13537 } 13546 }
13538 ConcreteMember.prototype.resolveType = function(node, isRequired) { 13547 ConcreteMember.prototype.resolveType = function(node, isRequired) {
13539 var $0; 13548 var $0;
13540 var type = this.baseMember.resolveType(node, isRequired); 13549 var type = this.baseMember.resolveType(node, isRequired);
13541 return (($0 = type.resolveTypeParams$1(this.declaringType)) && $0.is$Type()); 13550 return (($0 = type.resolveTypeParams$1(this.declaringType)) && $0.is$lang_Type ());
13542 } 13551 }
13543 ConcreteMember.prototype.override = function(other) { 13552 ConcreteMember.prototype.override = function(other) {
13544 return this.baseMember.override(other); 13553 return this.baseMember.override(other);
13545 } 13554 }
13546 ConcreteMember.prototype._get = function(context, node, target, isDynamic) { 13555 ConcreteMember.prototype._get = function(context, node, target, isDynamic) {
13547 var ret = this.baseMember._get(context, node, target, isDynamic); 13556 var ret = this.baseMember._get(context, node, target, isDynamic);
13548 return new Value(this.get$inferredResult(), ret.code, node.span, true); 13557 return new Value(this.get$inferredResult(), ret.code, node.span, true);
13549 } 13558 }
13550 ConcreteMember.prototype._set = function(context, node, target, value, isDynamic ) { 13559 ConcreteMember.prototype._set = function(context, node, target, value, isDynamic ) {
13551 var ret = this.baseMember._set(context, node, target, value, isDynamic); 13560 var ret = this.baseMember._set(context, node, target, value, isDynamic);
13552 return new Value(this.returnType, ret.code, node.span, true); 13561 return new Value(this.returnType, ret.code, node.span, true);
13553 } 13562 }
13554 ConcreteMember.prototype.invoke = function(context, node, target, args, isDynami c) { 13563 ConcreteMember.prototype.invoke = function(context, node, target, args, isDynami c) {
13555 var ret = this.baseMember.invoke(context, node, target, args, isDynamic); 13564 var ret = this.baseMember.invoke(context, node, target, args, isDynamic);
13556 var code = ret.code; 13565 var code = ret.code;
13557 if ($notnull_bool(this.get$isConstructor())) { 13566 if ($notnull_bool(this.get$isConstructor())) {
13558 code = code.replaceFirst$2(this.declaringType.get$genericType().get$jsname() , this.declaringType.get$jsname()); 13567 code = code.replaceFirst$2(this.declaringType.get$genericType().get$jsname() , this.declaringType.get$jsname());
13559 } 13568 }
13560 if ((this.baseMember instanceof MethodMember)) { 13569 if ((this.baseMember instanceof MethodMember)) {
13561 this.declaringType.genMethod(this); 13570 this.declaringType.genMethod(this);
13562 } 13571 }
13563 return new Value(this.get$inferredResult(), code, node.span, true); 13572 return new Value(this.get$inferredResult(), code, node.span, true);
13564 } 13573 }
13565 ConcreteMember.prototype._get$3 = function($0, $1, $2) { 13574 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); 13575 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
13567 }; 13576 };
13568 ConcreteMember.prototype._set$4 = function($0, $1, $2, $3) { 13577 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); 13578 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false);
13570 }; 13579 };
13571 ConcreteMember.prototype.canInvoke$2 = function($0, $1) { 13580 ConcreteMember.prototype.canInvoke$2 = function($0, $1) {
13572 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 13581 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( )));
13573 }; 13582 };
13574 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) { 13583 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); 13584 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
13576 }; 13585 };
13577 ConcreteMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic ) { 13586 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)); 13587 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
13579 }; 13588 };
13580 ConcreteMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 13589 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)); 13590 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4));
13582 }; 13591 };
13583 ConcreteMember.prototype.provideFieldSyntax$0 = function() { 13592 ConcreteMember.prototype.provideFieldSyntax$0 = function() {
13584 return this.provideFieldSyntax(); 13593 return this.provideFieldSyntax();
13585 }; 13594 };
13586 ConcreteMember.prototype.providePropertySyntax$0 = function() { 13595 ConcreteMember.prototype.providePropertySyntax$0 = function() {
13587 return this.providePropertySyntax(); 13596 return this.providePropertySyntax();
13588 }; 13597 };
13589 // ********** Code for MethodMember ************** 13598 // ********** Code for MethodMember **************
13590 function MethodMember(name, declaringType, definition) { 13599 function MethodMember(name, declaringType, definition) {
13591 this.isStatic = false 13600 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); 13900 return new Value(this.get$inferredResult(), code, node.span, true);
13892 } 13901 }
13893 MethodMember.prototype._invokeConstructor = function(context, node, target, args , argsString) { 13902 MethodMember.prototype._invokeConstructor = function(context, node, target, args , argsString) {
13894 this.declaringType.markUsed(); 13903 this.declaringType.markUsed();
13895 if (target != null) { 13904 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 + ')'); 13905 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); 13906 return new Value(this.declaringType, code, node.span, true);
13898 } 13907 }
13899 else { 13908 else {
13900 var code = (this.get$constructorName() != '') ? ('new ' + this.declaringType .get$jsname() + '.' + this.get$constructorName() + '\$ctor(' + argsString + ')') : ('new ' + this.declaringType.get$jsname() + '(' + argsString + ')'); 13909 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())) { 13910 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); 13911 return this._invokeConstConstructor(node, $assert_String(code), target, ar gs);
13903 } 13912 }
13904 else { 13913 else {
13905 return new Value(this.declaringType, code, node.span, true); 13914 return new Value(this.declaringType, code, node.span, true);
13906 } 13915 }
13907 } 13916 }
13908 } 13917 }
13909 MethodMember.prototype._invokeConstConstructor = function(node, code, target, ar gs) { 13918 MethodMember.prototype._invokeConstConstructor = function(node, code, target, ar gs) {
13910 var $0; 13919 var $0;
13911 var fields = new HashMapImplementation(); 13920 var fields = new HashMapImplementation();
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
14258 var formal = $list.$index($i); 14267 var formal = $list.$index($i);
14259 var param = new Parameter(formal); 14268 var param = new Parameter(formal);
14260 param.resolve$2(this, inType); 14269 param.resolve$2(this, inType);
14261 this.parameters.add(param); 14270 this.parameters.add(param);
14262 } 14271 }
14263 if (!$notnull_bool(this.isLambda)) { 14272 if (!$notnull_bool(this.isLambda)) {
14264 this.get$library()._addMember(this); 14273 this.get$library()._addMember(this);
14265 } 14274 }
14266 } 14275 }
14267 MethodMember.prototype._get$3 = function($0, $1, $2) { 14276 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); 14277 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
14269 }; 14278 };
14270 MethodMember.prototype._set$4 = function($0, $1, $2, $3) { 14279 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); 14280 return this._set(($0 && $0.is$MethodGenerator()), $1, ($2 && $2.is$Value()), ( $3 && $3.is$Value()), false);
14272 }; 14281 };
14273 MethodMember.prototype.canInvoke$2 = function($0, $1) { 14282 MethodMember.prototype.canInvoke$2 = function($0, $1) {
14274 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 14283 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( )));
14275 }; 14284 };
14276 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) { 14285 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); 14286 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
14278 }; 14287 };
14279 MethodMember.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 14288 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)); 14289 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
14281 }; 14290 };
14282 MethodMember.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 14291 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)); 14292 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4));
14284 }; 14293 };
14285 MethodMember.prototype.namesInOrder$1 = function($0) { 14294 MethodMember.prototype.namesInOrder$1 = function($0) {
14286 return this.namesInOrder(($0 && $0.is$Arguments())); 14295 return this.namesInOrder(($0 && $0.is$Arguments()));
14287 }; 14296 };
14288 MethodMember.prototype.provideFieldSyntax$0 = function() { 14297 MethodMember.prototype.provideFieldSyntax$0 = function() {
14289 return this.provideFieldSyntax(); 14298 return this.provideFieldSyntax();
14290 }; 14299 };
14291 MethodMember.prototype.providePropertySyntax$0 = function() { 14300 MethodMember.prototype.providePropertySyntax$0 = function() {
14292 return this.providePropertySyntax(); 14301 return this.providePropertySyntax();
14293 }; 14302 };
14294 MethodMember.prototype.resolve$1 = function($0) { 14303 MethodMember.prototype.resolve$1 = function($0) {
14295 return this.resolve(($0 && $0.is$Type())); 14304 return this.resolve(($0 && $0.is$lang_Type()));
14296 }; 14305 };
14297 // ********** Code for MemberSet ************** 14306 // ********** Code for MemberSet **************
14298 function MemberSet(member, isVar) { 14307 function MemberSet(member, isVar) {
14299 this.name = member.name; 14308 this.name = member.name;
14300 this.members = [member]; 14309 this.members = [member];
14301 this.jsname = member.get$jsname(); 14310 this.jsname = member.get$jsname();
14302 this.isVar = isVar; 14311 this.isVar = isVar;
14303 // Initializers done 14312 // Initializers done
14304 } 14313 }
14305 MemberSet.prototype.is$MemberSet = function(){return this;}; 14314 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())) { 14427 if ($notnull_bool(this.get$treatAsField())) {
14419 return new Value(returnValue.type, ('' + target.code + '.' + this.jsname + ' = ' + value.code + ''), node.span, true); 14428 return new Value(returnValue.type, ('' + target.code + '.' + this.jsname + ' = ' + value.code + ''), node.span, true);
14420 } 14429 }
14421 else { 14430 else {
14422 return new Value(returnValue.type, ('' + target.code + '.set\$' + this.jsn ame + '(' + value.code + ')'), node.span, true); 14431 return new Value(returnValue.type, ('' + target.code + '.set\$' + this.jsn ame + '(' + value.code + ')'), node.span, true);
14423 } 14432 }
14424 } 14433 }
14425 return returnValue; 14434 return returnValue;
14426 } 14435 }
14427 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) { 14436 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) {
14437 var $0;
14428 if ($notnull_bool(this.isVar) && !$notnull_bool(this.get$isOperator())) { 14438 if ($notnull_bool(this.isVar) && !$notnull_bool(this.get$isOperator())) {
14429 return this.invokeOnVar(context, node, target, args); 14439 return this.invokeOnVar(context, node, target, args);
14430 } 14440 }
14431 if (this.members.length == 1) { 14441 if (this.members.length == 1) {
14432 return this.members.$index(0).invoke$5(context, node, target, args, isDynami c); 14442 return (($0 = this.members.$index(0).invoke$5(context, node, target, args, i sDynamic)) && $0.is$Value());
14433 } 14443 }
14434 var targets = this.members.filter((function (m) { 14444 var targets = this.members.filter((function (m) {
14435 return m.canInvoke$2(context, args); 14445 return m.canInvoke$2(context, args);
14436 }) 14446 })
14437 ); 14447 );
14438 if (targets.length == 1) { 14448 if (targets.length == 1) {
14439 return targets.$index(0).invoke$5(context, node, target, args, isDynamic); 14449 return (($0 = targets.$index(0).invoke$5(context, node, target, args, isDyna mic)) && $0.is$Value());
14440 } 14450 }
14441 var returnValue = null; 14451 var returnValue = null;
14442 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) { 14452 for (var $i = targets.iterator$0(); $i.hasNext$0(); ) {
14443 var member = $i.next$0(); 14453 var member = $i.next$0();
14444 var res = member.invoke$4$isDynamic(context, node, target, args, true); 14454 var res = member.invoke$4$isDynamic(context, node, target, args, true);
14445 returnValue = this._tryUnion(returnValue, res, node); 14455 returnValue = this._tryUnion(returnValue, (res && res.is$Value()), node);
14446 } 14456 }
14447 if (returnValue == null) { 14457 if (returnValue == null) {
14448 return this._makeError(node, target, 'method'); 14458 return this._makeError(node, target, 'method');
14449 } 14459 }
14450 if (returnValue.code == null) { 14460 if (returnValue.code == null) {
14451 if (this.name == '\$call') { 14461 if (this.name == '\$call') {
14452 return target._varCall(context, args); 14462 return target._varCall(context, args);
14453 } 14463 }
14454 else if ($notnull_bool(this.get$isOperator())) { 14464 else if ($notnull_bool(this.get$isOperator())) {
14455 return target.invokeSpecial(this.name, args, returnValue.type); 14465 return target.invokeSpecial(this.name, args, returnValue.type);
14456 } 14466 }
14457 else { 14467 else {
14458 return this.invokeOnVar(context, node, target, args); 14468 return this.invokeOnVar(context, node, target, args);
14459 } 14469 }
14460 } 14470 }
14461 return returnValue; 14471 return returnValue;
14462 } 14472 }
14463 MemberSet.prototype.invokeOnVar = function(context, node, target, args) { 14473 MemberSet.prototype.invokeOnVar = function(context, node, target, args) {
14464 var member = this.getVarMember(context, node, args); 14474 var member = this.getVarMember(context, node, args);
14465 return member.invoke$4(context, node, target, args); 14475 return member.invoke$4(context, node, target, args);
14466 } 14476 }
14467 MemberSet.prototype._tryUnion = function(x, y, node) { 14477 MemberSet.prototype._tryUnion = function(x, y, node) {
14468 if (x == null) return y; 14478 if (x == null) return y;
14469 var type = Type.union(x.type, y.type); 14479 var type = lang_Type.union(x.type, y.type);
14470 if (x.code == y.code) { 14480 if (x.code == y.code) {
14471 if ($notnull_bool($eq(type, x.type))) { 14481 if ($notnull_bool($eq(type, x.type))) {
14472 return x; 14482 return x;
14473 } 14483 }
14474 else if ($notnull_bool(x.get$isConst()) || $notnull_bool(y.get$isConst())) { 14484 else if ($notnull_bool(x.get$isConst()) || $notnull_bool(y.get$isConst())) {
14475 world.internalError("unexpected: union of const values "); 14485 world.internalError("unexpected: union of const values ");
14476 } 14486 }
14477 else { 14487 else {
14478 var ret = new Value(type, x.code, node.span, true); 14488 var ret = new Value(type, x.code, node.span, true);
14479 ret.isSuper = $notnull_bool(x.isSuper) && $notnull_bool(y.isSuper); 14489 ret.isSuper = $notnull_bool(x.isSuper) && $notnull_bool(y.isSuper);
(...skipping 14 matching lines...) Expand all
14494 var stub = world.objectType.varStubs.$index(stubName); 14504 var stub = world.objectType.varStubs.$index(stubName);
14495 if ($notnull_bool(stub == null)) { 14505 if ($notnull_bool(stub == null)) {
14496 var mset = context.findMembers(this.name).members; 14506 var mset = context.findMembers(this.name).members;
14497 var targets = mset.filter((function (m) { 14507 var targets = mset.filter((function (m) {
14498 return m.canInvoke$2(context, args); 14508 return m.canInvoke$2(context, args);
14499 }) 14509 })
14500 ); 14510 );
14501 var returnType = reduce(map((targets && targets.is$Iterable()), (function (t ) { 14511 var returnType = reduce(map((targets && targets.is$Iterable()), (function (t ) {
14502 return t.get$returnType(); 14512 return t.get$returnType();
14503 }) 14513 })
14504 ), Type.union); 14514 ), lang_Type.union);
14505 stub = new VarMethodSet($assert_String(stubName), targets, args, returnType) ; 14515 stub = new VarMethodSet($assert_String(stubName), targets, args, returnType) ;
14506 world.objectType.varStubs.$setindex(stubName, stub); 14516 world.objectType.varStubs.$setindex(stubName, stub);
14507 } 14517 }
14508 return (stub && stub.is$VarMember()); 14518 return (stub && stub.is$VarMember());
14509 } 14519 }
14510 MemberSet.prototype._get$3 = function($0, $1, $2) { 14520 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); 14521 return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), false);
14512 }; 14522 };
14513 MemberSet.prototype._set$4 = function($0, $1, $2, $3) { 14523 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); 14524 return this._set(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ( $2 && $2.is$Value()), ($3 && $3.is$Value()), false);
14515 }; 14525 };
14516 MemberSet.prototype.add$1 = function($0) { 14526 MemberSet.prototype.add$1 = function($0) {
14517 return this.add(($0 && $0.is$Member())); 14527 return this.add(($0 && $0.is$Member()));
14518 }; 14528 };
14519 MemberSet.prototype.canInvoke$2 = function($0, $1) { 14529 MemberSet.prototype.canInvoke$2 = function($0, $1) {
14520 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( ))); 14530 return this.canInvoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$Arguments( )));
14521 }; 14531 };
14522 MemberSet.prototype.invoke$4 = function($0, $1, $2, $3) { 14532 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); 14533 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
14524 }; 14534 };
14525 MemberSet.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 14535 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)); 14536 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
14527 }; 14537 };
14528 MemberSet.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 14538 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)); 14539 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), $assert_bool($4));
14530 }; 14540 };
14531 MemberSet.prototype.toString$0 = function() { 14541 MemberSet.prototype.toString$0 = function() {
14532 return this.toString(); 14542 return this.toString();
14533 }; 14543 };
14534 // ********** Code for FactoryMap ************** 14544 // ********** Code for FactoryMap **************
14535 function FactoryMap() { 14545 function FactoryMap() {
14536 this.factories = $map([]); 14546 this.factories = $map([]);
14537 // Initializers done 14547 // Initializers done
14538 } 14548 }
14539 FactoryMap.prototype.getFactoriesFor = function(typeName) { 14549 FactoryMap.prototype.getFactoriesFor = function(typeName) {
(...skipping 16 matching lines...) Expand all
14556 constructors.forEach((function (_, member) { 14566 constructors.forEach((function (_, member) {
14557 f(member); 14567 f(member);
14558 }) 14568 })
14559 ); 14569 );
14560 }) 14570 })
14561 ); 14571 );
14562 } 14572 }
14563 FactoryMap.prototype.getFactory$2 = function($0, $1) { 14573 FactoryMap.prototype.getFactory$2 = function($0, $1) {
14564 return this.getFactory($assert_String($0), $assert_String($1)); 14574 return this.getFactory($assert_String($0), $assert_String($1));
14565 }; 14575 };
14566 // ********** Code for Token ************** 14576 // ********** Code for lang_Token **************
14567 function Token(kind, source, start, end) { 14577 function lang_Token(kind, source, start, end) {
jimhug 2011/11/18 17:05:29 TODO: There seems to be some sort of non-determini
14568 this.kind = kind; 14578 this.kind = kind;
14569 this.source = source; 14579 this.source = source;
14570 this.start = start; 14580 this.start = start;
14571 this.end = end; 14581 this.end = end;
14572 // Initializers done 14582 // Initializers done
14573 } 14583 }
14574 Token.prototype.get$source = function() { return this.source; }; 14584 lang_Token.prototype.get$source = function() { return this.source; };
14575 Token.prototype.get$text = function() { 14585 lang_Token.prototype.get$text = function() {
14576 return this.source.get$text().substring(this.start, this.end); 14586 return this.source.get$text().substring(this.start, this.end);
14577 } 14587 }
14578 Token.prototype.toString = function() { 14588 lang_Token.prototype.toString = function() {
14579 var kindText = TokenKind.kindToString(this.kind); 14589 var kindText = TokenKind.kindToString(this.kind);
14580 var actualText = this.get$text(); 14590 var actualText = this.get$text();
14581 if ($notnull_bool($ne(kindText, actualText))) { 14591 if ($notnull_bool($ne(kindText, actualText))) {
14582 if (actualText.length > 10) { 14592 if (actualText.length > 10) {
14583 actualText = actualText.substring$2(0, 8) + '...'; 14593 actualText = actualText.substring$2(0, 8) + '...';
14584 } 14594 }
14585 return ('' + kindText + '(' + actualText + ')'); 14595 return ('' + kindText + '(' + actualText + ')');
14586 } 14596 }
14587 else { 14597 else {
14588 return $assert_String(kindText); 14598 return $assert_String(kindText);
14589 } 14599 }
14590 } 14600 }
14591 Token.prototype.get$span = function() { 14601 lang_Token.prototype.get$span = function() {
14592 return new SourceSpan(this.source, this.start, this.end); 14602 return new SourceSpan(this.source, this.start, this.end);
14593 } 14603 }
14594 Token.prototype.toString$0 = function() { 14604 lang_Token.prototype.toString$0 = function() {
14595 return this.toString(); 14605 return this.toString();
14596 }; 14606 };
14597 // ********** Code for SourceFile ************** 14607 // ********** Code for SourceFile **************
14598 function SourceFile(filename, _text) { 14608 function SourceFile(filename, _text) {
14599 this.filename = filename; 14609 this.filename = filename;
14600 this._text = _text; 14610 this._text = _text;
14601 // Initializers done 14611 // Initializers done
14602 } 14612 }
14603 SourceFile.prototype.is$SourceFile = function(){return this;}; 14613 SourceFile.prototype.is$SourceFile = function(){return this;};
14604 SourceFile.prototype.is$Comparable = function(){return this;}; 14614 SourceFile.prototype.is$Comparable = function(){return this;};
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
14750 } 14760 }
14751 else { 14761 else {
14752 return false; 14762 return false;
14753 } 14763 }
14754 } 14764 }
14755 else { 14765 else {
14756 return false; 14766 return false;
14757 } 14767 }
14758 } 14768 }
14759 TokenizerBase.prototype._finishToken = function(kind) { 14769 TokenizerBase.prototype._finishToken = function(kind) {
14760 return new Token(kind, this._source, this._startIndex, this._lang_index); 14770 return new lang_Token(kind, this._source, this._startIndex, this._lang_index);
14761 } 14771 }
14762 TokenizerBase.prototype._errorToken = function() { 14772 TokenizerBase.prototype._errorToken = function() {
14763 return this._finishToken(65/*TokenKind.ERROR*/); 14773 return this._finishToken(65/*TokenKind.ERROR*/);
14764 } 14774 }
14765 TokenizerBase.prototype.finishWhitespace = function() { 14775 TokenizerBase.prototype.finishWhitespace = function() {
14766 while (this._lang_index < this._text.length) { 14776 while (this._lang_index < this._text.length) {
14767 if (!$notnull_bool(TokenizerHelpers.isWhitespace(this._text.charCodeAt(this. _lang_index++)))) { 14777 if (!$notnull_bool(TokenizerHelpers.isWhitespace(this._text.charCodeAt(this. _lang_index++)))) {
14768 this._lang_index--; 14778 this._lang_index--;
14769 if ($notnull_bool(this._skipWhitespace)) { 14779 if ($notnull_bool(this._skipWhitespace)) {
14770 return this.next(); 14780 return this.next();
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
15011 else { 15021 else {
15012 return false; 15022 return false;
15013 } 15023 }
15014 } 15024 }
15015 15025
15016 default: 15026 default:
15017 15027
15018 return true; 15028 return true;
15019 15029
15020 } 15030 }
15021 var n = Parser.parseHex(hex); 15031 var n = lang_Parser.parseHex(hex);
15022 return n < 0xD800 || n > 0xDFFF && n <= 0x10FFFF; 15032 return n < 0xD800 || n > 0xDFFF && n <= 0x10FFFF;
15023 } 15033 }
15024 TokenizerBase.prototype.finishDot = function() { 15034 TokenizerBase.prototype.finishDot = function() {
15025 if ($notnull_bool(TokenizerHelpers.isDigit(this._peekChar()))) { 15035 if ($notnull_bool(TokenizerHelpers.isDigit(this._peekChar()))) {
15026 this.eatDigits(); 15036 this.eatDigits();
15027 return this.finishNumberExtra(62/*TokenKind.DOUBLE*/); 15037 return this.finishNumberExtra(62/*TokenKind.DOUBLE*/);
15028 } 15038 }
15029 else { 15039 else {
15030 return this._finishToken(14/*TokenKind.DOT*/); 15040 return this._finishToken(14/*TokenKind.DOT*/);
15031 } 15041 }
15032 } 15042 }
15033 TokenizerBase.prototype.finishIdentifier = function() { 15043 TokenizerBase.prototype.finishIdentifier = function(ch) {
15034 while (this._lang_index < this._text.length) { 15044 if (this._interpStack != null && this._interpStack.depth == -1) {
15035 if (!$notnull_bool(TokenizerHelpers.isIdentifierPart(this._text.charCodeAt(t his._lang_index++)))) { 15045 this._interpStack.depth = 0;
15036 this._lang_index--; 15046 if (ch == 36) {
15037 break; 15047 return this._errorToken();
15048 }
15049 while (this._lang_index < this._text.length) {
15050 if (!$notnull_bool(TokenizerHelpers.isInterpIdentifierPart(this._text.char CodeAt(this._lang_index++)))) {
15051 this._lang_index--;
15052 break;
15053 }
15054 }
15055 }
15056 else {
15057 while (this._lang_index < this._text.length) {
15058 if (!$notnull_bool(TokenizerHelpers.isIdentifierPart(this._text.charCodeAt (this._lang_index++)))) {
15059 this._lang_index--;
15060 break;
15061 }
15038 } 15062 }
15039 } 15063 }
15040 var kind = this.getIdentifierKind(); 15064 var kind = this.getIdentifierKind();
15041 if (this._interpStack != null && this._interpStack.depth == -1) {
15042 this._interpStack.depth = 0;
15043 }
15044 if (kind == 70/*TokenKind.IDENTIFIER*/) { 15065 if (kind == 70/*TokenKind.IDENTIFIER*/) {
15045 return this._finishToken(70/*TokenKind.IDENTIFIER*/); 15066 return this._finishToken(70/*TokenKind.IDENTIFIER*/);
15046 } 15067 }
15047 else { 15068 else {
15048 return this._finishToken(kind); 15069 return this._finishToken(kind);
15049 } 15070 }
15050 } 15071 }
15051 TokenizerBase.prototype.next$0 = function() { 15072 TokenizerBase.prototype.next$0 = function() {
15052 return this.next(); 15073 return this.next();
15053 }; 15074 };
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
15112 15133
15113 case 36: 15134 case 36:
15114 15135
15115 if ($notnull_bool(this._maybeEatChar(34))) { 15136 if ($notnull_bool(this._maybeEatChar(34))) {
15116 return this.finishString(34); 15137 return this.finishString(34);
15117 } 15138 }
15118 else if ($notnull_bool(this._maybeEatChar(39))) { 15139 else if ($notnull_bool(this._maybeEatChar(39))) {
15119 return this.finishString(39); 15140 return this.finishString(39);
15120 } 15141 }
15121 else { 15142 else {
15122 return this.finishIdentifier(); 15143 return this.finishIdentifier(36);
15123 } 15144 }
15124 15145
15125 case 37: 15146 case 37:
15126 15147
15127 if ($notnull_bool(this._maybeEatChar(61))) { 15148 if ($notnull_bool(this._maybeEatChar(61))) {
15128 return this._finishToken(32/*TokenKind.ASSIGN_MOD*/); 15149 return this._finishToken(32/*TokenKind.ASSIGN_MOD*/);
15129 } 15150 }
15130 else { 15151 else {
15131 return this._finishToken(47/*TokenKind.MOD*/); 15152 return this._finishToken(47/*TokenKind.MOD*/);
15132 } 15153 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
15373 return this._finishToken(46/*TokenKind.TRUNCDIV*/); 15394 return this._finishToken(46/*TokenKind.TRUNCDIV*/);
15374 } 15395 }
15375 } 15396 }
15376 else { 15397 else {
15377 return this._finishToken(18/*TokenKind.BIT_NOT*/); 15398 return this._finishToken(18/*TokenKind.BIT_NOT*/);
15378 } 15399 }
15379 15400
15380 default: 15401 default:
15381 15402
15382 if ($notnull_bool(TokenizerHelpers.isIdentifierStart(ch))) { 15403 if ($notnull_bool(TokenizerHelpers.isIdentifierStart(ch))) {
15383 return this.finishIdentifier(); 15404 return this.finishIdentifier(ch);
15384 } 15405 }
15385 else if ($notnull_bool(TokenizerHelpers.isDigit(ch))) { 15406 else if ($notnull_bool(TokenizerHelpers.isDigit(ch))) {
15386 return this.finishNumber(); 15407 return this.finishNumber();
15387 } 15408 }
15388 else { 15409 else {
15389 return this._errorToken(); 15410 return this._errorToken();
15390 } 15411 }
15391 15412
15392 } 15413 }
15393 } 15414 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
15591 TokenizerHelpers.isDigit = function(c) { 15612 TokenizerHelpers.isDigit = function(c) {
15592 return (c >= 48 && c <= 57); 15613 return (c >= 48 && c <= 57);
15593 } 15614 }
15594 TokenizerHelpers.isHexDigit = function(c) { 15615 TokenizerHelpers.isHexDigit = function(c) {
15595 return ($notnull_bool(TokenizerHelpers.isDigit(c)) || (c >= 97 && c <= 102) || (c >= 65 && c <= 70)); 15616 return ($notnull_bool(TokenizerHelpers.isDigit(c)) || (c >= 97 && c <= 102) || (c >= 65 && c <= 70));
15596 } 15617 }
15597 TokenizerHelpers.isWhitespace = function(c) { 15618 TokenizerHelpers.isWhitespace = function(c) {
15598 return (c == 32 || c == 9 || c == 10 || c == 13); 15619 return (c == 32 || c == 9 || c == 10 || c == 13);
15599 } 15620 }
15600 TokenizerHelpers.isIdentifierPart = function(c) { 15621 TokenizerHelpers.isIdentifierPart = function(c) {
15622 return ($notnull_bool(TokenizerHelpers.isIdentifierStart(c)) || $notnull_bool( TokenizerHelpers.isDigit(c)) || c == 36);
15623 }
15624 TokenizerHelpers.isInterpIdentifierPart = function(c) {
15601 return ($notnull_bool(TokenizerHelpers.isIdentifierStart(c)) || $notnull_bool( TokenizerHelpers.isDigit(c))); 15625 return ($notnull_bool(TokenizerHelpers.isIdentifierStart(c)) || $notnull_bool( TokenizerHelpers.isDigit(c)));
15602 } 15626 }
15603 // ********** Code for TokenKind ************** 15627 // ********** Code for TokenKind **************
15604 function TokenKind() {} 15628 function TokenKind() {}
15605 TokenKind.kindToString = function(kind) { 15629 TokenKind.kindToString = function(kind) {
15606 switch (kind) { 15630 switch (kind) {
15607 case 1/*TokenKind.END_OF_FILE*/: 15631 case 1/*TokenKind.END_OF_FILE*/:
15608 15632
15609 return "end of file"; 15633 return "end of file";
15610 15634
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
16397 16421
16398 } 16422 }
16399 } 16423 }
16400 TokenKind.kindFromAssign = function(kind) { 16424 TokenKind.kindFromAssign = function(kind) {
16401 if (kind == 20/*TokenKind.ASSIGN*/) return 0; 16425 if (kind == 20/*TokenKind.ASSIGN*/) return 0;
16402 if (kind > 20/*TokenKind.ASSIGN*/ && kind <= 32/*TokenKind.ASSIGN_MOD*/) { 16426 if (kind > 20/*TokenKind.ASSIGN*/ && kind <= 32/*TokenKind.ASSIGN_MOD*/) {
16403 return kind + (15)/*(ADD - ASSIGN_ADD)*/; 16427 return kind + (15)/*(ADD - ASSIGN_ADD)*/;
16404 } 16428 }
16405 return -1; 16429 return -1;
16406 } 16430 }
16407 // ********** Code for Parser ************** 16431 // ********** Code for lang_Parser **************
16408 function Parser(source, diet, throwOnIncomplete, optionalSemicolons, startOffset ) { 16432 function lang_Parser(source, diet, throwOnIncomplete, optionalSemicolons, startO ffset) {
16409 this.source = source; 16433 this.source = source;
16410 this.diet = diet; 16434 this.diet = diet;
16411 this.throwOnIncomplete = throwOnIncomplete; 16435 this.throwOnIncomplete = throwOnIncomplete;
16412 this.optionalSemicolons = optionalSemicolons; 16436 this.optionalSemicolons = optionalSemicolons;
16413 // Initializers done 16437 // Initializers done
16414 this.tokenizer = new Tokenizer(this.source, true, startOffset); 16438 this.tokenizer = new Tokenizer(this.source, true, startOffset);
16415 this._peekToken = this.tokenizer.next(); 16439 this._peekToken = this.tokenizer.next();
16416 this._previousToken = null; 16440 this._previousToken = null;
16417 this._inInitializers = false; 16441 this._inInitializers = false;
16418 } 16442 }
16419 Parser.prototype.get$source = function() { return this.source; }; 16443 lang_Parser.prototype.get$source = function() { return this.source; };
16420 Parser.prototype.isPrematureEndOfFile = function() { 16444 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*/))) { 16445 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)); 16446 $throw(new IncompleteSourceException(this._previousToken));
16423 } 16447 }
16424 else if ($notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) { 16448 else if ($notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) {
16425 this._lang_error('unexpected end of file', this._peekToken.get$span()); 16449 this._lang_error('unexpected end of file', this._peekToken.get$span());
16426 return true; 16450 return true;
16427 } 16451 }
16428 else { 16452 else {
16429 return false; 16453 return false;
16430 } 16454 }
16431 } 16455 }
16432 Parser.prototype._peek = function() { 16456 lang_Parser.prototype._peek = function() {
16433 return this._peekToken.kind; 16457 return this._peekToken.kind;
16434 } 16458 }
16435 Parser.prototype._lang_next = function() { 16459 lang_Parser.prototype._lang_next = function() {
16436 this._previousToken = this._peekToken; 16460 this._previousToken = this._peekToken;
16437 this._peekToken = this.tokenizer.next(); 16461 this._peekToken = this.tokenizer.next();
16438 return this._previousToken; 16462 return this._previousToken;
16439 } 16463 }
16440 Parser.prototype._peekKind = function(kind) { 16464 lang_Parser.prototype._peekKind = function(kind) {
16441 return this._peekToken.kind == kind; 16465 return this._peekToken.kind == kind;
16442 } 16466 }
16443 Parser.prototype._peekIdentifier = function() { 16467 lang_Parser.prototype._peekIdentifier = function() {
16444 return TokenKind.isIdentifier(this._peekToken.kind); 16468 return TokenKind.isIdentifier(this._peekToken.kind);
16445 } 16469 }
16446 Parser.prototype._maybeEat = function(kind) { 16470 lang_Parser.prototype._maybeEat = function(kind) {
16447 if (this._peekToken.kind == kind) { 16471 if (this._peekToken.kind == kind) {
16448 this._previousToken = this._peekToken; 16472 this._previousToken = this._peekToken;
16449 this._peekToken = this.tokenizer.next(); 16473 this._peekToken = this.tokenizer.next();
16450 return true; 16474 return true;
16451 } 16475 }
16452 else { 16476 else {
16453 return false; 16477 return false;
16454 } 16478 }
16455 } 16479 }
16456 Parser.prototype._eat = function(kind) { 16480 lang_Parser.prototype._eat = function(kind) {
16457 if (!$notnull_bool(this._maybeEat(kind))) { 16481 if (!$notnull_bool(this._maybeEat(kind))) {
16458 this._errorExpected(TokenKind.kindToString(kind)); 16482 this._errorExpected(TokenKind.kindToString(kind));
16459 } 16483 }
16460 } 16484 }
16461 Parser.prototype._eatSemicolon = function() { 16485 lang_Parser.prototype._eatSemicolon = function() {
16462 if ($notnull_bool(this.optionalSemicolons) && $notnull_bool(this._peekKind(1/* TokenKind.END_OF_FILE*/))) return; 16486 if ($notnull_bool(this.optionalSemicolons) && $notnull_bool(this._peekKind(1/* TokenKind.END_OF_FILE*/))) return;
16463 this._eat(10/*TokenKind.SEMICOLON*/); 16487 this._eat(10/*TokenKind.SEMICOLON*/);
16464 } 16488 }
16465 Parser.prototype._errorExpected = function(expected) { 16489 lang_Parser.prototype._errorExpected = function(expected) {
16466 if ($notnull_bool(this.throwOnIncomplete)) this.isPrematureEndOfFile(); 16490 if ($notnull_bool(this.throwOnIncomplete)) this.isPrematureEndOfFile();
16467 var tok = this._lang_next(); 16491 var tok = this._lang_next();
16468 var message = ('expected ' + expected + ', but found ' + tok + ''); 16492 var message = ('expected ' + expected + ', but found ' + tok + '');
16469 this._lang_error($assert_String(message), tok.get$span()); 16493 this._lang_error($assert_String(message), tok.get$span());
16470 } 16494 }
16471 Parser.prototype._lang_error = function(message, location) { 16495 lang_Parser.prototype._lang_error = function(message, location) {
16472 if (location == null) { 16496 if (location == null) {
16473 location = this._peekToken.get$span(); 16497 location = this._peekToken.get$span();
16474 } 16498 }
16475 world.fatal(message, location); 16499 world.fatal(message, location);
16476 } 16500 }
16477 Parser.prototype._skipBlock = function() { 16501 lang_Parser.prototype._skipBlock = function() {
16478 var depth = 1; 16502 var depth = 1;
16479 this._eat(6/*TokenKind.LBRACE*/); 16503 this._eat(6/*TokenKind.LBRACE*/);
16480 while (true) { 16504 while (true) {
16481 var tok = this._lang_next(); 16505 var tok = this._lang_next();
16482 if ($notnull_bool($eq(tok.kind, 6/*TokenKind.LBRACE*/))) { 16506 if ($notnull_bool($eq(tok.kind, 6/*TokenKind.LBRACE*/))) {
16483 depth += 1; 16507 depth += 1;
16484 } 16508 }
16485 else if ($notnull_bool($eq(tok.kind, 7/*TokenKind.RBRACE*/))) { 16509 else if ($notnull_bool($eq(tok.kind, 7/*TokenKind.RBRACE*/))) {
16486 depth -= 1; 16510 depth -= 1;
16487 if (depth == 0) return; 16511 if (depth == 0) return;
16488 } 16512 }
16489 else if ($notnull_bool($eq(tok.kind, 1/*TokenKind.END_OF_FILE*/))) { 16513 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( )); 16514 this._lang_error('unexpected end of file during diet parse', tok.get$span( ));
16491 return; 16515 return;
16492 } 16516 }
16493 } 16517 }
16494 } 16518 }
16495 Parser.prototype._makeSpan = function(start) { 16519 lang_Parser.prototype._makeSpan = function(start) {
16496 return new SourceSpan(this.source, start, this._previousToken.end); 16520 return new SourceSpan(this.source, start, this._previousToken.end);
16497 } 16521 }
16498 Parser.prototype.compilationUnit = function() { 16522 lang_Parser.prototype.compilationUnit = function() {
16499 var ret = []; 16523 var ret = [];
16500 this._maybeEat(13/*TokenKind.HASHBANG*/); 16524 this._maybeEat(13/*TokenKind.HASHBANG*/);
16501 while ($notnull_bool(this._peekKind(12/*TokenKind.HASH*/))) { 16525 while ($notnull_bool(this._peekKind(12/*TokenKind.HASH*/))) {
16502 ret.add$1(this.directive()); 16526 ret.add$1(this.directive());
16503 } 16527 }
16504 while (!$notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) { 16528 while (!$notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) {
16505 ret.add$1(this.topLevelDefinition()); 16529 ret.add$1(this.topLevelDefinition());
16506 } 16530 }
16507 return (ret && ret.is$List$Definition()); 16531 return (ret && ret.is$List$Definition());
16508 } 16532 }
16509 Parser.prototype.directive = function() { 16533 lang_Parser.prototype.directive = function() {
16510 var start = this._peekToken.start; 16534 var start = this._peekToken.start;
16511 this._eat(12/*TokenKind.HASH*/); 16535 this._eat(12/*TokenKind.HASH*/);
16512 var name = this.identifier(); 16536 var name = this.identifier();
16513 var args = this.arguments(); 16537 var args = this.arguments();
16514 this._eatSemicolon(); 16538 this._eatSemicolon();
16515 return new DirectiveDefinition(name, args, this._makeSpan(start)); 16539 return new DirectiveDefinition(name, args, this._makeSpan(start));
16516 } 16540 }
16517 Parser.prototype.topLevelDefinition = function() { 16541 lang_Parser.prototype.topLevelDefinition = function() {
16518 switch (this._peek()) { 16542 switch (this._peek()) {
16519 case 73/*TokenKind.CLASS*/: 16543 case 73/*TokenKind.CLASS*/:
16520 16544
16521 return this.classDefinition(73/*TokenKind.CLASS*/); 16545 return this.classDefinition(73/*TokenKind.CLASS*/);
16522 16546
16523 case 79/*TokenKind.INTERFACE*/: 16547 case 79/*TokenKind.INTERFACE*/:
16524 16548
16525 return this.classDefinition(79/*TokenKind.INTERFACE*/); 16549 return this.classDefinition(79/*TokenKind.INTERFACE*/);
16526 16550
16527 case 87/*TokenKind.TYPEDEF*/: 16551 case 87/*TokenKind.TYPEDEF*/:
16528 16552
16529 return this.functionTypeAlias(); 16553 return this.functionTypeAlias();
16530 16554
16531 default: 16555 default:
16532 16556
16533 return this.declaration(true); 16557 return this.declaration(true);
16534 16558
16535 } 16559 }
16536 } 16560 }
16537 Parser.prototype.classDefinition = function(kind) { 16561 lang_Parser.prototype.classDefinition = function(kind) {
16538 var start = this._peekToken.start; 16562 var start = this._peekToken.start;
16539 this._eat(kind); 16563 this._eat(kind);
16540 var name = this.identifier(); 16564 var name = this.identifier();
16541 var typeParams = null; 16565 var typeParams = null;
16542 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { 16566 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
16543 typeParams = this.typeParameters(); 16567 typeParams = this.typeParameters();
16544 } 16568 }
16545 var _extends = null; 16569 var _extends = null;
16546 if ($notnull_bool(this._maybeEat(74/*TokenKind.EXTENDS*/))) { 16570 if ($notnull_bool(this._maybeEat(74/*TokenKind.EXTENDS*/))) {
16547 _extends = this.typeList(); 16571 _extends = this.typeList();
(...skipping 15 matching lines...) Expand all
16563 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) { 16587 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) {
16564 if ($notnull_bool(this.isPrematureEndOfFile())) break; 16588 if ($notnull_bool(this.isPrematureEndOfFile())) break;
16565 body.add$1(this.declaration(true)); 16589 body.add$1(this.declaration(true));
16566 } 16590 }
16567 } 16591 }
16568 else { 16592 else {
16569 this._errorExpected('block starting with "{" or ";"'); 16593 this._errorExpected('block starting with "{" or ";"');
16570 } 16594 }
16571 return new TypeDefinition(kind == 73/*TokenKind.CLASS*/, name, typeParams, _ex tends, _implements, _native, _factory, body, this._makeSpan(start)); 16595 return new TypeDefinition(kind == 73/*TokenKind.CLASS*/, name, typeParams, _ex tends, _implements, _native, _factory, body, this._makeSpan(start));
16572 } 16596 }
16573 Parser.prototype.functionTypeAlias = function() { 16597 lang_Parser.prototype.functionTypeAlias = function() {
16574 var start = this._peekToken.start; 16598 var start = this._peekToken.start;
16575 this._eat(87/*TokenKind.TYPEDEF*/); 16599 this._eat(87/*TokenKind.TYPEDEF*/);
16576 var di = this.declaredIdentifier(false); 16600 var di = this.declaredIdentifier(false);
16577 var typeParams = null; 16601 var typeParams = null;
16578 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { 16602 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
16579 typeParams = this.typeParameters(); 16603 typeParams = this.typeParameters();
16580 } 16604 }
16581 var formals = this.formalParameterList(); 16605 var formals = this.formalParameterList();
16582 this._eatSemicolon(); 16606 this._eatSemicolon();
16583 var func = new FunctionDefinition(null, di.type, di.get$name(), formals, null, null, this._makeSpan(start)); 16607 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)); 16608 return new FunctionTypeDefinition(func, typeParams, this._makeSpan(start));
16585 } 16609 }
16586 Parser.prototype.initializers = function() { 16610 lang_Parser.prototype.initializers = function() {
16587 this._inInitializers = true; 16611 this._inInitializers = true;
16588 var ret = []; 16612 var ret = [];
16589 do { 16613 do {
16590 ret.add$1(this.expression()); 16614 ret.add$1(this.expression());
16591 } 16615 }
16592 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) 16616 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
16593 this._inInitializers = false; 16617 this._inInitializers = false;
16594 return ret; 16618 return ret;
16595 } 16619 }
16596 Parser.prototype.functionBody = function(inExpression) { 16620 lang_Parser.prototype.functionBody = function(inExpression) {
16597 var start = this._peekToken.start; 16621 var start = this._peekToken.start;
16598 if ($notnull_bool(this._maybeEat(9/*TokenKind.ARROW*/))) { 16622 if ($notnull_bool(this._maybeEat(9/*TokenKind.ARROW*/))) {
16599 var expr = this.expression(); 16623 var expr = this.expression();
16600 if (!$notnull_bool(inExpression)) { 16624 if (!$notnull_bool(inExpression)) {
16601 this._eatSemicolon(); 16625 this._eatSemicolon();
16602 } 16626 }
16603 return new ReturnStatement(expr, this._makeSpan(start)); 16627 return new ReturnStatement(expr, this._makeSpan(start));
16604 } 16628 }
16605 else if ($notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/))) { 16629 else if ($notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/))) {
16606 if ($notnull_bool(this.diet)) { 16630 if ($notnull_bool(this.diet)) {
(...skipping 14 matching lines...) Expand all
16621 this._eatSemicolon(); 16645 this._eatSemicolon();
16622 return new NativeStatement(nativeBody, this._makeSpan(start)); 16646 return new NativeStatement(nativeBody, this._makeSpan(start));
16623 } 16647 }
16624 else { 16648 else {
16625 return this.functionBody(inExpression); 16649 return this.functionBody(inExpression);
16626 } 16650 }
16627 } 16651 }
16628 } 16652 }
16629 this._lang_error('Expected function body (neither { nor => found)'); 16653 this._lang_error('Expected function body (neither { nor => found)');
16630 } 16654 }
16631 Parser.prototype.finishField = function(start, modifiers, type, name, value) { 16655 lang_Parser.prototype.finishField = function(start, modifiers, type, name, value ) {
16632 var names = [name]; 16656 var names = [name];
16633 var values = [value]; 16657 var values = [value];
16634 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 16658 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
16635 names.add$1(this.identifier()); 16659 names.add$1(this.identifier());
16636 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { 16660 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
16637 values.add$1(this.expression()); 16661 values.add$1(this.expression());
16638 } 16662 }
16639 else { 16663 else {
16640 values.add$1(); 16664 values.add$1();
16641 } 16665 }
16642 } 16666 }
16643 this._eatSemicolon(); 16667 this._eatSemicolon();
16644 return new VariableDefinition(modifiers, type, names, values, this._makeSpan($ assert_num(start))); 16668 return new VariableDefinition(modifiers, type, names, values, this._makeSpan($ assert_num(start)));
16645 } 16669 }
16646 Parser.prototype.finishDefinition = function(start, modifiers, di) { 16670 lang_Parser.prototype.finishDefinition = function(start, modifiers, di) {
16647 var $0; 16671 var $0;
16648 switch (this._peek()) { 16672 switch (this._peek()) {
16649 case 2/*TokenKind.LPAREN*/: 16673 case 2/*TokenKind.LPAREN*/:
16650 16674
16651 var formals = this.formalParameterList(); 16675 var formals = this.formalParameterList();
16652 var inits = null; 16676 var inits = null;
16653 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) { 16677 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) {
16654 inits = this.initializers(); 16678 inits = this.initializers();
16655 } 16679 }
16656 var body = this.functionBody(false); 16680 var body = this.functionBody(false);
(...skipping 13 matching lines...) Expand all
16670 16694
16671 return this.finishField(start, modifiers, di.type, di.get$name(), null); 16695 return this.finishField(start, modifiers, di.type, di.get$name(), null);
16672 16696
16673 default: 16697 default:
16674 16698
16675 this._errorExpected('declaration'); 16699 this._errorExpected('declaration');
16676 return null; 16700 return null;
16677 16701
16678 } 16702 }
16679 } 16703 }
16680 Parser.prototype.declaration = function(includeOperators) { 16704 lang_Parser.prototype.declaration = function(includeOperators) {
16681 var start = this._peekToken.start; 16705 var start = this._peekToken.start;
16682 if ($notnull_bool(this._peekKind(75/*TokenKind.FACTORY*/))) { 16706 if ($notnull_bool(this._peekKind(75/*TokenKind.FACTORY*/))) {
16683 return this.factoryConstructorDeclaration(); 16707 return this.factoryConstructorDeclaration();
16684 } 16708 }
16685 var modifiers = this._readModifiers(); 16709 var modifiers = this._readModifiers();
16686 return this.finishDefinition(start, modifiers, this.declaredIdentifier(include Operators)); 16710 return this.finishDefinition(start, modifiers, this.declaredIdentifier(include Operators));
16687 } 16711 }
16688 Parser.prototype.factoryConstructorDeclaration = function() { 16712 lang_Parser.prototype.factoryConstructorDeclaration = function() {
16689 var start = this._peekToken.start; 16713 var start = this._peekToken.start;
16690 var factoryToken = this._lang_next(); 16714 var factoryToken = this._lang_next();
16691 var names = [this.identifier()]; 16715 var names = [this.identifier()];
16692 while ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { 16716 while ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
16693 names.add$1(this.identifier()); 16717 names.add$1(this.identifier());
16694 } 16718 }
16695 var typeParams = null; 16719 var typeParams = null;
16696 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { 16720 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
16697 typeParams = this.typeParameters(); 16721 typeParams = this.typeParameters();
16698 } 16722 }
16699 var name = null; 16723 var name = null;
16700 var type = null; 16724 var type = null;
16701 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { 16725 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
16702 name = this.identifier(); 16726 name = this.identifier();
16703 } 16727 }
16704 else if ($notnull_bool(typeParams == null)) { 16728 else if ($notnull_bool(typeParams == null)) {
16705 if (names.length > 1) { 16729 if (names.length > 1) {
16706 name = names.removeLast$0(); 16730 name = names.removeLast$0();
16707 } 16731 }
16708 else { 16732 else {
16709 name = new Identifier('', names.$index(0).get$span()); 16733 name = new lang_Identifier('', names.$index(0).get$span());
16710 } 16734 }
16711 } 16735 }
16712 else { 16736 else {
16713 name = new Identifier('', names.$index(0).get$span()); 16737 name = new lang_Identifier('', names.$index(0).get$span());
16714 } 16738 }
16715 if (names.length > 1) { 16739 if (names.length > 1) {
16716 this._lang_error('unsupported qualified name for factory', names.$index(0).g et$span()); 16740 this._lang_error('unsupported qualified name for factory', names.$index(0).g et$span());
16717 } 16741 }
16718 type = new NameTypeReference(false, names.$index(0), null, names.$index(0).get $span()); 16742 type = new NameTypeReference(false, names.$index(0), null, names.$index(0).get $span());
16719 var di = new DeclaredIdentifier(type, name, this._makeSpan(start)); 16743 var di = new DeclaredIdentifier(type, name, this._makeSpan(start));
16720 return this.finishDefinition(start, [factoryToken], di); 16744 return this.finishDefinition(start, [factoryToken], di);
16721 } 16745 }
16722 Parser.prototype.statement = function() { 16746 lang_Parser.prototype.statement = function() {
16723 var $0; 16747 var $0;
16724 switch (this._peek()) { 16748 switch (this._peek()) {
16725 case 88/*TokenKind.BREAK*/: 16749 case 88/*TokenKind.BREAK*/:
16726 16750
16727 return (($0 = this.breakStatement()) && $0.is$Statement()); 16751 return (($0 = this.breakStatement()) && $0.is$lang_Statement());
16728 16752
16729 case 92/*TokenKind.CONTINUE*/: 16753 case 92/*TokenKind.CONTINUE*/:
16730 16754
16731 return (($0 = this.continueStatement()) && $0.is$Statement()); 16755 return (($0 = this.continueStatement()) && $0.is$lang_Statement());
16732 16756
16733 case 105/*TokenKind.RETURN*/: 16757 case 105/*TokenKind.RETURN*/:
16734 16758
16735 return (($0 = this.returnStatement()) && $0.is$Statement()); 16759 return (($0 = this.returnStatement()) && $0.is$lang_Statement());
16736 16760
16737 case 109/*TokenKind.THROW*/: 16761 case 109/*TokenKind.THROW*/:
16738 16762
16739 return (($0 = this.throwStatement()) && $0.is$Statement()); 16763 return (($0 = this.throwStatement()) && $0.is$lang_Statement());
16740 16764
16741 case 72/*TokenKind.ASSERT*/: 16765 case 72/*TokenKind.ASSERT*/:
16742 16766
16743 return (($0 = this.assertStatement()) && $0.is$Statement()); 16767 return (($0 = this.assertStatement()) && $0.is$lang_Statement());
16744 16768
16745 case 114/*TokenKind.WHILE*/: 16769 case 114/*TokenKind.WHILE*/:
16746 16770
16747 return this.whileStatement(); 16771 return this.whileStatement();
16748 16772
16749 case 94/*TokenKind.DO*/: 16773 case 94/*TokenKind.DO*/:
16750 16774
16751 return this.doStatement(); 16775 return this.doStatement();
16752 16776
16753 case 99/*TokenKind.FOR*/: 16777 case 99/*TokenKind.FOR*/:
16754 16778
16755 return (($0 = this.forStatement()) && $0.is$Statement()); 16779 return (($0 = this.forStatement()) && $0.is$lang_Statement());
16756 16780
16757 case 100/*TokenKind.IF*/: 16781 case 100/*TokenKind.IF*/:
16758 16782
16759 return this.ifStatement(); 16783 return this.ifStatement();
16760 16784
16761 case 107/*TokenKind.SWITCH*/: 16785 case 107/*TokenKind.SWITCH*/:
16762 16786
16763 return (($0 = this.switchStatement()) && $0.is$Statement()); 16787 return (($0 = this.switchStatement()) && $0.is$lang_Statement());
16764 16788
16765 case 111/*TokenKind.TRY*/: 16789 case 111/*TokenKind.TRY*/:
16766 16790
16767 return (($0 = this.tryStatement()) && $0.is$Statement()); 16791 return (($0 = this.tryStatement()) && $0.is$lang_Statement());
16768 16792
16769 case 6/*TokenKind.LBRACE*/: 16793 case 6/*TokenKind.LBRACE*/:
16770 16794
16771 return this.block(); 16795 return this.block();
16772 16796
16773 case 10/*TokenKind.SEMICOLON*/: 16797 case 10/*TokenKind.SEMICOLON*/:
16774 16798
16775 return this.emptyStatement(); 16799 return this.emptyStatement();
16776 16800
16777 case 97/*TokenKind.FINAL*/: 16801 case 97/*TokenKind.FINAL*/:
16778 16802
16779 return (($0 = this.declaration(false)) && $0.is$Statement()); 16803 return (($0 = this.declaration(false)) && $0.is$lang_Statement());
16780 16804
16781 case 112/*TokenKind.VAR*/: 16805 case 112/*TokenKind.VAR*/:
16782 16806
16783 return (($0 = this.declaration(false)) && $0.is$Statement()); 16807 return (($0 = this.declaration(false)) && $0.is$lang_Statement());
16784 16808
16785 default: 16809 default:
16786 16810
16787 return (($0 = this.finishExpressionAsStatement(this.expression())) && $0.i s$Statement()); 16811 return (($0 = this.finishExpressionAsStatement(this.expression())) && $0.i s$lang_Statement());
16788 16812
16789 } 16813 }
16790 } 16814 }
16791 Parser.prototype.finishExpressionAsStatement = function(expr) { 16815 lang_Parser.prototype.finishExpressionAsStatement = function(expr) {
16792 var $0; 16816 var $0;
16793 var start = expr.get$span().start; 16817 var start = expr.get$span().start;
16794 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) { 16818 if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) {
16795 var label = this._makeLabel(expr); 16819 var label = this._makeLabel(expr);
16796 return new LabeledStatement(label, this.statement(), this._makeSpan(start)); 16820 return new LabeledStatement(label, this.statement(), this._makeSpan(start));
16797 } 16821 }
16798 if ((expr instanceof LambdaExpression)) { 16822 if ((expr instanceof LambdaExpression)) {
16799 if (!(expr.func.body instanceof BlockStatement)) { 16823 if (!(expr.func.body instanceof BlockStatement)) {
16800 this._eatSemicolon(); 16824 this._eatSemicolon();
16801 expr.func.span = this._makeSpan(start); 16825 expr.func.span = this._makeSpan(start);
(...skipping 17 matching lines...) Expand all
16819 var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference()) , 0, typeArgs); 16843 var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference()) , 0, typeArgs);
16820 var name = this.identifier(); 16844 var name = this.identifier();
16821 var value = null; 16845 var value = null;
16822 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { 16846 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
16823 value = this.expression(); 16847 value = this.expression();
16824 } 16848 }
16825 return this.finishField(expr.get$span().start, null, gt, name, value); 16849 return this.finishField(expr.get$span().start, null, gt, name, value);
16826 } 16850 }
16827 else { 16851 else {
16828 this._eatSemicolon(); 16852 this._eatSemicolon();
16829 return new ExpressionStatement(expr, this._makeSpan(expr.get$span().start)); 16853 return new lang_ExpressionStatement(expr, this._makeSpan(expr.get$span().sta rt));
16830 } 16854 }
16831 } 16855 }
16832 Parser.prototype.testCondition = function() { 16856 lang_Parser.prototype.testCondition = function() {
16833 this._eat(2/*TokenKind.LPAREN*/); 16857 this._eat(2/*TokenKind.LPAREN*/);
16834 var ret = this.expression(); 16858 var ret = this.expression();
16835 this._eat(3/*TokenKind.RPAREN*/); 16859 this._eat(3/*TokenKind.RPAREN*/);
16836 return (ret && ret.is$Expression()); 16860 return (ret && ret.is$lang_Expression());
16837 } 16861 }
16838 Parser.prototype.block = function() { 16862 lang_Parser.prototype.block = function() {
16839 var start = this._peekToken.start; 16863 var start = this._peekToken.start;
16840 this._eat(6/*TokenKind.LBRACE*/); 16864 this._eat(6/*TokenKind.LBRACE*/);
16841 var stmts = []; 16865 var stmts = [];
16842 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) { 16866 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) {
16843 if ($notnull_bool(this.isPrematureEndOfFile())) break; 16867 if ($notnull_bool(this.isPrematureEndOfFile())) break;
16844 stmts.add$1(this.statement()); 16868 stmts.add$1(this.statement());
16845 } 16869 }
16846 return new BlockStatement(stmts, this._makeSpan(start)); 16870 return new BlockStatement(stmts, this._makeSpan(start));
16847 } 16871 }
16848 Parser.prototype.emptyStatement = function() { 16872 lang_Parser.prototype.emptyStatement = function() {
16849 var start = this._peekToken.start; 16873 var start = this._peekToken.start;
16850 this._eat(10/*TokenKind.SEMICOLON*/); 16874 this._eat(10/*TokenKind.SEMICOLON*/);
16851 return new EmptyStatement(this._makeSpan(start)); 16875 return new EmptyStatement(this._makeSpan(start));
16852 } 16876 }
16853 Parser.prototype.ifStatement = function() { 16877 lang_Parser.prototype.ifStatement = function() {
16854 var start = this._peekToken.start; 16878 var start = this._peekToken.start;
16855 this._eat(100/*TokenKind.IF*/); 16879 this._eat(100/*TokenKind.IF*/);
16856 var test = this.testCondition(); 16880 var test = this.testCondition();
16857 var trueBranch = this.statement(); 16881 var trueBranch = this.statement();
16858 var falseBranch = null; 16882 var falseBranch = null;
16859 if ($notnull_bool(this._maybeEat(95/*TokenKind.ELSE*/))) { 16883 if ($notnull_bool(this._maybeEat(95/*TokenKind.ELSE*/))) {
16860 falseBranch = this.statement(); 16884 falseBranch = this.statement();
16861 } 16885 }
16862 return new IfStatement(test, trueBranch, falseBranch, this._makeSpan(start)); 16886 return new IfStatement(test, trueBranch, falseBranch, this._makeSpan(start));
16863 } 16887 }
16864 Parser.prototype.whileStatement = function() { 16888 lang_Parser.prototype.whileStatement = function() {
16865 var start = this._peekToken.start; 16889 var start = this._peekToken.start;
16866 this._eat(114/*TokenKind.WHILE*/); 16890 this._eat(114/*TokenKind.WHILE*/);
16867 var test = this.testCondition(); 16891 var test = this.testCondition();
16868 var body = this.statement(); 16892 var body = this.statement();
16869 return new WhileStatement(test, body, this._makeSpan(start)); 16893 return new WhileStatement(test, body, this._makeSpan(start));
16870 } 16894 }
16871 Parser.prototype.doStatement = function() { 16895 lang_Parser.prototype.doStatement = function() {
16872 var start = this._peekToken.start; 16896 var start = this._peekToken.start;
16873 this._eat(94/*TokenKind.DO*/); 16897 this._eat(94/*TokenKind.DO*/);
16874 var body = this.statement(); 16898 var body = this.statement();
16875 this._eat(114/*TokenKind.WHILE*/); 16899 this._eat(114/*TokenKind.WHILE*/);
16876 var test = this.testCondition(); 16900 var test = this.testCondition();
16877 this._eatSemicolon(); 16901 this._eatSemicolon();
16878 return new DoStatement(body, test, this._makeSpan(start)); 16902 return new DoStatement(body, test, this._makeSpan(start));
16879 } 16903 }
16880 Parser.prototype.forStatement = function() { 16904 lang_Parser.prototype.forStatement = function() {
16881 var start = this._peekToken.start; 16905 var start = this._peekToken.start;
16882 this._eat(99/*TokenKind.FOR*/); 16906 this._eat(99/*TokenKind.FOR*/);
16883 this._eat(2/*TokenKind.LPAREN*/); 16907 this._eat(2/*TokenKind.LPAREN*/);
16884 var init = this.forInitializerStatement(start); 16908 var init = this.forInitializerStatement(start);
16885 if ((init instanceof ForInStatement)) { 16909 if ((init instanceof ForInStatement)) {
16886 return init; 16910 return init;
16887 } 16911 }
16888 var test = null; 16912 var test = null;
16889 if (!$notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) { 16913 if (!$notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
16890 test = this.expression(); 16914 test = this.expression();
16891 this._eatSemicolon(); 16915 this._eatSemicolon();
16892 } 16916 }
16893 var step = []; 16917 var step = [];
16894 if (!$notnull_bool(this._maybeEat(3/*TokenKind.RPAREN*/))) { 16918 if (!$notnull_bool(this._maybeEat(3/*TokenKind.RPAREN*/))) {
16895 step.add$1(this.expression()); 16919 step.add$1(this.expression());
16896 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 16920 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
16897 step.add$1(this.expression()); 16921 step.add$1(this.expression());
16898 } 16922 }
16899 this._eat(3/*TokenKind.RPAREN*/); 16923 this._eat(3/*TokenKind.RPAREN*/);
16900 } 16924 }
16901 var body = this.statement(); 16925 var body = this.statement();
16902 return new ForStatement(init, test, step, body, this._makeSpan(start)); 16926 return new ForStatement(init, test, step, body, this._makeSpan(start));
16903 } 16927 }
16904 Parser.prototype.forInitializerStatement = function(start) { 16928 lang_Parser.prototype.forInitializerStatement = function(start) {
16905 var $0; 16929 var $0;
16906 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) { 16930 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
16907 return null; 16931 return null;
16908 } 16932 }
16909 else { 16933 else {
16910 var init = this.expression(); 16934 var init = this.expression();
16911 if ($notnull_bool(this._peekKind(11/*TokenKind.COMMA*/)) && $notnull_bool(th is._isBin(init, 52/*TokenKind.LT*/))) { 16935 if ($notnull_bool(this._peekKind(11/*TokenKind.COMMA*/)) && $notnull_bool(th is._isBin(init, 52/*TokenKind.LT*/))) {
16912 this._eat(11/*TokenKind.COMMA*/); 16936 this._eat(11/*TokenKind.COMMA*/);
16913 var baseType = this._makeType(init.x); 16937 var baseType = this._makeType(init.x);
16914 var typeArgs = [this._makeType(init.y)]; 16938 var typeArgs = [this._makeType(init.y)];
16915 var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference( )), 0, typeArgs); 16939 var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference( )), 0, typeArgs);
16916 var name = this.identifier(); 16940 var name = this.identifier();
16917 init = new DeclaredIdentifier(gt, name, this._makeSpan(init.get$span().sta rt)); 16941 init = new DeclaredIdentifier(gt, name, this._makeSpan(init.get$span().sta rt));
16918 } 16942 }
16919 if ($notnull_bool(this._maybeEat(101/*TokenKind.IN*/))) { 16943 if ($notnull_bool(this._maybeEat(101/*TokenKind.IN*/))) {
16920 return this._finishForIn(start, (($0 = this._makeDeclaredIdentifier(init)) && $0.is$DeclaredIdentifier())); 16944 return this._finishForIn(start, (($0 = this._makeDeclaredIdentifier(init)) && $0.is$DeclaredIdentifier()));
16921 } 16945 }
16922 else { 16946 else {
16923 return this.finishExpressionAsStatement(init); 16947 return this.finishExpressionAsStatement(init);
16924 } 16948 }
16925 } 16949 }
16926 } 16950 }
16927 Parser.prototype._finishForIn = function(start, di) { 16951 lang_Parser.prototype._finishForIn = function(start, di) {
16928 var expr = this.expression(); 16952 var expr = this.expression();
16929 this._eat(3/*TokenKind.RPAREN*/); 16953 this._eat(3/*TokenKind.RPAREN*/);
16930 var body = this.statement(); 16954 var body = this.statement();
16931 return new ForInStatement(di, expr, body, this._makeSpan(start)); 16955 return new ForInStatement(di, expr, body, this._makeSpan(start));
16932 } 16956 }
16933 Parser.prototype.tryStatement = function() { 16957 lang_Parser.prototype.tryStatement = function() {
16934 var start = this._peekToken.start; 16958 var start = this._peekToken.start;
16935 this._eat(111/*TokenKind.TRY*/); 16959 this._eat(111/*TokenKind.TRY*/);
16936 var body = this.block(); 16960 var body = this.block();
16937 var catches = []; 16961 var catches = [];
16938 while ($notnull_bool(this._peekKind(90/*TokenKind.CATCH*/))) { 16962 while ($notnull_bool(this._peekKind(90/*TokenKind.CATCH*/))) {
16939 catches.add$1(this.catchNode()); 16963 catches.add$1(this.catchNode());
16940 } 16964 }
16941 var finallyBlock = null; 16965 var finallyBlock = null;
16942 if ($notnull_bool(this._maybeEat(98/*TokenKind.FINALLY*/))) { 16966 if ($notnull_bool(this._maybeEat(98/*TokenKind.FINALLY*/))) {
16943 finallyBlock = this.block(); 16967 finallyBlock = this.block();
16944 } 16968 }
16945 return new TryStatement(body, catches, finallyBlock, this._makeSpan(start)); 16969 return new TryStatement(body, catches, finallyBlock, this._makeSpan(start));
16946 } 16970 }
16947 Parser.prototype.catchNode = function() { 16971 lang_Parser.prototype.catchNode = function() {
16948 var start = this._peekToken.start; 16972 var start = this._peekToken.start;
16949 this._eat(90/*TokenKind.CATCH*/); 16973 this._eat(90/*TokenKind.CATCH*/);
16950 this._eat(2/*TokenKind.LPAREN*/); 16974 this._eat(2/*TokenKind.LPAREN*/);
16951 var exc = this.declaredIdentifier(false); 16975 var exc = this.declaredIdentifier(false);
16952 var trace = null; 16976 var trace = null;
16953 if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 16977 if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
16954 trace = this.declaredIdentifier(false); 16978 trace = this.declaredIdentifier(false);
16955 } 16979 }
16956 this._eat(3/*TokenKind.RPAREN*/); 16980 this._eat(3/*TokenKind.RPAREN*/);
16957 var body = this.block(); 16981 var body = this.block();
16958 return new CatchNode(exc, trace, body, this._makeSpan(start)); 16982 return new CatchNode(exc, trace, body, this._makeSpan(start));
16959 } 16983 }
16960 Parser.prototype.switchStatement = function() { 16984 lang_Parser.prototype.switchStatement = function() {
16961 var start = this._peekToken.start; 16985 var start = this._peekToken.start;
16962 this._eat(107/*TokenKind.SWITCH*/); 16986 this._eat(107/*TokenKind.SWITCH*/);
16963 var test = this.testCondition(); 16987 var test = this.testCondition();
16964 var cases = []; 16988 var cases = [];
16965 this._eat(6/*TokenKind.LBRACE*/); 16989 this._eat(6/*TokenKind.LBRACE*/);
16966 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) { 16990 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) {
16967 cases.add$1(this.caseNode()); 16991 cases.add$1(this.caseNode());
16968 } 16992 }
16969 return new SwitchStatement(test, cases, this._makeSpan(start)); 16993 return new SwitchStatement(test, cases, this._makeSpan(start));
16970 } 16994 }
16971 Parser.prototype._peekCaseEnd = function() { 16995 lang_Parser.prototype._peekCaseEnd = function() {
16972 var kind = this._peek(); 16996 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*/)); 16997 return $notnull_bool($eq(kind, 7/*TokenKind.RBRACE*/)) || $notnull_bool($eq(ki nd, 89/*TokenKind.CASE*/)) || $notnull_bool($eq(kind, 93/*TokenKind.DEFAULT*/));
16974 } 16998 }
16975 Parser.prototype.caseNode = function() { 16999 lang_Parser.prototype.caseNode = function() {
16976 var start = this._peekToken.start; 17000 var start = this._peekToken.start;
16977 var label = null; 17001 var label = null;
16978 if ($notnull_bool(this._peekIdentifier())) { 17002 if ($notnull_bool(this._peekIdentifier())) {
16979 label = this.identifier(); 17003 label = this.identifier();
16980 this._eat(8/*TokenKind.COLON*/); 17004 this._eat(8/*TokenKind.COLON*/);
16981 } 17005 }
16982 var cases = []; 17006 var cases = [];
16983 while (true) { 17007 while (true) {
16984 if ($notnull_bool(this._maybeEat(89/*TokenKind.CASE*/))) { 17008 if ($notnull_bool(this._maybeEat(89/*TokenKind.CASE*/))) {
16985 cases.add$1(this.expression()); 17009 cases.add$1(this.expression());
(...skipping 10 matching lines...) Expand all
16996 if (cases.length == 0) { 17020 if (cases.length == 0) {
16997 this._lang_error('case or default'); 17021 this._lang_error('case or default');
16998 } 17022 }
16999 var stmts = []; 17023 var stmts = [];
17000 while (!$notnull_bool(this._peekCaseEnd())) { 17024 while (!$notnull_bool(this._peekCaseEnd())) {
17001 if ($notnull_bool(this.isPrematureEndOfFile())) break; 17025 if ($notnull_bool(this.isPrematureEndOfFile())) break;
17002 stmts.add$1(this.statement()); 17026 stmts.add$1(this.statement());
17003 } 17027 }
17004 return new CaseNode(label, cases, stmts, this._makeSpan(start)); 17028 return new CaseNode(label, cases, stmts, this._makeSpan(start));
17005 } 17029 }
17006 Parser.prototype.returnStatement = function() { 17030 lang_Parser.prototype.returnStatement = function() {
17007 var start = this._peekToken.start; 17031 var start = this._peekToken.start;
17008 this._eat(105/*TokenKind.RETURN*/); 17032 this._eat(105/*TokenKind.RETURN*/);
17009 var expr; 17033 var expr;
17010 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) { 17034 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
17011 expr = null; 17035 expr = null;
17012 } 17036 }
17013 else { 17037 else {
17014 expr = this.expression(); 17038 expr = this.expression();
17015 this._eatSemicolon(); 17039 this._eatSemicolon();
17016 } 17040 }
17017 return new ReturnStatement(expr, this._makeSpan(start)); 17041 return new ReturnStatement(expr, this._makeSpan(start));
17018 } 17042 }
17019 Parser.prototype.throwStatement = function() { 17043 lang_Parser.prototype.throwStatement = function() {
17020 var start = this._peekToken.start; 17044 var start = this._peekToken.start;
17021 this._eat(109/*TokenKind.THROW*/); 17045 this._eat(109/*TokenKind.THROW*/);
17022 var expr; 17046 var expr;
17023 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) { 17047 if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
17024 expr = null; 17048 expr = null;
17025 } 17049 }
17026 else { 17050 else {
17027 expr = this.expression(); 17051 expr = this.expression();
17028 this._eatSemicolon(); 17052 this._eatSemicolon();
17029 } 17053 }
17030 return new ThrowStatement(expr, this._makeSpan(start)); 17054 return new ThrowStatement(expr, this._makeSpan(start));
17031 } 17055 }
17032 Parser.prototype.assertStatement = function() { 17056 lang_Parser.prototype.assertStatement = function() {
17033 var start = this._peekToken.start; 17057 var start = this._peekToken.start;
17034 this._eat(72/*TokenKind.ASSERT*/); 17058 this._eat(72/*TokenKind.ASSERT*/);
17035 this._eat(2/*TokenKind.LPAREN*/); 17059 this._eat(2/*TokenKind.LPAREN*/);
17036 var expr = this.expression(); 17060 var expr = this.expression();
17037 this._eat(3/*TokenKind.RPAREN*/); 17061 this._eat(3/*TokenKind.RPAREN*/);
17038 this._eatSemicolon(); 17062 this._eatSemicolon();
17039 return new AssertStatement(expr, this._makeSpan(start)); 17063 return new AssertStatement(expr, this._makeSpan(start));
17040 } 17064 }
17041 Parser.prototype.breakStatement = function() { 17065 lang_Parser.prototype.breakStatement = function() {
17042 var start = this._peekToken.start; 17066 var start = this._peekToken.start;
17043 this._eat(88/*TokenKind.BREAK*/); 17067 this._eat(88/*TokenKind.BREAK*/);
17044 var name = null; 17068 var name = null;
17045 if ($notnull_bool(this._peekIdentifier())) { 17069 if ($notnull_bool(this._peekIdentifier())) {
17046 name = this.identifier(); 17070 name = this.identifier();
17047 } 17071 }
17048 this._eatSemicolon(); 17072 this._eatSemicolon();
17049 return new BreakStatement(name, this._makeSpan(start)); 17073 return new BreakStatement(name, this._makeSpan(start));
17050 } 17074 }
17051 Parser.prototype.continueStatement = function() { 17075 lang_Parser.prototype.continueStatement = function() {
17052 var start = this._peekToken.start; 17076 var start = this._peekToken.start;
17053 this._eat(92/*TokenKind.CONTINUE*/); 17077 this._eat(92/*TokenKind.CONTINUE*/);
17054 var name = null; 17078 var name = null;
17055 if ($notnull_bool(this._peekIdentifier())) { 17079 if ($notnull_bool(this._peekIdentifier())) {
17056 name = this.identifier(); 17080 name = this.identifier();
17057 } 17081 }
17058 this._eatSemicolon(); 17082 this._eatSemicolon();
17059 return new ContinueStatement(name, this._makeSpan(start)); 17083 return new ContinueStatement(name, this._makeSpan(start));
17060 } 17084 }
17061 Parser.prototype.expression = function() { 17085 lang_Parser.prototype.expression = function() {
17062 return this.infixExpression(0); 17086 return this.infixExpression(0);
17063 } 17087 }
17064 Parser.prototype._makeType = function(expr) { 17088 lang_Parser.prototype._makeType = function(expr) {
17065 if ((expr instanceof VarExpression)) { 17089 if ((expr instanceof VarExpression)) {
17066 return new NameTypeReference(false, expr.get$name(), null, expr.get$span()); 17090 return new NameTypeReference(false, expr.get$name(), null, expr.get$span());
17067 } 17091 }
17068 else if ((expr instanceof DotExpression)) { 17092 else if ((expr instanceof DotExpression)) {
17069 var type = this._makeType(expr.self); 17093 var type = this._makeType(expr.self);
17070 if (type.names == null) { 17094 if (type.names == null) {
17071 type.names = [expr.get$name()]; 17095 type.names = [expr.get$name()];
17072 } 17096 }
17073 else { 17097 else {
17074 type.names.add$1(expr.get$name()); 17098 type.names.add$1(expr.get$name());
17075 } 17099 }
17076 type.span = expr.get$span(); 17100 type.span = expr.get$span();
17077 return type; 17101 return type;
17078 } 17102 }
17079 else { 17103 else {
17080 this._lang_error('expected type reference'); 17104 this._lang_error('expected type reference');
17081 return null; 17105 return null;
17082 } 17106 }
17083 } 17107 }
17084 Parser.prototype.infixExpression = function(precedence) { 17108 lang_Parser.prototype.infixExpression = function(precedence) {
17085 var $0; 17109 var $0;
17086 return this.finishInfixExpression((($0 = this.unaryExpression()) && $0.is$Expr ession()), precedence); 17110 return this.finishInfixExpression((($0 = this.unaryExpression()) && $0.is$lang _Expression()), precedence);
17087 } 17111 }
17088 Parser.prototype._finishDeclaredId = function(type) { 17112 lang_Parser.prototype._finishDeclaredId = function(type) {
17089 var name = this.identifier(); 17113 var name = this.identifier();
17090 return this.finishPostfixExpression(new DeclaredIdentifier(type, name, this._m akeSpan(type.get$span().start))); 17114 return this.finishPostfixExpression(new DeclaredIdentifier(type, name, this._m akeSpan(type.get$span().start)));
17091 } 17115 }
17092 Parser.prototype._fixAsType = function(x) { 17116 lang_Parser.prototype._fixAsType = function(x) {
17093 $assert(this._isBin(x, 52/*TokenKind.LT*/), "_isBin(x, TokenKind.LT)", "parser .dart", 790, 12); 17117 $assert(this._isBin(x, 52/*TokenKind.LT*/), "_isBin(x, TokenKind.LT)", "parser .dart", 790, 12);
17094 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) { 17118 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) {
17095 var base = this._makeType(x.x); 17119 var base = this._makeType(x.x);
17096 var typeParam = this._makeType(x.y); 17120 var typeParam = this._makeType(x.y);
17097 var type = new GenericTypeReference(base, [typeParam], 0, this._makeSpan(x.s pan.start)); 17121 var type = new GenericTypeReference(base, [typeParam], 0, this._makeSpan(x.s pan.start));
17098 return this._finishDeclaredId(type); 17122 return this._finishDeclaredId(type);
17099 } 17123 }
17100 else { 17124 else {
17101 $assert(this._peekKind(52/*TokenKind.LT*/), "_peekKind(TokenKind.LT)", "pars er.dart", 801, 14); 17125 $assert(this._peekKind(52/*TokenKind.LT*/), "_peekKind(TokenKind.LT)", "pars er.dart", 801, 14);
17102 var base = this._makeType(x.x); 17126 var base = this._makeType(x.x);
17103 var paramBase = this._makeType(x.y); 17127 var paramBase = this._makeType(x.y);
17104 var firstParam = this.addTypeArguments((paramBase && paramBase.is$TypeRefere nce()), 1); 17128 var firstParam = this.addTypeArguments((paramBase && paramBase.is$TypeRefere nce()), 1);
17105 var type; 17129 var type;
17106 if (firstParam.depth <= 0) { 17130 if (firstParam.depth <= 0) {
17107 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp an.start)); 17131 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp an.start));
17108 } 17132 }
17109 else if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 17133 else if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
17110 type = this._finishTypeArguments((base && base.is$TypeReference()), 0, [fi rstParam]); 17134 type = this._finishTypeArguments((base && base.is$TypeReference()), 0, [fi rstParam]);
17111 } 17135 }
17112 else { 17136 else {
17113 this._eat(53/*TokenKind.GT*/); 17137 this._eat(53/*TokenKind.GT*/);
17114 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp an.start)); 17138 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp an.start));
17115 } 17139 }
17116 return this._finishDeclaredId(type); 17140 return this._finishDeclaredId(type);
17117 } 17141 }
17118 } 17142 }
17119 Parser.prototype.finishInfixExpression = function(x, precedence) { 17143 lang_Parser.prototype.finishInfixExpression = function(x, precedence) {
17120 while (true) { 17144 while (true) {
17121 var kind = this._peek(); 17145 var kind = this._peek();
17122 var prec = TokenKind.infixPrecedence(this._peek()); 17146 var prec = TokenKind.infixPrecedence(this._peek());
17123 if (prec >= precedence) { 17147 if (prec >= precedence) {
17124 if (kind == 52/*TokenKind.LT*/ || kind == 53/*TokenKind.GT*/) { 17148 if (kind == 52/*TokenKind.LT*/ || kind == 53/*TokenKind.GT*/) {
17125 if ($notnull_bool(this._isBin(x, 52/*TokenKind.LT*/))) { 17149 if ($notnull_bool(this._isBin(x, 52/*TokenKind.LT*/))) {
17126 return this._fixAsType((x && x.is$BinaryExpression())); 17150 return this._fixAsType((x && x.is$BinaryExpression()));
17127 } 17151 }
17128 } 17152 }
17129 var op = this._lang_next(); 17153 var op = this._lang_next();
(...skipping 12 matching lines...) Expand all
17142 else { 17166 else {
17143 x = new BinaryExpression(op, x, y, this._makeSpan(x.span.start)); 17167 x = new BinaryExpression(op, x, y, this._makeSpan(x.span.start));
17144 } 17168 }
17145 } 17169 }
17146 else { 17170 else {
17147 break; 17171 break;
17148 } 17172 }
17149 } 17173 }
17150 return x; 17174 return x;
17151 } 17175 }
17152 Parser.prototype._isPrefixUnaryOperator = function(kind) { 17176 lang_Parser.prototype._isPrefixUnaryOperator = function(kind) {
17153 switch (kind) { 17177 switch (kind) {
17154 case 42/*TokenKind.ADD*/: 17178 case 42/*TokenKind.ADD*/:
17155 case 43/*TokenKind.SUB*/: 17179 case 43/*TokenKind.SUB*/:
17156 case 19/*TokenKind.NOT*/: 17180 case 19/*TokenKind.NOT*/:
17157 case 18/*TokenKind.BIT_NOT*/: 17181 case 18/*TokenKind.BIT_NOT*/:
17158 case 16/*TokenKind.INCR*/: 17182 case 16/*TokenKind.INCR*/:
17159 case 17/*TokenKind.DECR*/: 17183 case 17/*TokenKind.DECR*/:
17160 17184
17161 return true; 17185 return true;
17162 17186
17163 default: 17187 default:
17164 17188
17165 return false; 17189 return false;
17166 17190
17167 } 17191 }
17168 } 17192 }
17169 Parser.prototype.unaryExpression = function() { 17193 lang_Parser.prototype.unaryExpression = function() {
17170 var start = this._peekToken.start; 17194 var start = this._peekToken.start;
17171 if ($notnull_bool(this._isPrefixUnaryOperator(this._peek()))) { 17195 if ($notnull_bool(this._isPrefixUnaryOperator(this._peek()))) {
17172 var tok = this._lang_next(); 17196 var tok = this._lang_next();
17173 var expr = this.unaryExpression(); 17197 var expr = this.unaryExpression();
17174 return new UnaryExpression(tok, expr, this._makeSpan(start)); 17198 return new UnaryExpression(tok, expr, this._makeSpan(start));
17175 } 17199 }
17176 return this.finishPostfixExpression(this.primary()); 17200 return this.finishPostfixExpression(this.primary());
17177 } 17201 }
17178 Parser.prototype.argument = function() { 17202 lang_Parser.prototype.argument = function() {
17179 var start = this._peekToken.start; 17203 var start = this._peekToken.start;
17180 var expr; 17204 var expr;
17181 var label = null; 17205 var label = null;
17182 if ($notnull_bool(this._maybeEat(15/*TokenKind.ELLIPSIS*/))) { 17206 if ($notnull_bool(this._maybeEat(15/*TokenKind.ELLIPSIS*/))) {
17183 label = new Identifier('...', this._makeSpan(start)); 17207 label = new lang_Identifier('...', this._makeSpan(start));
17184 } 17208 }
17185 expr = this.expression(); 17209 expr = this.expression();
17186 if (label == null && $notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) { 17210 if (label == null && $notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) {
17187 label = this._makeLabel(expr); 17211 label = this._makeLabel(expr);
17188 expr = this.expression(); 17212 expr = this.expression();
17189 } 17213 }
17190 return new ArgumentNode(label, expr, this._makeSpan(start)); 17214 return new ArgumentNode(label, expr, this._makeSpan(start));
17191 } 17215 }
17192 Parser.prototype.arguments = function() { 17216 lang_Parser.prototype.arguments = function() {
17193 var args = []; 17217 var args = [];
17194 this._eat(2/*TokenKind.LPAREN*/); 17218 this._eat(2/*TokenKind.LPAREN*/);
17195 if (!$notnull_bool(this._maybeEat(3/*TokenKind.RPAREN*/))) { 17219 if (!$notnull_bool(this._maybeEat(3/*TokenKind.RPAREN*/))) {
17196 do { 17220 do {
17197 args.add$1(this.argument()); 17221 args.add$1(this.argument());
17198 } 17222 }
17199 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) 17223 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
17200 this._eat(3/*TokenKind.RPAREN*/); 17224 this._eat(3/*TokenKind.RPAREN*/);
17201 } 17225 }
17202 return args; 17226 return args;
17203 } 17227 }
17204 Parser.prototype.get$arguments = function() { 17228 lang_Parser.prototype.get$arguments = function() {
17205 return Parser.prototype.arguments.bind(this); 17229 return lang_Parser.prototype.arguments.bind(this);
17206 } 17230 }
17207 Parser.prototype.finishPostfixExpression = function(expr) { 17231 lang_Parser.prototype.finishPostfixExpression = function(expr) {
17208 switch (this._peek()) { 17232 switch (this._peek()) {
17209 case 2/*TokenKind.LPAREN*/: 17233 case 2/*TokenKind.LPAREN*/:
17210 17234
17211 return this.finishPostfixExpression(new CallExpression(expr, this.argument s(), this._makeSpan(expr.get$span().start))); 17235 return this.finishPostfixExpression(new CallExpression(expr, this.argument s(), this._makeSpan(expr.get$span().start)));
17212 17236
17213 case 4/*TokenKind.LBRACK*/: 17237 case 4/*TokenKind.LBRACK*/:
17214 17238
17215 this._eat(4/*TokenKind.LBRACK*/); 17239 this._eat(4/*TokenKind.LBRACK*/);
17216 var index = this.expression(); 17240 var index = this.expression();
17217 this._eat(5/*TokenKind.RBRACK*/); 17241 this._eat(5/*TokenKind.RBRACK*/);
(...skipping 23 matching lines...) Expand all
17241 17265
17242 if ($notnull_bool(this._peekIdentifier())) { 17266 if ($notnull_bool(this._peekIdentifier())) {
17243 return this.finishPostfixExpression(new DeclaredIdentifier(this._makeTyp e(expr), this.identifier(), this._makeSpan(expr.get$span().start))); 17267 return this.finishPostfixExpression(new DeclaredIdentifier(this._makeTyp e(expr), this.identifier(), this._makeSpan(expr.get$span().start)));
17244 } 17268 }
17245 else { 17269 else {
17246 return expr; 17270 return expr;
17247 } 17271 }
17248 17272
17249 } 17273 }
17250 } 17274 }
17251 Parser.prototype._isBin = function(expr, kind) { 17275 lang_Parser.prototype._isBin = function(expr, kind) {
17252 return (expr instanceof BinaryExpression) && expr.op.kind == kind; 17276 return (expr instanceof BinaryExpression) && expr.op.kind == kind;
17253 } 17277 }
17254 Parser.prototype._boolTypeRef = function(span) { 17278 lang_Parser.prototype._boolTypeRef = function(span) {
17255 return new TypeReference(span, world.nonNullBool); 17279 return new TypeReference(span, world.nonNullBool);
17256 } 17280 }
17257 Parser.prototype._intTypeRef = function(span) { 17281 lang_Parser.prototype._intTypeRef = function(span) {
17258 return new TypeReference(span, world.intType); 17282 return new TypeReference(span, world.intType);
17259 } 17283 }
17260 Parser.prototype._doubleTypeRef = function(span) { 17284 lang_Parser.prototype._doubleTypeRef = function(span) {
17261 return new TypeReference(span, world.doubleType); 17285 return new TypeReference(span, world.doubleType);
17262 } 17286 }
17263 Parser.prototype._stringTypeRef = function(span) { 17287 lang_Parser.prototype._stringTypeRef = function(span) {
17264 return new TypeReference(span, world.stringType); 17288 return new TypeReference(span, world.stringType);
17265 } 17289 }
17266 Parser.prototype.primary = function() { 17290 lang_Parser.prototype.primary = function() {
17267 var start = this._peekToken.start; 17291 var start = this._peekToken.start;
17268 switch (this._peek()) { 17292 switch (this._peek()) {
17269 case 108/*TokenKind.THIS*/: 17293 case 108/*TokenKind.THIS*/:
17270 17294
17271 this._eat(108/*TokenKind.THIS*/); 17295 this._eat(108/*TokenKind.THIS*/);
17272 return new ThisExpression(this._makeSpan(start)); 17296 return new ThisExpression(this._makeSpan(start));
17273 17297
17274 case 106/*TokenKind.SUPER*/: 17298 case 106/*TokenKind.SUPER*/:
17275 17299
17276 this._eat(106/*TokenKind.SUPER*/); 17300 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)); 17345 return new LiteralExpression(true, this._boolTypeRef(this._makeSpan(start) ), 'true', this._makeSpan(start));
17322 17346
17323 case 96/*TokenKind.FALSE*/: 17347 case 96/*TokenKind.FALSE*/:
17324 17348
17325 this._eat(96/*TokenKind.FALSE*/); 17349 this._eat(96/*TokenKind.FALSE*/);
17326 return new LiteralExpression(false, this._boolTypeRef(this._makeSpan(start )), 'false', this._makeSpan(start)); 17350 return new LiteralExpression(false, this._boolTypeRef(this._makeSpan(start )), 'false', this._makeSpan(start));
17327 17351
17328 case 61/*TokenKind.HEX_INTEGER*/: 17352 case 61/*TokenKind.HEX_INTEGER*/:
17329 17353
17330 var t = this._lang_next(); 17354 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)); 17355 return new LiteralExpression(lang_Parser.parseHex(t.get$text().substring(2 )), this._intTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start) );
17332 17356
17333 case 60/*TokenKind.INTEGER*/: 17357 case 60/*TokenKind.INTEGER*/:
17334 17358
17335 var t = this._lang_next(); 17359 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)); 17360 return new LiteralExpression(Math.parseInt(t.get$text()), this._intTypeRef (this._makeSpan(start)), t.get$text(), this._makeSpan(start));
17337 17361
17338 case 62/*TokenKind.DOUBLE*/: 17362 case 62/*TokenKind.DOUBLE*/:
17339 17363
17340 var t = this._lang_next(); 17364 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)); 17365 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 17384
17361 default: 17385 default:
17362 17386
17363 if (!$notnull_bool(this._peekIdentifier())) { 17387 if (!$notnull_bool(this._peekIdentifier())) {
17364 this._errorExpected('expression'); 17388 this._errorExpected('expression');
17365 } 17389 }
17366 return new VarExpression(this.identifier(), this._makeSpan(start)); 17390 return new VarExpression(this.identifier(), this._makeSpan(start));
17367 17391
17368 } 17392 }
17369 } 17393 }
17370 Parser.prototype.stringInterpolation = function() { 17394 lang_Parser.prototype.stringInterpolation = function() {
17371 var start = this._peekToken.start; 17395 var start = this._peekToken.start;
17372 var lits = []; 17396 var lits = [];
17373 var startQuote = null, endQuote = null; 17397 var startQuote = null, endQuote = null;
17374 while ($notnull_bool(this._peekKind(66/*TokenKind.INCOMPLETE_STRING*/))) { 17398 while ($notnull_bool(this._peekKind(66/*TokenKind.INCOMPLETE_STRING*/))) {
17375 var token = this._lang_next(); 17399 var token = this._lang_next();
17376 var text = token.get$text(); 17400 var text = token.get$text();
17377 if ($notnull_bool(startQuote == null)) { 17401 if ($notnull_bool(startQuote == null)) {
17378 if ($notnull_bool(isMultilineString($assert_String(text)))) { 17402 if ($notnull_bool(isMultilineString($assert_String(text)))) {
17379 endQuote = text.substring$2(0, 3); 17403 endQuote = text.substring$2(0, 3);
17380 startQuote = $add(endQuote, '\n'); 17404 startQuote = $add(endQuote, '\n');
(...skipping 21 matching lines...) Expand all
17402 } 17426 }
17403 var tok = this._lang_next(); 17427 var tok = this._lang_next();
17404 if ($notnull_bool($ne(tok.kind, 58/*TokenKind.STRING*/))) { 17428 if ($notnull_bool($ne(tok.kind, 58/*TokenKind.STRING*/))) {
17405 this._errorExpected('interpolated string'); 17429 this._errorExpected('interpolated string');
17406 } 17430 }
17407 var text = $add(startQuote, tok.get$text()); 17431 var text = $add(startQuote, tok.get$text());
17408 lits.add$1(this.makeStringLiteral($assert_String(text), tok.get$span())); 17432 lits.add$1(this.makeStringLiteral($assert_String(text), tok.get$span()));
17409 var span = this._makeSpan(start); 17433 var span = this._makeSpan(start);
17410 return new LiteralExpression(lits, this._stringTypeRef((span && span.is$Source Span())), '\$\$\$', (span && span.is$SourceSpan())); 17434 return new LiteralExpression(lits, this._stringTypeRef((span && span.is$Source Span())), '\$\$\$', (span && span.is$SourceSpan()));
17411 } 17435 }
17412 Parser.prototype.makeStringLiteral = function(text, span) { 17436 lang_Parser.prototype.makeStringLiteral = function(text, span) {
17413 return new LiteralExpression(text, this._stringTypeRef(span), text, span); 17437 return new LiteralExpression(text, this._stringTypeRef(span), text, span);
17414 } 17438 }
17415 Parser.prototype.stringLiteralExpr = function() { 17439 lang_Parser.prototype.stringLiteralExpr = function() {
17416 var token = this._lang_next(); 17440 var token = this._lang_next();
17417 return this.makeStringLiteral(token.get$text(), token.get$span()); 17441 return this.makeStringLiteral(token.get$text(), token.get$span());
17418 } 17442 }
17419 Parser.prototype.maybeStringLiteral = function() { 17443 lang_Parser.prototype.maybeStringLiteral = function() {
17420 var kind = this._peek(); 17444 var kind = this._peek();
17421 if ($notnull_bool($eq(kind, 58/*TokenKind.STRING*/))) { 17445 if ($notnull_bool($eq(kind, 58/*TokenKind.STRING*/))) {
17422 return parseStringLiteral(this._lang_next().get$text()); 17446 return parseStringLiteral(this._lang_next().get$text());
17423 } 17447 }
17424 else if ($notnull_bool($eq(kind, 59/*TokenKind.STRING_PART*/))) { 17448 else if ($notnull_bool($eq(kind, 59/*TokenKind.STRING_PART*/))) {
17425 this._lang_next(); 17449 this._lang_next();
17426 this._errorExpected('string literal, but found interpolated string start'); 17450 this._errorExpected('string literal, but found interpolated string start');
17427 } 17451 }
17428 else if ($notnull_bool($eq(kind, 66/*TokenKind.INCOMPLETE_STRING*/))) { 17452 else if ($notnull_bool($eq(kind, 66/*TokenKind.INCOMPLETE_STRING*/))) {
17429 this._lang_next(); 17453 this._lang_next();
17430 this._errorExpected('string literal, but found incomplete string'); 17454 this._errorExpected('string literal, but found incomplete string');
17431 } 17455 }
17432 return null; 17456 return null;
17433 } 17457 }
17434 Parser.prototype._parenOrLambda = function() { 17458 lang_Parser.prototype._parenOrLambda = function() {
17435 var start = this._peekToken.start; 17459 var start = this._peekToken.start;
17436 var args = this.arguments(); 17460 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*/)))) { 17461 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); 17462 var body = this.functionBody(true);
17439 var formals = this._makeFormals(args); 17463 var formals = this._makeFormals(args);
17440 var func = new FunctionDefinition(null, null, null, formals, null, body, thi s._makeSpan(start)); 17464 var func = new FunctionDefinition(null, null, null, formals, null, body, thi s._makeSpan(start));
17441 return new LambdaExpression(func, func.get$span()); 17465 return new LambdaExpression(func, func.get$span());
17442 } 17466 }
17443 else { 17467 else {
17444 if (args.length == 1) { 17468 if (args.length == 1) {
17445 return new ParenExpression(args.$index(0).get$value(), this._makeSpan(star t)); 17469 return new ParenExpression(args.$index(0).get$value(), this._makeSpan(star t));
17446 } 17470 }
17447 else { 17471 else {
17448 this._lang_error('unexpected comma expression'); 17472 this._lang_error('unexpected comma expression');
17449 return args.$index(0).get$value(); 17473 return args.$index(0).get$value();
17450 } 17474 }
17451 } 17475 }
17452 } 17476 }
17453 Parser.prototype._typeAsIdentifier = function(type) { 17477 lang_Parser.prototype._typeAsIdentifier = function(type) {
17454 return type.get$name(); 17478 return type.get$name();
17455 } 17479 }
17456 Parser.prototype._specialIdentifier = function(includeOperators) { 17480 lang_Parser.prototype._specialIdentifier = function(includeOperators) {
17457 var start = this._peekToken.start; 17481 var start = this._peekToken.start;
17458 var name; 17482 var name;
17459 switch (this._peek()) { 17483 switch (this._peek()) {
17460 case 15/*TokenKind.ELLIPSIS*/: 17484 case 15/*TokenKind.ELLIPSIS*/:
17461 17485
17462 this._eat(15/*TokenKind.ELLIPSIS*/); 17486 this._eat(15/*TokenKind.ELLIPSIS*/);
17463 this._lang_error('rest no longer supported', this._previousToken.get$span( )); 17487 this._lang_error('rest no longer supported', this._previousToken.get$span( ));
17464 name = $assert_String(this.identifier().get$name()); 17488 name = $assert_String(this.identifier().get$name());
17465 break; 17489 break;
17466 17490
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
17513 this._lang_next(); 17537 this._lang_next();
17514 } 17538 }
17515 } 17539 }
17516 break; 17540 break;
17517 17541
17518 default: 17542 default:
17519 17543
17520 return null; 17544 return null;
17521 17545
17522 } 17546 }
17523 return new Identifier(name, this._makeSpan(start)); 17547 return new lang_Identifier(name, this._makeSpan(start));
17524 } 17548 }
17525 Parser.prototype.declaredIdentifier = function(includeOperators) { 17549 lang_Parser.prototype.declaredIdentifier = function(includeOperators) {
17526 var start = this._peekToken.start; 17550 var start = this._peekToken.start;
17527 var myType = null; 17551 var myType = null;
17528 var name = this._specialIdentifier(includeOperators); 17552 var name = this._specialIdentifier(includeOperators);
17529 if (name == null) { 17553 if (name == null) {
17530 myType = this.type(0); 17554 myType = this.type(0);
17531 name = this._specialIdentifier(includeOperators); 17555 name = this._specialIdentifier(includeOperators);
17532 if (name == null) { 17556 if (name == null) {
17533 if ($notnull_bool(this._peekIdentifier())) { 17557 if ($notnull_bool(this._peekIdentifier())) {
17534 name = this.identifier(); 17558 name = this.identifier();
17535 } 17559 }
17536 else if ((myType instanceof NameTypeReference) && $notnull_bool(myType.nam es == null)) { 17560 else if ((myType instanceof NameTypeReference) && $notnull_bool(myType.nam es == null)) {
17537 name = this._typeAsIdentifier(myType); 17561 name = this._typeAsIdentifier(myType);
17538 myType = null; 17562 myType = null;
17539 } 17563 }
17540 else { 17564 else {
17541 } 17565 }
17542 } 17566 }
17543 } 17567 }
17544 return new DeclaredIdentifier(myType, name, this._makeSpan(start)); 17568 return new DeclaredIdentifier(myType, name, this._makeSpan(start));
17545 } 17569 }
17546 Parser._hexDigit = function(c) { 17570 lang_Parser._hexDigit = function(c) {
17547 if (c >= 48 && c <= 57) { 17571 if (c >= 48 && c <= 57) {
17548 return c - 48; 17572 return c - 48;
17549 } 17573 }
17550 else if (c >= 97 && c <= 102) { 17574 else if (c >= 97 && c <= 102) {
17551 return c - 87; 17575 return c - 87;
17552 } 17576 }
17553 else if (c >= 65 && c <= 70) { 17577 else if (c >= 65 && c <= 70) {
17554 return c - 55; 17578 return c - 55;
17555 } 17579 }
17556 else { 17580 else {
17557 return -1; 17581 return -1;
17558 } 17582 }
17559 } 17583 }
17560 Parser.parseHex = function(hex) { 17584 lang_Parser.parseHex = function(hex) {
17561 var result = 0; 17585 var result = 0;
17562 for (var i = 0; 17586 for (var i = 0;
17563 i < hex.length; i++) { 17587 i < hex.length; i++) {
17564 var digit = Parser._hexDigit(hex.charCodeAt(i)); 17588 var digit = lang_Parser._hexDigit(hex.charCodeAt(i));
17565 $assert($ne(digit, -1), "digit != -1", "parser.dart", 1261, 14); 17589 $assert($ne(digit, -1), "digit != -1", "parser.dart", 1261, 14);
17566 result = (result << 4) + $assert_num(digit); 17590 result = (result << 4) + $assert_num(digit);
17567 } 17591 }
17568 return $assert_num(result); 17592 return $assert_num(result);
17569 } 17593 }
17570 Parser.prototype.finishNewExpression = function(start, isConst) { 17594 lang_Parser.prototype.finishNewExpression = function(start, isConst) {
17571 var type = this.type(0); 17595 var type = this.type(0);
17572 var name = null; 17596 var name = null;
17573 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) { 17597 if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
17574 name = this.identifier(); 17598 name = this.identifier();
17575 } 17599 }
17576 var args = this.arguments(); 17600 var args = this.arguments();
17577 return new NewExpression(isConst, type, name, args, this._makeSpan(start)); 17601 return new lang_NewExpression(isConst, type, name, args, this._makeSpan(start) );
17578 } 17602 }
17579 Parser.prototype.finishListLiteral = function(start, isConst, type) { 17603 lang_Parser.prototype.finishListLiteral = function(start, isConst, type) {
17580 if ($notnull_bool(this._maybeEat(56/*TokenKind.INDEX*/))) { 17604 if ($notnull_bool(this._maybeEat(56/*TokenKind.INDEX*/))) {
17581 return new ListExpression(isConst, type, [], this._makeSpan(start)); 17605 return new ListExpression(isConst, type, [], this._makeSpan(start));
17582 } 17606 }
17583 var values = []; 17607 var values = [];
17584 this._eat(4/*TokenKind.LBRACK*/); 17608 this._eat(4/*TokenKind.LBRACK*/);
17585 while (!$notnull_bool(this._maybeEat(5/*TokenKind.RBRACK*/))) { 17609 while (!$notnull_bool(this._maybeEat(5/*TokenKind.RBRACK*/))) {
17586 if ($notnull_bool(this.isPrematureEndOfFile())) break; 17610 if ($notnull_bool(this.isPrematureEndOfFile())) break;
17587 values.add$1(this.expression()); 17611 values.add$1(this.expression());
17588 if (!$notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 17612 if (!$notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
17589 this._eat(5/*TokenKind.RBRACK*/); 17613 this._eat(5/*TokenKind.RBRACK*/);
17590 break; 17614 break;
17591 } 17615 }
17592 } 17616 }
17593 return new ListExpression(isConst, type, values, this._makeSpan(start)); 17617 return new ListExpression(isConst, type, values, this._makeSpan(start));
17594 } 17618 }
17595 Parser.prototype.finishMapLiteral = function(start, isConst, type) { 17619 lang_Parser.prototype.finishMapLiteral = function(start, isConst, type) {
17596 var items = []; 17620 var items = [];
17597 this._eat(6/*TokenKind.LBRACE*/); 17621 this._eat(6/*TokenKind.LBRACE*/);
17598 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) { 17622 while (!$notnull_bool(this._maybeEat(7/*TokenKind.RBRACE*/))) {
17599 if ($notnull_bool(this.isPrematureEndOfFile())) break; 17623 if ($notnull_bool(this.isPrematureEndOfFile())) break;
17600 items.add$1(this.expression()); 17624 items.add$1(this.expression());
17601 this._eat(8/*TokenKind.COLON*/); 17625 this._eat(8/*TokenKind.COLON*/);
17602 items.add$1(this.expression()); 17626 items.add$1(this.expression());
17603 if (!$notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 17627 if (!$notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
17604 this._eat(7/*TokenKind.RBRACE*/); 17628 this._eat(7/*TokenKind.RBRACE*/);
17605 break; 17629 break;
17606 } 17630 }
17607 } 17631 }
17608 return new MapExpression(isConst, type, items, this._makeSpan(start)); 17632 return new MapExpression(isConst, type, items, this._makeSpan(start));
17609 } 17633 }
17610 Parser.prototype.finishTypedLiteral = function(start, isConst) { 17634 lang_Parser.prototype.finishTypedLiteral = function(start, isConst) {
17611 var span = this._makeSpan(start); 17635 var span = this._makeSpan(start);
17612 var typeToBeNamedLater = new NameTypeReference(false, null, null, (span && spa n.is$SourceSpan())); 17636 var typeToBeNamedLater = new NameTypeReference(false, null, null, (span && spa n.is$SourceSpan()));
17613 var genericType = this.addTypeArguments((typeToBeNamedLater && typeToBeNamedLa ter.is$TypeReference()), 0); 17637 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*/))) { 17638 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())); 17639 return this.finishListLiteral(start, isConst, (genericType && genericType.is $TypeReference()));
17616 } 17640 }
17617 else if ($notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/))) { 17641 else if ($notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/))) {
17618 return this.finishMapLiteral(start, isConst, (genericType && genericType.is$ TypeReference())); 17642 return this.finishMapLiteral(start, isConst, (genericType && genericType.is$ TypeReference()));
17619 } 17643 }
17620 else { 17644 else {
17621 this._errorExpected('array or map literal'); 17645 this._errorExpected('array or map literal');
17622 } 17646 }
17623 } 17647 }
17624 Parser.prototype._readModifiers = function() { 17648 lang_Parser.prototype._readModifiers = function() {
17625 var modifiers = null; 17649 var modifiers = null;
17626 while (true) { 17650 while (true) {
17627 switch (this._peek()) { 17651 switch (this._peek()) {
17628 case 86/*TokenKind.STATIC*/: 17652 case 86/*TokenKind.STATIC*/:
17629 case 97/*TokenKind.FINAL*/: 17653 case 97/*TokenKind.FINAL*/:
17630 case 91/*TokenKind.CONST*/: 17654 case 91/*TokenKind.CONST*/:
17631 case 71/*TokenKind.ABSTRACT*/: 17655 case 71/*TokenKind.ABSTRACT*/:
17632 case 75/*TokenKind.FACTORY*/: 17656 case 75/*TokenKind.FACTORY*/:
17633 17657
17634 if (modifiers == null) modifiers = []; 17658 if (modifiers == null) modifiers = [];
17635 modifiers.add$1(this._lang_next()); 17659 modifiers.add$1(this._lang_next());
17636 break; 17660 break;
17637 17661
17638 default: 17662 default:
17639 17663
17640 return modifiers; 17664 return modifiers;
17641 17665
17642 } 17666 }
17643 } 17667 }
17644 return null; 17668 return null;
17645 } 17669 }
17646 Parser.prototype.typeParameter = function() { 17670 lang_Parser.prototype.typeParameter = function() {
17647 var start = this._peekToken.start; 17671 var start = this._peekToken.start;
17648 var name = this.identifier(); 17672 var name = this.identifier();
17649 var myType = null; 17673 var myType = null;
17650 if ($notnull_bool(this._maybeEat(74/*TokenKind.EXTENDS*/))) { 17674 if ($notnull_bool(this._maybeEat(74/*TokenKind.EXTENDS*/))) {
17651 myType = this.type(1); 17675 myType = this.type(1);
17652 } 17676 }
17653 return new TypeParameter(name, myType, this._makeSpan(start)); 17677 return new TypeParameter(name, myType, this._makeSpan(start));
17654 } 17678 }
17655 Parser.prototype.typeParameters = function() { 17679 lang_Parser.prototype.typeParameters = function() {
17656 this._eat(52/*TokenKind.LT*/); 17680 this._eat(52/*TokenKind.LT*/);
17657 var closed = false; 17681 var closed = false;
17658 var ret = []; 17682 var ret = [];
17659 do { 17683 do {
17660 var tp = this.typeParameter(); 17684 var tp = this.typeParameter();
17661 ret.add$1(tp); 17685 ret.add$1(tp);
17662 if ((tp.extendsType instanceof GenericTypeReference) && tp.extendsType.depth == 0) { 17686 if ((tp.extendsType instanceof GenericTypeReference) && tp.extendsType.depth == 0) {
17663 closed = true; 17687 closed = true;
17664 break; 17688 break;
17665 } 17689 }
17666 } 17690 }
17667 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) 17691 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
17668 if (!$notnull_bool(closed)) { 17692 if (!$notnull_bool(closed)) {
17669 this._eat(53/*TokenKind.GT*/); 17693 this._eat(53/*TokenKind.GT*/);
17670 } 17694 }
17671 return ret; 17695 return ret;
17672 } 17696 }
17673 Parser.prototype.get$typeParameters = function() { 17697 lang_Parser.prototype.get$typeParameters = function() {
17674 return Parser.prototype.typeParameters.bind(this); 17698 return lang_Parser.prototype.typeParameters.bind(this);
17675 } 17699 }
17676 Parser.prototype._eatClosingAngle = function(depth) { 17700 lang_Parser.prototype._eatClosingAngle = function(depth) {
17677 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) { 17701 if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) {
17678 return depth; 17702 return depth;
17679 } 17703 }
17680 else if (depth > 0 && $notnull_bool(this._maybeEat(40/*TokenKind.SAR*/))) { 17704 else if (depth > 0 && $notnull_bool(this._maybeEat(40/*TokenKind.SAR*/))) {
17681 return depth - 1; 17705 return depth - 1;
17682 } 17706 }
17683 else if (depth > 1 && $notnull_bool(this._maybeEat(41/*TokenKind.SHR*/))) { 17707 else if (depth > 1 && $notnull_bool(this._maybeEat(41/*TokenKind.SHR*/))) {
17684 return depth - 2; 17708 return depth - 2;
17685 } 17709 }
17686 else { 17710 else {
17687 this._errorExpected('>'); 17711 this._errorExpected('>');
17688 return depth; 17712 return depth;
17689 } 17713 }
17690 } 17714 }
17691 Parser.prototype.addTypeArguments = function(baseType, depth) { 17715 lang_Parser.prototype.addTypeArguments = function(baseType, depth) {
17692 this._eat(52/*TokenKind.LT*/); 17716 this._eat(52/*TokenKind.LT*/);
17693 return this._finishTypeArguments(baseType, depth, []); 17717 return this._finishTypeArguments(baseType, depth, []);
17694 } 17718 }
17695 Parser.prototype._finishTypeArguments = function(baseType, depth, types) { 17719 lang_Parser.prototype._finishTypeArguments = function(baseType, depth, types) {
17696 var delta = -1; 17720 var delta = -1;
17697 do { 17721 do {
17698 var myType = this.type(depth + 1); 17722 var myType = this.type(depth + 1);
17699 types.add$1(myType); 17723 types.add$1(myType);
17700 if ((myType instanceof GenericTypeReference) && myType.depth <= depth) { 17724 if ((myType instanceof GenericTypeReference) && myType.depth <= depth) {
17701 delta = depth - myType.depth; 17725 delta = depth - myType.depth;
17702 break; 17726 break;
17703 } 17727 }
17704 } 17728 }
17705 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) 17729 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
17706 if (delta >= 0) { 17730 if (delta >= 0) {
17707 depth -= $assert_num(delta); 17731 depth -= $assert_num(delta);
17708 } 17732 }
17709 else { 17733 else {
17710 depth = this._eatClosingAngle(depth); 17734 depth = this._eatClosingAngle(depth);
17711 } 17735 }
17712 var span = this._makeSpan(baseType.span.start); 17736 var span = this._makeSpan(baseType.span.start);
17713 return new GenericTypeReference(baseType, types, depth, (span && span.is$Sourc eSpan())); 17737 return new GenericTypeReference(baseType, types, depth, (span && span.is$Sourc eSpan()));
17714 } 17738 }
17715 Parser.prototype.typeList = function() { 17739 lang_Parser.prototype.typeList = function() {
17716 var types = []; 17740 var types = [];
17717 do { 17741 do {
17718 types.add$1(this.type(0)); 17742 types.add$1(this.type(0));
17719 } 17743 }
17720 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) 17744 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
17721 return types; 17745 return types;
17722 } 17746 }
17723 Parser.prototype.type = function(depth) { 17747 lang_Parser.prototype.type = function(depth) {
17724 var start = this._peekToken.start; 17748 var start = this._peekToken.start;
17725 var name; 17749 var name;
17726 var names = null; 17750 var names = null;
17727 var typeArgs = null; 17751 var typeArgs = null;
17728 var isFinal = false; 17752 var isFinal = false;
17729 switch (this._peek()) { 17753 switch (this._peek()) {
17730 case 113/*TokenKind.VOID*/: 17754 case 113/*TokenKind.VOID*/:
17731 17755
17732 return new TypeReference(this._lang_next().get$span(), world.voidType); 17756 return new TypeReference(this._lang_next().get$span(), world.voidType);
17733 17757
(...skipping 19 matching lines...) Expand all
17753 names.add$1(this.identifier()); 17777 names.add$1(this.identifier());
17754 } 17778 }
17755 var typeRef = new NameTypeReference(isFinal, name, names, this._makeSpan(start )); 17779 var typeRef = new NameTypeReference(isFinal, name, names, this._makeSpan(start ));
17756 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) { 17780 if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
17757 return this.addTypeArguments((typeRef && typeRef.is$TypeReference()), depth) ; 17781 return this.addTypeArguments((typeRef && typeRef.is$TypeReference()), depth) ;
17758 } 17782 }
17759 else { 17783 else {
17760 return typeRef; 17784 return typeRef;
17761 } 17785 }
17762 } 17786 }
17763 Parser.prototype.get$type = function() { 17787 lang_Parser.prototype.get$type = function() {
17764 return Parser.prototype.type.bind(this); 17788 return lang_Parser.prototype.type.bind(this);
17765 } 17789 }
17766 Parser.prototype.formalParameter = function(inOptionalBlock) { 17790 lang_Parser.prototype.formalParameter = function(inOptionalBlock) {
17767 var start = this._peekToken.start; 17791 var start = this._peekToken.start;
17768 var isThis = false; 17792 var isThis = false;
17769 var isRest = false; 17793 var isRest = false;
17770 var di = this.declaredIdentifier(false); 17794 var di = this.declaredIdentifier(false);
17771 var type = di.type; 17795 var type = di.type;
17772 var name = di.get$name(); 17796 var name = di.get$name();
17773 var value = null; 17797 var value = null;
17774 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) { 17798 if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
17775 if (!$notnull_bool(inOptionalBlock)) { 17799 if (!$notnull_bool(inOptionalBlock)) {
17776 this._lang_error('default values only allowed inside [optional] section'); 17800 this._lang_error('default values only allowed inside [optional] section');
17777 } 17801 }
17778 value = this.expression(); 17802 value = this.expression();
17779 } 17803 }
17780 else if ($notnull_bool(this._peekKind(2/*TokenKind.LPAREN*/))) { 17804 else if ($notnull_bool(this._peekKind(2/*TokenKind.LPAREN*/))) {
17781 var formals = this.formalParameterList(); 17805 var formals = this.formalParameterList();
17782 var func = new FunctionDefinition(null, type, name, formals, null, null, thi s._makeSpan(start)); 17806 var func = new FunctionDefinition(null, type, name, formals, null, null, thi s._makeSpan(start));
17783 type = new FunctionTypeReference(false, func, func.get$span()); 17807 type = new FunctionTypeReference(false, func, func.get$span());
17784 } 17808 }
17785 if ($notnull_bool(inOptionalBlock) && $notnull_bool(value == null)) { 17809 if ($notnull_bool(inOptionalBlock) && $notnull_bool(value == null)) {
17786 value = new NullExpression(this._makeSpan(start)); 17810 value = new NullExpression(this._makeSpan(start));
17787 } 17811 }
17788 return new FormalNode(isThis, isRest, type, name, value, this._makeSpan(start) ); 17812 return new FormalNode(isThis, isRest, type, name, value, this._makeSpan(start) );
17789 } 17813 }
17790 Parser.prototype.formalParameterList = function() { 17814 lang_Parser.prototype.formalParameterList = function() {
17791 this._eat(2/*TokenKind.LPAREN*/); 17815 this._eat(2/*TokenKind.LPAREN*/);
17792 var formals = []; 17816 var formals = [];
17793 var inOptionalBlock = false; 17817 var inOptionalBlock = false;
17794 if (!$notnull_bool(this._maybeEat(3/*TokenKind.RPAREN*/))) { 17818 if (!$notnull_bool(this._maybeEat(3/*TokenKind.RPAREN*/))) {
17795 if ($notnull_bool(this._maybeEat(4/*TokenKind.LBRACK*/))) { 17819 if ($notnull_bool(this._maybeEat(4/*TokenKind.LBRACK*/))) {
17796 inOptionalBlock = true; 17820 inOptionalBlock = true;
17797 } 17821 }
17798 formals.add$1(this.formalParameter($assert_bool(inOptionalBlock))); 17822 formals.add$1(this.formalParameter($assert_bool(inOptionalBlock)));
17799 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) { 17823 while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
17800 if ($notnull_bool(this._maybeEat(4/*TokenKind.LBRACK*/))) { 17824 if ($notnull_bool(this._maybeEat(4/*TokenKind.LBRACK*/))) {
17801 if ($notnull_bool(inOptionalBlock)) { 17825 if ($notnull_bool(inOptionalBlock)) {
17802 this._lang_error('already inside an optional block', this._previousTok en.get$span()); 17826 this._lang_error('already inside an optional block', this._previousTok en.get$span());
17803 } 17827 }
17804 inOptionalBlock = true; 17828 inOptionalBlock = true;
17805 } 17829 }
17806 formals.add$1(this.formalParameter($assert_bool(inOptionalBlock))); 17830 formals.add$1(this.formalParameter($assert_bool(inOptionalBlock)));
17807 } 17831 }
17808 if ($notnull_bool(inOptionalBlock)) { 17832 if ($notnull_bool(inOptionalBlock)) {
17809 this._eat(5/*TokenKind.RBRACK*/); 17833 this._eat(5/*TokenKind.RBRACK*/);
17810 } 17834 }
17811 this._eat(3/*TokenKind.RPAREN*/); 17835 this._eat(3/*TokenKind.RPAREN*/);
17812 } 17836 }
17813 return formals; 17837 return formals;
17814 } 17838 }
17815 Parser.prototype.identifier = function() { 17839 lang_Parser.prototype.identifier = function() {
17816 var tok = this._lang_next(); 17840 var tok = this._lang_next();
17817 if (!$notnull_bool(TokenKind.isIdentifier($assert_num(tok.kind)))) { 17841 if (!$notnull_bool(TokenKind.isIdentifier($assert_num(tok.kind)))) {
17818 this._lang_error(('expected identifier, but found ' + tok + ''), tok.get$spa n()); 17842 this._lang_error(('expected identifier, but found ' + tok + ''), tok.get$spa n());
17819 } 17843 }
17820 return new Identifier(tok.get$text(), this._makeSpan(tok.start)); 17844 return new lang_Identifier(tok.get$text(), this._makeSpan(tok.start));
17821 } 17845 }
17822 Parser.prototype._makeFunction = function(expr, body) { 17846 lang_Parser.prototype._makeFunction = function(expr, body) {
17823 var name, type; 17847 var name, type;
17824 if ((expr instanceof CallExpression)) { 17848 if ((expr instanceof CallExpression)) {
17825 if ((expr.target instanceof VarExpression)) { 17849 if ((expr.target instanceof VarExpression)) {
17826 name = expr.target.get$name(); 17850 name = expr.target.get$name();
17827 type = null; 17851 type = null;
17828 } 17852 }
17829 else if ((expr.target instanceof DeclaredIdentifier)) { 17853 else if ((expr.target instanceof DeclaredIdentifier)) {
17830 name = expr.target.get$name(); 17854 name = expr.target.get$name();
17831 type = expr.target.type; 17855 type = expr.target.type;
17832 } 17856 }
17833 else { 17857 else {
17834 this._lang_error('bad function'); 17858 this._lang_error('bad function');
17835 } 17859 }
17836 var formals = this._makeFormals(expr.get$arguments()); 17860 var formals = this._makeFormals(expr.get$arguments());
17837 var span = new SourceSpan(expr.get$span().file, expr.get$span().start, body. get$span().end); 17861 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())); 17862 var func = new FunctionDefinition(null, type, name, formals, null, body, (sp an && span.is$SourceSpan()));
17839 return new LambdaExpression(func, func.get$span()); 17863 return new LambdaExpression(func, func.get$span());
17840 } 17864 }
17841 else { 17865 else {
17842 this._lang_error('expected function'); 17866 this._lang_error('expected function');
17843 } 17867 }
17844 } 17868 }
17845 Parser.prototype._makeFormal = function(expr) { 17869 lang_Parser.prototype._makeFormal = function(expr) {
17846 var $0; 17870 var $0;
17847 if ((expr instanceof VarExpression)) { 17871 if ((expr instanceof VarExpression)) {
17848 return new FormalNode(false, false, null, expr.get$name(), null, expr.get$sp an()); 17872 return new FormalNode(false, false, null, expr.get$name(), null, expr.get$sp an());
17849 } 17873 }
17850 else if ((expr instanceof DeclaredIdentifier)) { 17874 else if ((expr instanceof DeclaredIdentifier)) {
17851 return new FormalNode(false, false, expr.type, expr.get$name(), null, expr.g et$span()); 17875 return new FormalNode(false, false, expr.type, expr.get$name(), null, expr.g et$span());
17852 } 17876 }
17853 else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/)) && ((expr.x instanceof DeclaredIdentifier))) { 17877 else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/)) && ((expr.x instanceof DeclaredIdentifier))) {
17854 var di = (($0 = expr.x) && $0.is$DeclaredIdentifier()); 17878 var di = (($0 = expr.x) && $0.is$DeclaredIdentifier());
17855 return new FormalNode(false, false, di.type, di.name, expr.y, expr.get$span( )); 17879 return new FormalNode(false, false, di.type, di.name, expr.y, expr.get$span( ));
17856 } 17880 }
17857 else if ($notnull_bool(this._isBin(expr, 52/*TokenKind.LT*/))) { 17881 else if ($notnull_bool(this._isBin(expr, 52/*TokenKind.LT*/))) {
17858 return null; 17882 return null;
17859 } 17883 }
17860 else if ((expr instanceof ListExpression)) { 17884 else if ((expr instanceof ListExpression)) {
17861 return this._makeFormalsFromList(expr); 17885 return this._makeFormalsFromList(expr);
17862 } 17886 }
17863 else { 17887 else {
17864 this._lang_error('expected formal', expr.get$span()); 17888 this._lang_error('expected formal', expr.get$span());
17865 } 17889 }
17866 } 17890 }
17867 Parser.prototype._makeFormalsFromList = function(expr) { 17891 lang_Parser.prototype._makeFormalsFromList = function(expr) {
17868 if ($notnull_bool(expr.get$isConst())) { 17892 if ($notnull_bool(expr.get$isConst())) {
17869 this._lang_error('expected formal, but found "const"', expr.get$span()); 17893 this._lang_error('expected formal, but found "const"', expr.get$span());
17870 } 17894 }
17871 else if ($notnull_bool($ne(expr.type, null))) { 17895 else if ($notnull_bool($ne(expr.type, null))) {
17872 this._lang_error('expected formal, but found generic type arguments', expr.t ype.get$span()); 17896 this._lang_error('expected formal, but found generic type arguments', expr.t ype.get$span());
17873 } 17897 }
17874 return this._makeFormalsFromExpressions(expr.values, false); 17898 return this._makeFormalsFromExpressions(expr.values, false);
17875 } 17899 }
17876 Parser.prototype._makeFormals = function(arguments) { 17900 lang_Parser.prototype._makeFormals = function(arguments) {
17877 var expressions = []; 17901 var expressions = [];
17878 for (var i = 0; 17902 for (var i = 0;
17879 i < arguments.length; i++) { 17903 i < arguments.length; i++) {
17880 var arg = arguments.$index(i); 17904 var arg = arguments.$index(i);
17881 if (arg.label != null) { 17905 if (arg.label != null) {
17882 this._lang_error('expected formal, but found ":"'); 17906 this._lang_error('expected formal, but found ":"');
17883 } 17907 }
17884 expressions.add$1(arg.get$value()); 17908 expressions.add$1(arg.get$value());
17885 } 17909 }
17886 return this._makeFormalsFromExpressions(expressions, true); 17910 return this._makeFormalsFromExpressions(expressions, true);
17887 } 17911 }
17888 Parser.prototype._makeFormalsFromExpressions = function(expressions, allowOption al) { 17912 lang_Parser.prototype._makeFormalsFromExpressions = function(expressions, allowO ptional) {
17889 var $0; 17913 var $0;
17890 var formals = []; 17914 var formals = [];
17891 for (var i = 0; 17915 for (var i = 0;
17892 i < expressions.length; i++) { 17916 i < expressions.length; i++) {
17893 var formal = this._makeFormal(expressions.$index(i)); 17917 var formal = this._makeFormal(expressions.$index(i));
17894 if ($notnull_bool(formal == null)) { 17918 if ($notnull_bool(formal == null)) {
17895 var baseType = this._makeType(expressions.$index(i).x); 17919 var baseType = this._makeType(expressions.$index(i).x);
17896 var typeParams = [this._makeType(expressions.$index(i).y)]; 17920 var typeParams = [this._makeType(expressions.$index(i).y)];
17897 i++; 17921 i++;
17898 while (i < expressions.length) { 17922 while (i < expressions.length) {
(...skipping 23 matching lines...) Expand all
17922 if (!$notnull_bool(allowOptional)) { 17946 if (!$notnull_bool(allowOptional)) {
17923 this._lang_error('unexpected nested optional formal', expressions.$index (i).get$span()); 17947 this._lang_error('unexpected nested optional formal', expressions.$index (i).get$span());
17924 } 17948 }
17925 } 17949 }
17926 else { 17950 else {
17927 formals.add$1(formal); 17951 formals.add$1(formal);
17928 } 17952 }
17929 } 17953 }
17930 return formals; 17954 return formals;
17931 } 17955 }
17932 Parser.prototype._makeDeclaredIdentifier = function(e) { 17956 lang_Parser.prototype._makeDeclaredIdentifier = function(e) {
17933 if ((e instanceof VarExpression)) { 17957 if ((e instanceof VarExpression)) {
17934 return new DeclaredIdentifier(null, e.get$name(), e.get$span()); 17958 return new DeclaredIdentifier(null, e.get$name(), e.get$span());
17935 } 17959 }
17936 else if ((e instanceof DeclaredIdentifier)) { 17960 else if ((e instanceof DeclaredIdentifier)) {
17937 return e; 17961 return e;
17938 } 17962 }
17939 else { 17963 else {
17940 this._lang_error('expected declared identifier'); 17964 this._lang_error('expected declared identifier');
17941 return new DeclaredIdentifier(null, null, e.get$span()); 17965 return new DeclaredIdentifier(null, null, e.get$span());
17942 } 17966 }
17943 } 17967 }
17944 Parser.prototype._makeLabel = function(expr) { 17968 lang_Parser.prototype._makeLabel = function(expr) {
17945 if ((expr instanceof VarExpression)) { 17969 if ((expr instanceof VarExpression)) {
17946 return expr.get$name(); 17970 return expr.get$name();
17947 } 17971 }
17948 else { 17972 else {
17949 this._errorExpected('label'); 17973 this._errorExpected('label');
17950 return null; 17974 return null;
17951 } 17975 }
17952 } 17976 }
17953 Parser.prototype.block$0 = function() { 17977 lang_Parser.prototype.block$0 = function() {
17954 return this.block(); 17978 return this.block();
17955 }; 17979 };
17956 // ********** Code for IncompleteSourceException ************** 17980 // ********** Code for IncompleteSourceException **************
17957 function IncompleteSourceException(token) { 17981 function IncompleteSourceException(token) {
17958 this.token = token; 17982 this.token = token;
17959 // Initializers done 17983 // Initializers done
17960 } 17984 }
17961 IncompleteSourceException.prototype.toString = function() { 17985 IncompleteSourceException.prototype.toString = function() {
17962 if (this.token.get$span() == null) return ('Unexpected ' + this.token + ''); 17986 if (this.token.get$span() == null) return ('Unexpected ' + this.token + '');
17963 return $assert_String(this.token.get$span().toMessageString(('Unexpected ' + t his.token + ''))); 17987 return $assert_String(this.token.get$span().toMessageString(('Unexpected ' + t his.token + '')));
17964 } 17988 }
17965 IncompleteSourceException.prototype.toString$0 = function() { 17989 IncompleteSourceException.prototype.toString$0 = function() {
17966 return this.toString(); 17990 return this.toString();
17967 }; 17991 };
17968 // ********** Code for Node ************** 17992 // ********** Code for lang_Node **************
17969 function Node(span) { 17993 function lang_Node(span) {
17970 this.span = span; 17994 this.span = span;
17971 // Initializers done 17995 // Initializers done
17972 } 17996 }
17973 Node.prototype.is$Node = function(){return this;}; 17997 lang_Node.prototype.is$lang_Node = function(){return this;};
17974 Node.prototype.get$span = function() { return this.span; }; 17998 lang_Node.prototype.get$span = function() { return this.span; };
17975 Node.prototype.set$span = function(value) { return this.span = value; }; 17999 lang_Node.prototype.set$span = function(value) { return this.span = value; };
17976 Node.prototype.visit$1 = function($0) { 18000 lang_Node.prototype.visit$1 = function($0) {
17977 return this.visit(($0 && $0.is$TreeVisitor())); 18001 return this.visit(($0 && $0.is$TreeVisitor()));
17978 }; 18002 };
17979 // ********** Code for Definition ************** 18003 // ********** Code for Definition **************
17980 function Definition(span) { 18004 function Definition(span) {
17981 // Initializers done 18005 // Initializers done
17982 Statement.call(this, span); 18006 lang_Statement.call(this, span);
17983 } 18007 }
17984 $inherits(Definition, Statement); 18008 $inherits(Definition, lang_Statement);
17985 Definition.prototype.is$Definition = function(){return this;}; 18009 Definition.prototype.is$Definition = function(){return this;};
17986 Definition.prototype.get$typeParameters = function() { 18010 Definition.prototype.get$typeParameters = function() {
17987 return null; 18011 return null;
17988 } 18012 }
17989 Definition.prototype.get$nativeType = function() { 18013 Definition.prototype.get$nativeType = function() {
17990 return null; 18014 return null;
17991 } 18015 }
17992 // ********** Code for Statement ************** 18016 // ********** Code for lang_Statement **************
17993 function Statement(span) { 18017 function lang_Statement(span) {
17994 // Initializers done 18018 // Initializers done
17995 Node.call(this, span); 18019 lang_Node.call(this, span);
17996 } 18020 }
17997 $inherits(Statement, Node); 18021 $inherits(lang_Statement, lang_Node);
17998 Statement.prototype.is$Statement = function(){return this;}; 18022 lang_Statement.prototype.is$lang_Statement = function(){return this;};
17999 // ********** Code for Expression ************** 18023 // ********** Code for lang_Expression **************
18000 function Expression(span) { 18024 function lang_Expression(span) {
18001 // Initializers done 18025 // Initializers done
18002 Node.call(this, span); 18026 lang_Node.call(this, span);
18003 } 18027 }
18004 $inherits(Expression, Node); 18028 $inherits(lang_Expression, lang_Node);
18005 Expression.prototype.is$Expression = function(){return this;}; 18029 lang_Expression.prototype.is$lang_Expression = function(){return this;};
18006 // ********** Code for TypeReference ************** 18030 // ********** Code for TypeReference **************
18007 function TypeReference(span, type) { 18031 function TypeReference(span, type) {
18008 this.type = type; 18032 this.type = type;
18009 // Initializers done 18033 // Initializers done
18010 Node.call(this, span); 18034 lang_Node.call(this, span);
18011 } 18035 }
18012 $inherits(TypeReference, Node); 18036 $inherits(TypeReference, lang_Node);
18013 TypeReference.prototype.is$TypeReference = function(){return this;}; 18037 TypeReference.prototype.is$TypeReference = function(){return this;};
18014 TypeReference.prototype.get$type = function() { return this.type; }; 18038 TypeReference.prototype.get$type = function() { return this.type; };
18015 TypeReference.prototype.set$type = function(value) { return this.type = value; } ; 18039 TypeReference.prototype.set$type = function(value) { return this.type = value; } ;
18016 TypeReference.prototype.visit = function(visitor) { 18040 TypeReference.prototype.visit = function(visitor) {
18017 return visitor.visitTypeReference(this); 18041 return visitor.visitTypeReference(this);
18018 } 18042 }
18019 TypeReference.prototype.get$isFinal = function() { 18043 TypeReference.prototype.get$isFinal = function() {
18020 return false; 18044 return false;
18021 } 18045 }
18022 TypeReference.prototype.visit$1 = function($0) { 18046 TypeReference.prototype.visit$1 = function($0) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
18123 FunctionDefinition.prototype.visit = function(visitor) { 18147 FunctionDefinition.prototype.visit = function(visitor) {
18124 return visitor.visitFunctionDefinition(this); 18148 return visitor.visitFunctionDefinition(this);
18125 } 18149 }
18126 FunctionDefinition.prototype.visit$1 = function($0) { 18150 FunctionDefinition.prototype.visit$1 = function($0) {
18127 return this.visit(($0 && $0.is$TreeVisitor())); 18151 return this.visit(($0 && $0.is$TreeVisitor()));
18128 }; 18152 };
18129 // ********** Code for ReturnStatement ************** 18153 // ********** Code for ReturnStatement **************
18130 function ReturnStatement(value, span) { 18154 function ReturnStatement(value, span) {
18131 this.value = value; 18155 this.value = value;
18132 // Initializers done 18156 // Initializers done
18133 Statement.call(this, span); 18157 lang_Statement.call(this, span);
18134 } 18158 }
18135 $inherits(ReturnStatement, Statement); 18159 $inherits(ReturnStatement, lang_Statement);
18136 ReturnStatement.prototype.get$value = function() { return this.value; }; 18160 ReturnStatement.prototype.get$value = function() { return this.value; };
18137 ReturnStatement.prototype.set$value = function(value) { return this.value = valu e; }; 18161 ReturnStatement.prototype.set$value = function(value) { return this.value = valu e; };
18138 ReturnStatement.prototype.visit = function(visitor) { 18162 ReturnStatement.prototype.visit = function(visitor) {
18139 return visitor.visitReturnStatement(this); 18163 return visitor.visitReturnStatement(this);
18140 } 18164 }
18141 ReturnStatement.prototype.visit$1 = function($0) { 18165 ReturnStatement.prototype.visit$1 = function($0) {
18142 return this.visit(($0 && $0.is$TreeVisitor())); 18166 return this.visit(($0 && $0.is$TreeVisitor()));
18143 }; 18167 };
18144 // ********** Code for ThrowStatement ************** 18168 // ********** Code for ThrowStatement **************
18145 function ThrowStatement(value, span) { 18169 function ThrowStatement(value, span) {
18146 this.value = value; 18170 this.value = value;
18147 // Initializers done 18171 // Initializers done
18148 Statement.call(this, span); 18172 lang_Statement.call(this, span);
18149 } 18173 }
18150 $inherits(ThrowStatement, Statement); 18174 $inherits(ThrowStatement, lang_Statement);
18151 ThrowStatement.prototype.get$value = function() { return this.value; }; 18175 ThrowStatement.prototype.get$value = function() { return this.value; };
18152 ThrowStatement.prototype.set$value = function(value) { return this.value = value ; }; 18176 ThrowStatement.prototype.set$value = function(value) { return this.value = value ; };
18153 ThrowStatement.prototype.visit = function(visitor) { 18177 ThrowStatement.prototype.visit = function(visitor) {
18154 return visitor.visitThrowStatement(this); 18178 return visitor.visitThrowStatement(this);
18155 } 18179 }
18156 ThrowStatement.prototype.visit$1 = function($0) { 18180 ThrowStatement.prototype.visit$1 = function($0) {
18157 return this.visit(($0 && $0.is$TreeVisitor())); 18181 return this.visit(($0 && $0.is$TreeVisitor()));
18158 }; 18182 };
18159 // ********** Code for AssertStatement ************** 18183 // ********** Code for AssertStatement **************
18160 function AssertStatement(test, span) { 18184 function AssertStatement(test, span) {
18161 this.test = test; 18185 this.test = test;
18162 // Initializers done 18186 // Initializers done
18163 Statement.call(this, span); 18187 lang_Statement.call(this, span);
18164 } 18188 }
18165 $inherits(AssertStatement, Statement); 18189 $inherits(AssertStatement, lang_Statement);
18166 AssertStatement.prototype.visit = function(visitor) { 18190 AssertStatement.prototype.visit = function(visitor) {
18167 return visitor.visitAssertStatement(this); 18191 return visitor.visitAssertStatement(this);
18168 } 18192 }
18169 AssertStatement.prototype.visit$1 = function($0) { 18193 AssertStatement.prototype.visit$1 = function($0) {
18170 return this.visit(($0 && $0.is$TreeVisitor())); 18194 return this.visit(($0 && $0.is$TreeVisitor()));
18171 }; 18195 };
18172 // ********** Code for BreakStatement ************** 18196 // ********** Code for BreakStatement **************
18173 function BreakStatement(label, span) { 18197 function BreakStatement(label, span) {
18174 this.label = label; 18198 this.label = label;
18175 // Initializers done 18199 // Initializers done
18176 Statement.call(this, span); 18200 lang_Statement.call(this, span);
18177 } 18201 }
18178 $inherits(BreakStatement, Statement); 18202 $inherits(BreakStatement, lang_Statement);
18179 BreakStatement.prototype.visit = function(visitor) { 18203 BreakStatement.prototype.visit = function(visitor) {
18180 return visitor.visitBreakStatement(this); 18204 return visitor.visitBreakStatement(this);
18181 } 18205 }
18182 BreakStatement.prototype.visit$1 = function($0) { 18206 BreakStatement.prototype.visit$1 = function($0) {
18183 return this.visit(($0 && $0.is$TreeVisitor())); 18207 return this.visit(($0 && $0.is$TreeVisitor()));
18184 }; 18208 };
18185 // ********** Code for ContinueStatement ************** 18209 // ********** Code for ContinueStatement **************
18186 function ContinueStatement(label, span) { 18210 function ContinueStatement(label, span) {
18187 this.label = label; 18211 this.label = label;
18188 // Initializers done 18212 // Initializers done
18189 Statement.call(this, span); 18213 lang_Statement.call(this, span);
18190 } 18214 }
18191 $inherits(ContinueStatement, Statement); 18215 $inherits(ContinueStatement, lang_Statement);
18192 ContinueStatement.prototype.visit = function(visitor) { 18216 ContinueStatement.prototype.visit = function(visitor) {
18193 return visitor.visitContinueStatement(this); 18217 return visitor.visitContinueStatement(this);
18194 } 18218 }
18195 ContinueStatement.prototype.visit$1 = function($0) { 18219 ContinueStatement.prototype.visit$1 = function($0) {
18196 return this.visit(($0 && $0.is$TreeVisitor())); 18220 return this.visit(($0 && $0.is$TreeVisitor()));
18197 }; 18221 };
18198 // ********** Code for IfStatement ************** 18222 // ********** Code for IfStatement **************
18199 function IfStatement(test, trueBranch, falseBranch, span) { 18223 function IfStatement(test, trueBranch, falseBranch, span) {
18200 this.test = test; 18224 this.test = test;
18201 this.trueBranch = trueBranch; 18225 this.trueBranch = trueBranch;
18202 this.falseBranch = falseBranch; 18226 this.falseBranch = falseBranch;
18203 // Initializers done 18227 // Initializers done
18204 Statement.call(this, span); 18228 lang_Statement.call(this, span);
18205 } 18229 }
18206 $inherits(IfStatement, Statement); 18230 $inherits(IfStatement, lang_Statement);
18207 IfStatement.prototype.visit = function(visitor) { 18231 IfStatement.prototype.visit = function(visitor) {
18208 return visitor.visitIfStatement(this); 18232 return visitor.visitIfStatement(this);
18209 } 18233 }
18210 IfStatement.prototype.visit$1 = function($0) { 18234 IfStatement.prototype.visit$1 = function($0) {
18211 return this.visit(($0 && $0.is$TreeVisitor())); 18235 return this.visit(($0 && $0.is$TreeVisitor()));
18212 }; 18236 };
18213 // ********** Code for WhileStatement ************** 18237 // ********** Code for WhileStatement **************
18214 function WhileStatement(test, body, span) { 18238 function WhileStatement(test, body, span) {
18215 this.test = test; 18239 this.test = test;
18216 this.body = body; 18240 this.body = body;
18217 // Initializers done 18241 // Initializers done
18218 Statement.call(this, span); 18242 lang_Statement.call(this, span);
18219 } 18243 }
18220 $inherits(WhileStatement, Statement); 18244 $inherits(WhileStatement, lang_Statement);
18221 WhileStatement.prototype.visit = function(visitor) { 18245 WhileStatement.prototype.visit = function(visitor) {
18222 return visitor.visitWhileStatement(this); 18246 return visitor.visitWhileStatement(this);
18223 } 18247 }
18224 WhileStatement.prototype.visit$1 = function($0) { 18248 WhileStatement.prototype.visit$1 = function($0) {
18225 return this.visit(($0 && $0.is$TreeVisitor())); 18249 return this.visit(($0 && $0.is$TreeVisitor()));
18226 }; 18250 };
18227 // ********** Code for DoStatement ************** 18251 // ********** Code for DoStatement **************
18228 function DoStatement(body, test, span) { 18252 function DoStatement(body, test, span) {
18229 this.body = body; 18253 this.body = body;
18230 this.test = test; 18254 this.test = test;
18231 // Initializers done 18255 // Initializers done
18232 Statement.call(this, span); 18256 lang_Statement.call(this, span);
18233 } 18257 }
18234 $inherits(DoStatement, Statement); 18258 $inherits(DoStatement, lang_Statement);
18235 DoStatement.prototype.visit = function(visitor) { 18259 DoStatement.prototype.visit = function(visitor) {
18236 return visitor.visitDoStatement(this); 18260 return visitor.visitDoStatement(this);
18237 } 18261 }
18238 DoStatement.prototype.visit$1 = function($0) { 18262 DoStatement.prototype.visit$1 = function($0) {
18239 return this.visit(($0 && $0.is$TreeVisitor())); 18263 return this.visit(($0 && $0.is$TreeVisitor()));
18240 }; 18264 };
18241 // ********** Code for ForStatement ************** 18265 // ********** Code for ForStatement **************
18242 function ForStatement(init, test, step, body, span) { 18266 function ForStatement(init, test, step, body, span) {
18243 this.init = init; 18267 this.init = init;
18244 this.test = test; 18268 this.test = test;
18245 this.step = step; 18269 this.step = step;
18246 this.body = body; 18270 this.body = body;
18247 // Initializers done 18271 // Initializers done
18248 Statement.call(this, span); 18272 lang_Statement.call(this, span);
18249 } 18273 }
18250 $inherits(ForStatement, Statement); 18274 $inherits(ForStatement, lang_Statement);
18251 ForStatement.prototype.visit = function(visitor) { 18275 ForStatement.prototype.visit = function(visitor) {
18252 return visitor.visitForStatement(this); 18276 return visitor.visitForStatement(this);
18253 } 18277 }
18254 ForStatement.prototype.visit$1 = function($0) { 18278 ForStatement.prototype.visit$1 = function($0) {
18255 return this.visit(($0 && $0.is$TreeVisitor())); 18279 return this.visit(($0 && $0.is$TreeVisitor()));
18256 }; 18280 };
18257 // ********** Code for ForInStatement ************** 18281 // ********** Code for ForInStatement **************
18258 function ForInStatement(item, list, body, span) { 18282 function ForInStatement(item, list, body, span) {
18259 this.item = item; 18283 this.item = item;
18260 this.list = list; 18284 this.list = list;
18261 this.body = body; 18285 this.body = body;
18262 // Initializers done 18286 // Initializers done
18263 Statement.call(this, span); 18287 lang_Statement.call(this, span);
18264 } 18288 }
18265 $inherits(ForInStatement, Statement); 18289 $inherits(ForInStatement, lang_Statement);
18266 ForInStatement.prototype.visit = function(visitor) { 18290 ForInStatement.prototype.visit = function(visitor) {
18267 return visitor.visitForInStatement(this); 18291 return visitor.visitForInStatement(this);
18268 } 18292 }
18269 ForInStatement.prototype.visit$1 = function($0) { 18293 ForInStatement.prototype.visit$1 = function($0) {
18270 return this.visit(($0 && $0.is$TreeVisitor())); 18294 return this.visit(($0 && $0.is$TreeVisitor()));
18271 }; 18295 };
18272 // ********** Code for TryStatement ************** 18296 // ********** Code for TryStatement **************
18273 function TryStatement(body, catches, finallyBlock, span) { 18297 function TryStatement(body, catches, finallyBlock, span) {
18274 this.body = body; 18298 this.body = body;
18275 this.catches = catches; 18299 this.catches = catches;
18276 this.finallyBlock = finallyBlock; 18300 this.finallyBlock = finallyBlock;
18277 // Initializers done 18301 // Initializers done
18278 Statement.call(this, span); 18302 lang_Statement.call(this, span);
18279 } 18303 }
18280 $inherits(TryStatement, Statement); 18304 $inherits(TryStatement, lang_Statement);
18281 TryStatement.prototype.visit = function(visitor) { 18305 TryStatement.prototype.visit = function(visitor) {
18282 return visitor.visitTryStatement(this); 18306 return visitor.visitTryStatement(this);
18283 } 18307 }
18284 TryStatement.prototype.visit$1 = function($0) { 18308 TryStatement.prototype.visit$1 = function($0) {
18285 return this.visit(($0 && $0.is$TreeVisitor())); 18309 return this.visit(($0 && $0.is$TreeVisitor()));
18286 }; 18310 };
18287 // ********** Code for SwitchStatement ************** 18311 // ********** Code for SwitchStatement **************
18288 function SwitchStatement(test, cases, span) { 18312 function SwitchStatement(test, cases, span) {
18289 this.test = test; 18313 this.test = test;
18290 this.cases = cases; 18314 this.cases = cases;
18291 // Initializers done 18315 // Initializers done
18292 Statement.call(this, span); 18316 lang_Statement.call(this, span);
18293 } 18317 }
18294 $inherits(SwitchStatement, Statement); 18318 $inherits(SwitchStatement, lang_Statement);
18295 SwitchStatement.prototype.visit = function(visitor) { 18319 SwitchStatement.prototype.visit = function(visitor) {
18296 return visitor.visitSwitchStatement(this); 18320 return visitor.visitSwitchStatement(this);
18297 } 18321 }
18298 SwitchStatement.prototype.visit$1 = function($0) { 18322 SwitchStatement.prototype.visit$1 = function($0) {
18299 return this.visit(($0 && $0.is$TreeVisitor())); 18323 return this.visit(($0 && $0.is$TreeVisitor()));
18300 }; 18324 };
18301 // ********** Code for BlockStatement ************** 18325 // ********** Code for BlockStatement **************
18302 function BlockStatement(body, span) { 18326 function BlockStatement(body, span) {
18303 this.body = body; 18327 this.body = body;
18304 // Initializers done 18328 // Initializers done
18305 Statement.call(this, span); 18329 lang_Statement.call(this, span);
18306 } 18330 }
18307 $inherits(BlockStatement, Statement); 18331 $inherits(BlockStatement, lang_Statement);
18308 BlockStatement.prototype.is$BlockStatement = function(){return this;}; 18332 BlockStatement.prototype.is$BlockStatement = function(){return this;};
18309 BlockStatement.prototype.visit = function(visitor) { 18333 BlockStatement.prototype.visit = function(visitor) {
18310 return visitor.visitBlockStatement(this); 18334 return visitor.visitBlockStatement(this);
18311 } 18335 }
18312 BlockStatement.prototype.visit$1 = function($0) { 18336 BlockStatement.prototype.visit$1 = function($0) {
18313 return this.visit(($0 && $0.is$TreeVisitor())); 18337 return this.visit(($0 && $0.is$TreeVisitor()));
18314 }; 18338 };
18315 // ********** Code for LabeledStatement ************** 18339 // ********** Code for LabeledStatement **************
18316 function LabeledStatement(name, body, span) { 18340 function LabeledStatement(name, body, span) {
18317 this.name = name; 18341 this.name = name;
18318 this.body = body; 18342 this.body = body;
18319 // Initializers done 18343 // Initializers done
18320 Statement.call(this, span); 18344 lang_Statement.call(this, span);
18321 } 18345 }
18322 $inherits(LabeledStatement, Statement); 18346 $inherits(LabeledStatement, lang_Statement);
18323 LabeledStatement.prototype.get$name = function() { return this.name; }; 18347 LabeledStatement.prototype.get$name = function() { return this.name; };
18324 LabeledStatement.prototype.set$name = function(value) { return this.name = value ; }; 18348 LabeledStatement.prototype.set$name = function(value) { return this.name = value ; };
18325 LabeledStatement.prototype.visit = function(visitor) { 18349 LabeledStatement.prototype.visit = function(visitor) {
18326 return visitor.visitLabeledStatement(this); 18350 return visitor.visitLabeledStatement(this);
18327 } 18351 }
18328 LabeledStatement.prototype.visit$1 = function($0) { 18352 LabeledStatement.prototype.visit$1 = function($0) {
18329 return this.visit(($0 && $0.is$TreeVisitor())); 18353 return this.visit(($0 && $0.is$TreeVisitor()));
18330 }; 18354 };
18331 // ********** Code for ExpressionStatement ************** 18355 // ********** Code for lang_ExpressionStatement **************
18332 function ExpressionStatement(body, span) { 18356 function lang_ExpressionStatement(body, span) {
18333 this.body = body; 18357 this.body = body;
18334 // Initializers done 18358 // Initializers done
18335 Statement.call(this, span); 18359 lang_Statement.call(this, span);
18336 } 18360 }
18337 $inherits(ExpressionStatement, Statement); 18361 $inherits(lang_ExpressionStatement, lang_Statement);
18338 ExpressionStatement.prototype.visit = function(visitor) { 18362 lang_ExpressionStatement.prototype.visit = function(visitor) {
18339 return visitor.visitExpressionStatement(this); 18363 return visitor.visitExpressionStatement(this);
18340 } 18364 }
18341 ExpressionStatement.prototype.visit$1 = function($0) { 18365 lang_ExpressionStatement.prototype.visit$1 = function($0) {
18342 return this.visit(($0 && $0.is$TreeVisitor())); 18366 return this.visit(($0 && $0.is$TreeVisitor()));
18343 }; 18367 };
18344 // ********** Code for EmptyStatement ************** 18368 // ********** Code for EmptyStatement **************
18345 function EmptyStatement(span) { 18369 function EmptyStatement(span) {
18346 // Initializers done 18370 // Initializers done
18347 Statement.call(this, span); 18371 lang_Statement.call(this, span);
18348 } 18372 }
18349 $inherits(EmptyStatement, Statement); 18373 $inherits(EmptyStatement, lang_Statement);
18350 EmptyStatement.prototype.visit = function(visitor) { 18374 EmptyStatement.prototype.visit = function(visitor) {
18351 return visitor.visitEmptyStatement(this); 18375 return visitor.visitEmptyStatement(this);
18352 } 18376 }
18353 EmptyStatement.prototype.visit$1 = function($0) { 18377 EmptyStatement.prototype.visit$1 = function($0) {
18354 return this.visit(($0 && $0.is$TreeVisitor())); 18378 return this.visit(($0 && $0.is$TreeVisitor()));
18355 }; 18379 };
18356 // ********** Code for DietStatement ************** 18380 // ********** Code for DietStatement **************
18357 function DietStatement(span) { 18381 function DietStatement(span) {
18358 // Initializers done 18382 // Initializers done
18359 Statement.call(this, span); 18383 lang_Statement.call(this, span);
18360 } 18384 }
18361 $inherits(DietStatement, Statement); 18385 $inherits(DietStatement, lang_Statement);
18362 DietStatement.prototype.visit = function(visitor) { 18386 DietStatement.prototype.visit = function(visitor) {
18363 return visitor.visitDietStatement(this); 18387 return visitor.visitDietStatement(this);
18364 } 18388 }
18365 DietStatement.prototype.visit$1 = function($0) { 18389 DietStatement.prototype.visit$1 = function($0) {
18366 return this.visit(($0 && $0.is$TreeVisitor())); 18390 return this.visit(($0 && $0.is$TreeVisitor()));
18367 }; 18391 };
18368 // ********** Code for NativeStatement ************** 18392 // ********** Code for NativeStatement **************
18369 function NativeStatement(body, span) { 18393 function NativeStatement(body, span) {
18370 this.body = body; 18394 this.body = body;
18371 // Initializers done 18395 // Initializers done
18372 Statement.call(this, span); 18396 lang_Statement.call(this, span);
18373 } 18397 }
18374 $inherits(NativeStatement, Statement); 18398 $inherits(NativeStatement, lang_Statement);
18375 NativeStatement.prototype.visit = function(visitor) { 18399 NativeStatement.prototype.visit = function(visitor) {
18376 return visitor.visitNativeStatement(this); 18400 return visitor.visitNativeStatement(this);
18377 } 18401 }
18378 NativeStatement.prototype.visit$1 = function($0) { 18402 NativeStatement.prototype.visit$1 = function($0) {
18379 return this.visit(($0 && $0.is$TreeVisitor())); 18403 return this.visit(($0 && $0.is$TreeVisitor()));
18380 }; 18404 };
18381 // ********** Code for LambdaExpression ************** 18405 // ********** Code for LambdaExpression **************
18382 function LambdaExpression(func, span) { 18406 function LambdaExpression(func, span) {
18383 this.func = func; 18407 this.func = func;
18384 // Initializers done 18408 // Initializers done
18385 Expression.call(this, span); 18409 lang_Expression.call(this, span);
18386 } 18410 }
18387 $inherits(LambdaExpression, Expression); 18411 $inherits(LambdaExpression, lang_Expression);
18388 LambdaExpression.prototype.is$LambdaExpression = function(){return this;}; 18412 LambdaExpression.prototype.is$LambdaExpression = function(){return this;};
18389 LambdaExpression.prototype.visit = function(visitor) { 18413 LambdaExpression.prototype.visit = function(visitor) {
18390 return visitor.visitLambdaExpression(this); 18414 return visitor.visitLambdaExpression(this);
18391 } 18415 }
18392 LambdaExpression.prototype.visit$1 = function($0) { 18416 LambdaExpression.prototype.visit$1 = function($0) {
18393 return this.visit(($0 && $0.is$TreeVisitor())); 18417 return this.visit(($0 && $0.is$TreeVisitor()));
18394 }; 18418 };
18395 // ********** Code for CallExpression ************** 18419 // ********** Code for CallExpression **************
18396 function CallExpression(target, arguments, span) { 18420 function CallExpression(target, arguments, span) {
18397 this.target = target; 18421 this.target = target;
18398 this.arguments = arguments; 18422 this.arguments = arguments;
18399 // Initializers done 18423 // Initializers done
18400 Expression.call(this, span); 18424 lang_Expression.call(this, span);
18401 } 18425 }
18402 $inherits(CallExpression, Expression); 18426 $inherits(CallExpression, lang_Expression);
18403 CallExpression.prototype.is$CallExpression = function(){return this;}; 18427 CallExpression.prototype.is$CallExpression = function(){return this;};
18404 CallExpression.prototype.get$arguments = function() { return this.arguments; }; 18428 CallExpression.prototype.get$arguments = function() { return this.arguments; };
18405 CallExpression.prototype.set$arguments = function(value) { return this.arguments = value; }; 18429 CallExpression.prototype.set$arguments = function(value) { return this.arguments = value; };
18406 CallExpression.prototype.visit = function(visitor) { 18430 CallExpression.prototype.visit = function(visitor) {
18407 return visitor.visitCallExpression(this); 18431 return visitor.visitCallExpression(this);
18408 } 18432 }
18409 CallExpression.prototype.visit$1 = function($0) { 18433 CallExpression.prototype.visit$1 = function($0) {
18410 return this.visit(($0 && $0.is$TreeVisitor())); 18434 return this.visit(($0 && $0.is$TreeVisitor()));
18411 }; 18435 };
18412 // ********** Code for IndexExpression ************** 18436 // ********** Code for IndexExpression **************
18413 function IndexExpression(target, index, span) { 18437 function IndexExpression(target, index, span) {
18414 this.target = target; 18438 this.target = target;
18415 this.index = index; 18439 this.index = index;
18416 // Initializers done 18440 // Initializers done
18417 Expression.call(this, span); 18441 lang_Expression.call(this, span);
18418 } 18442 }
18419 $inherits(IndexExpression, Expression); 18443 $inherits(IndexExpression, lang_Expression);
18420 IndexExpression.prototype.is$IndexExpression = function(){return this;}; 18444 IndexExpression.prototype.is$IndexExpression = function(){return this;};
18421 IndexExpression.prototype.visit = function(visitor) { 18445 IndexExpression.prototype.visit = function(visitor) {
18422 return visitor.visitIndexExpression(this); 18446 return visitor.visitIndexExpression(this);
18423 } 18447 }
18424 IndexExpression.prototype.visit$1 = function($0) { 18448 IndexExpression.prototype.visit$1 = function($0) {
18425 return this.visit(($0 && $0.is$TreeVisitor())); 18449 return this.visit(($0 && $0.is$TreeVisitor()));
18426 }; 18450 };
18427 // ********** Code for BinaryExpression ************** 18451 // ********** Code for BinaryExpression **************
18428 function BinaryExpression(op, x, y, span) { 18452 function BinaryExpression(op, x, y, span) {
18429 this.op = op; 18453 this.op = op;
18430 this.x = x; 18454 this.x = x;
18431 this.y = y; 18455 this.y = y;
18432 // Initializers done 18456 // Initializers done
18433 Expression.call(this, span); 18457 lang_Expression.call(this, span);
18434 } 18458 }
18435 $inherits(BinaryExpression, Expression); 18459 $inherits(BinaryExpression, lang_Expression);
18436 BinaryExpression.prototype.is$BinaryExpression = function(){return this;}; 18460 BinaryExpression.prototype.is$BinaryExpression = function(){return this;};
18437 BinaryExpression.prototype.visit = function(visitor) { 18461 BinaryExpression.prototype.visit = function(visitor) {
18438 return visitor.visitBinaryExpression(this); 18462 return visitor.visitBinaryExpression(this);
18439 } 18463 }
18440 BinaryExpression.prototype.visit$1 = function($0) { 18464 BinaryExpression.prototype.visit$1 = function($0) {
18441 return this.visit(($0 && $0.is$TreeVisitor())); 18465 return this.visit(($0 && $0.is$TreeVisitor()));
18442 }; 18466 };
18443 // ********** Code for UnaryExpression ************** 18467 // ********** Code for UnaryExpression **************
18444 function UnaryExpression(op, self, span) { 18468 function UnaryExpression(op, self, span) {
18445 this.op = op; 18469 this.op = op;
18446 this.self = self; 18470 this.self = self;
18447 // Initializers done 18471 // Initializers done
18448 Expression.call(this, span); 18472 lang_Expression.call(this, span);
18449 } 18473 }
18450 $inherits(UnaryExpression, Expression); 18474 $inherits(UnaryExpression, lang_Expression);
18475 UnaryExpression.prototype.is$UnaryExpression = function(){return this;};
18451 UnaryExpression.prototype.visit = function(visitor) { 18476 UnaryExpression.prototype.visit = function(visitor) {
18452 return visitor.visitUnaryExpression(this); 18477 return visitor.visitUnaryExpression(this);
18453 } 18478 }
18454 UnaryExpression.prototype.visit$1 = function($0) { 18479 UnaryExpression.prototype.visit$1 = function($0) {
18455 return this.visit(($0 && $0.is$TreeVisitor())); 18480 return this.visit(($0 && $0.is$TreeVisitor()));
18456 }; 18481 };
18457 // ********** Code for PostfixExpression ************** 18482 // ********** Code for PostfixExpression **************
18458 function PostfixExpression(body, op, span) { 18483 function PostfixExpression(body, op, span) {
18459 this.body = body; 18484 this.body = body;
18460 this.op = op; 18485 this.op = op;
18461 // Initializers done 18486 // Initializers done
18462 Expression.call(this, span); 18487 lang_Expression.call(this, span);
18463 } 18488 }
18464 $inherits(PostfixExpression, Expression); 18489 $inherits(PostfixExpression, lang_Expression);
18465 PostfixExpression.prototype.is$PostfixExpression = function(){return this;}; 18490 PostfixExpression.prototype.is$PostfixExpression = function(){return this;};
18466 PostfixExpression.prototype.visit = function(visitor) { 18491 PostfixExpression.prototype.visit = function(visitor) {
18467 return visitor.visitPostfixExpression$1(this); 18492 return visitor.visitPostfixExpression$1(this);
18468 } 18493 }
18469 PostfixExpression.prototype.visit$1 = function($0) { 18494 PostfixExpression.prototype.visit$1 = function($0) {
18470 return this.visit(($0 && $0.is$TreeVisitor())); 18495 return this.visit(($0 && $0.is$TreeVisitor()));
18471 }; 18496 };
18472 // ********** Code for NewExpression ************** 18497 // ********** Code for lang_NewExpression **************
18473 function NewExpression(isConst, type, name, arguments, span) { 18498 function lang_NewExpression(isConst, type, name, arguments, span) {
18474 this.isConst = isConst; 18499 this.isConst = isConst;
18475 this.type = type; 18500 this.type = type;
18476 this.name = name; 18501 this.name = name;
18477 this.arguments = arguments; 18502 this.arguments = arguments;
18478 // Initializers done 18503 // Initializers done
18479 Expression.call(this, span); 18504 lang_Expression.call(this, span);
18480 } 18505 }
18481 $inherits(NewExpression, Expression); 18506 $inherits(lang_NewExpression, lang_Expression);
18482 NewExpression.prototype.get$isConst = function() { return this.isConst; }; 18507 lang_NewExpression.prototype.get$isConst = function() { return this.isConst; };
18483 NewExpression.prototype.set$isConst = function(value) { return this.isConst = va lue; }; 18508 lang_NewExpression.prototype.set$isConst = function(value) { return this.isConst = value; };
18484 NewExpression.prototype.get$type = function() { return this.type; }; 18509 lang_NewExpression.prototype.get$type = function() { return this.type; };
18485 NewExpression.prototype.set$type = function(value) { return this.type = value; } ; 18510 lang_NewExpression.prototype.set$type = function(value) { return this.type = val ue; };
18486 NewExpression.prototype.get$name = function() { return this.name; }; 18511 lang_NewExpression.prototype.get$name = function() { return this.name; };
18487 NewExpression.prototype.set$name = function(value) { return this.name = value; } ; 18512 lang_NewExpression.prototype.set$name = function(value) { return this.name = val ue; };
18488 NewExpression.prototype.get$arguments = function() { return this.arguments; }; 18513 lang_NewExpression.prototype.get$arguments = function() { return this.arguments; };
18489 NewExpression.prototype.set$arguments = function(value) { return this.arguments = value; }; 18514 lang_NewExpression.prototype.set$arguments = function(value) { return this.argum ents = value; };
18490 NewExpression.prototype.visit = function(visitor) { 18515 lang_NewExpression.prototype.visit = function(visitor) {
18491 return visitor.visitNewExpression(this); 18516 return visitor.visitNewExpression(this);
18492 } 18517 }
18493 NewExpression.prototype.visit$1 = function($0) { 18518 lang_NewExpression.prototype.visit$1 = function($0) {
18494 return this.visit(($0 && $0.is$TreeVisitor())); 18519 return this.visit(($0 && $0.is$TreeVisitor()));
18495 }; 18520 };
18496 // ********** Code for ListExpression ************** 18521 // ********** Code for ListExpression **************
18497 function ListExpression(isConst, type, values, span) { 18522 function ListExpression(isConst, type, values, span) {
18498 this.isConst = isConst; 18523 this.isConst = isConst;
18499 this.type = type; 18524 this.type = type;
18500 this.values = values; 18525 this.values = values;
18501 // Initializers done 18526 // Initializers done
18502 Expression.call(this, span); 18527 lang_Expression.call(this, span);
18503 } 18528 }
18504 $inherits(ListExpression, Expression); 18529 $inherits(ListExpression, lang_Expression);
18505 ListExpression.prototype.get$isConst = function() { return this.isConst; }; 18530 ListExpression.prototype.get$isConst = function() { return this.isConst; };
18506 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v alue; }; 18531 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v alue; };
18507 ListExpression.prototype.get$type = function() { return this.type; }; 18532 ListExpression.prototype.get$type = function() { return this.type; };
18508 ListExpression.prototype.set$type = function(value) { return this.type = value; }; 18533 ListExpression.prototype.set$type = function(value) { return this.type = value; };
18509 ListExpression.prototype.visit = function(visitor) { 18534 ListExpression.prototype.visit = function(visitor) {
18510 return visitor.visitListExpression(this); 18535 return visitor.visitListExpression(this);
18511 } 18536 }
18512 ListExpression.prototype.visit$1 = function($0) { 18537 ListExpression.prototype.visit$1 = function($0) {
18513 return this.visit(($0 && $0.is$TreeVisitor())); 18538 return this.visit(($0 && $0.is$TreeVisitor()));
18514 }; 18539 };
18515 // ********** Code for MapExpression ************** 18540 // ********** Code for MapExpression **************
18516 function MapExpression(isConst, type, items, span) { 18541 function MapExpression(isConst, type, items, span) {
18517 this.isConst = isConst; 18542 this.isConst = isConst;
18518 this.type = type; 18543 this.type = type;
18519 this.items = items; 18544 this.items = items;
18520 // Initializers done 18545 // Initializers done
18521 Expression.call(this, span); 18546 lang_Expression.call(this, span);
18522 } 18547 }
18523 $inherits(MapExpression, Expression); 18548 $inherits(MapExpression, lang_Expression);
18524 MapExpression.prototype.get$isConst = function() { return this.isConst; }; 18549 MapExpression.prototype.get$isConst = function() { return this.isConst; };
18525 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va lue; }; 18550 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va lue; };
18526 MapExpression.prototype.get$type = function() { return this.type; }; 18551 MapExpression.prototype.get$type = function() { return this.type; };
18527 MapExpression.prototype.set$type = function(value) { return this.type = value; } ; 18552 MapExpression.prototype.set$type = function(value) { return this.type = value; } ;
18528 MapExpression.prototype.visit = function(visitor) { 18553 MapExpression.prototype.visit = function(visitor) {
18529 return visitor.visitMapExpression(this); 18554 return visitor.visitMapExpression(this);
18530 } 18555 }
18531 MapExpression.prototype.visit$1 = function($0) { 18556 MapExpression.prototype.visit$1 = function($0) {
18532 return this.visit(($0 && $0.is$TreeVisitor())); 18557 return this.visit(($0 && $0.is$TreeVisitor()));
18533 }; 18558 };
18534 // ********** Code for ConditionalExpression ************** 18559 // ********** Code for ConditionalExpression **************
18535 function ConditionalExpression(test, trueBranch, falseBranch, span) { 18560 function ConditionalExpression(test, trueBranch, falseBranch, span) {
18536 this.test = test; 18561 this.test = test;
18537 this.trueBranch = trueBranch; 18562 this.trueBranch = trueBranch;
18538 this.falseBranch = falseBranch; 18563 this.falseBranch = falseBranch;
18539 // Initializers done 18564 // Initializers done
18540 Expression.call(this, span); 18565 lang_Expression.call(this, span);
18541 } 18566 }
18542 $inherits(ConditionalExpression, Expression); 18567 $inherits(ConditionalExpression, lang_Expression);
18543 ConditionalExpression.prototype.visit = function(visitor) { 18568 ConditionalExpression.prototype.visit = function(visitor) {
18544 return visitor.visitConditionalExpression(this); 18569 return visitor.visitConditionalExpression(this);
18545 } 18570 }
18546 ConditionalExpression.prototype.visit$1 = function($0) { 18571 ConditionalExpression.prototype.visit$1 = function($0) {
18547 return this.visit(($0 && $0.is$TreeVisitor())); 18572 return this.visit(($0 && $0.is$TreeVisitor()));
18548 }; 18573 };
18549 // ********** Code for IsExpression ************** 18574 // ********** Code for IsExpression **************
18550 function IsExpression(isTrue, x, type, span) { 18575 function IsExpression(isTrue, x, type, span) {
18551 this.isTrue = isTrue; 18576 this.isTrue = isTrue;
18552 this.x = x; 18577 this.x = x;
18553 this.type = type; 18578 this.type = type;
18554 // Initializers done 18579 // Initializers done
18555 Expression.call(this, span); 18580 lang_Expression.call(this, span);
18556 } 18581 }
18557 $inherits(IsExpression, Expression); 18582 $inherits(IsExpression, lang_Expression);
18558 IsExpression.prototype.get$type = function() { return this.type; }; 18583 IsExpression.prototype.get$type = function() { return this.type; };
18559 IsExpression.prototype.set$type = function(value) { return this.type = value; }; 18584 IsExpression.prototype.set$type = function(value) { return this.type = value; };
18560 IsExpression.prototype.visit = function(visitor) { 18585 IsExpression.prototype.visit = function(visitor) {
18561 return visitor.visitIsExpression(this); 18586 return visitor.visitIsExpression(this);
18562 } 18587 }
18563 IsExpression.prototype.visit$1 = function($0) { 18588 IsExpression.prototype.visit$1 = function($0) {
18564 return this.visit(($0 && $0.is$TreeVisitor())); 18589 return this.visit(($0 && $0.is$TreeVisitor()));
18565 }; 18590 };
18566 // ********** Code for ParenExpression ************** 18591 // ********** Code for ParenExpression **************
18567 function ParenExpression(body, span) { 18592 function ParenExpression(body, span) {
18568 this.body = body; 18593 this.body = body;
18569 // Initializers done 18594 // Initializers done
18570 Expression.call(this, span); 18595 lang_Expression.call(this, span);
18571 } 18596 }
18572 $inherits(ParenExpression, Expression); 18597 $inherits(ParenExpression, lang_Expression);
18573 ParenExpression.prototype.visit = function(visitor) { 18598 ParenExpression.prototype.visit = function(visitor) {
18574 return visitor.visitParenExpression(this); 18599 return visitor.visitParenExpression(this);
18575 } 18600 }
18576 ParenExpression.prototype.visit$1 = function($0) { 18601 ParenExpression.prototype.visit$1 = function($0) {
18577 return this.visit(($0 && $0.is$TreeVisitor())); 18602 return this.visit(($0 && $0.is$TreeVisitor()));
18578 }; 18603 };
18579 // ********** Code for DotExpression ************** 18604 // ********** Code for DotExpression **************
18580 function DotExpression(self, name, span) { 18605 function DotExpression(self, name, span) {
18581 this.self = self; 18606 this.self = self;
18582 this.name = name; 18607 this.name = name;
18583 // Initializers done 18608 // Initializers done
18584 Expression.call(this, span); 18609 lang_Expression.call(this, span);
18585 } 18610 }
18586 $inherits(DotExpression, Expression); 18611 $inherits(DotExpression, lang_Expression);
18587 DotExpression.prototype.is$DotExpression = function(){return this;}; 18612 DotExpression.prototype.is$DotExpression = function(){return this;};
18588 DotExpression.prototype.get$name = function() { return this.name; }; 18613 DotExpression.prototype.get$name = function() { return this.name; };
18589 DotExpression.prototype.set$name = function(value) { return this.name = value; } ; 18614 DotExpression.prototype.set$name = function(value) { return this.name = value; } ;
18590 DotExpression.prototype.visit = function(visitor) { 18615 DotExpression.prototype.visit = function(visitor) {
18591 return visitor.visitDotExpression(this); 18616 return visitor.visitDotExpression(this);
18592 } 18617 }
18593 DotExpression.prototype.visit$1 = function($0) { 18618 DotExpression.prototype.visit$1 = function($0) {
18594 return this.visit(($0 && $0.is$TreeVisitor())); 18619 return this.visit(($0 && $0.is$TreeVisitor()));
18595 }; 18620 };
18596 // ********** Code for VarExpression ************** 18621 // ********** Code for VarExpression **************
18597 function VarExpression(name, span) { 18622 function VarExpression(name, span) {
18598 this.name = name; 18623 this.name = name;
18599 // Initializers done 18624 // Initializers done
18600 Expression.call(this, span); 18625 lang_Expression.call(this, span);
18601 } 18626 }
18602 $inherits(VarExpression, Expression); 18627 $inherits(VarExpression, lang_Expression);
18603 VarExpression.prototype.is$VarExpression = function(){return this;}; 18628 VarExpression.prototype.is$VarExpression = function(){return this;};
18604 VarExpression.prototype.get$name = function() { return this.name; }; 18629 VarExpression.prototype.get$name = function() { return this.name; };
18605 VarExpression.prototype.set$name = function(value) { return this.name = value; } ; 18630 VarExpression.prototype.set$name = function(value) { return this.name = value; } ;
18606 VarExpression.prototype.visit = function(visitor) { 18631 VarExpression.prototype.visit = function(visitor) {
18607 return visitor.visitVarExpression(this); 18632 return visitor.visitVarExpression(this);
18608 } 18633 }
18609 VarExpression.prototype.visit$1 = function($0) { 18634 VarExpression.prototype.visit$1 = function($0) {
18610 return this.visit(($0 && $0.is$TreeVisitor())); 18635 return this.visit(($0 && $0.is$TreeVisitor()));
18611 }; 18636 };
18612 // ********** Code for ThisExpression ************** 18637 // ********** Code for ThisExpression **************
18613 function ThisExpression(span) { 18638 function ThisExpression(span) {
18614 // Initializers done 18639 // Initializers done
18615 Expression.call(this, span); 18640 lang_Expression.call(this, span);
18616 } 18641 }
18617 $inherits(ThisExpression, Expression); 18642 $inherits(ThisExpression, lang_Expression);
18618 ThisExpression.prototype.visit = function(visitor) { 18643 ThisExpression.prototype.visit = function(visitor) {
18619 return visitor.visitThisExpression(this); 18644 return visitor.visitThisExpression(this);
18620 } 18645 }
18621 ThisExpression.prototype.visit$1 = function($0) { 18646 ThisExpression.prototype.visit$1 = function($0) {
18622 return this.visit(($0 && $0.is$TreeVisitor())); 18647 return this.visit(($0 && $0.is$TreeVisitor()));
18623 }; 18648 };
18624 // ********** Code for SuperExpression ************** 18649 // ********** Code for SuperExpression **************
18625 function SuperExpression(span) { 18650 function SuperExpression(span) {
18626 // Initializers done 18651 // Initializers done
18627 Expression.call(this, span); 18652 lang_Expression.call(this, span);
18628 } 18653 }
18629 $inherits(SuperExpression, Expression); 18654 $inherits(SuperExpression, lang_Expression);
18630 SuperExpression.prototype.visit = function(visitor) { 18655 SuperExpression.prototype.visit = function(visitor) {
18631 return visitor.visitSuperExpression(this); 18656 return visitor.visitSuperExpression(this);
18632 } 18657 }
18633 SuperExpression.prototype.visit$1 = function($0) { 18658 SuperExpression.prototype.visit$1 = function($0) {
18634 return this.visit(($0 && $0.is$TreeVisitor())); 18659 return this.visit(($0 && $0.is$TreeVisitor()));
18635 }; 18660 };
18636 // ********** Code for NullExpression ************** 18661 // ********** Code for NullExpression **************
18637 function NullExpression(span) { 18662 function NullExpression(span) {
18638 // Initializers done 18663 // Initializers done
18639 Expression.call(this, span); 18664 lang_Expression.call(this, span);
18640 } 18665 }
18641 $inherits(NullExpression, Expression); 18666 $inherits(NullExpression, lang_Expression);
18642 NullExpression.prototype.visit = function(visitor) { 18667 NullExpression.prototype.visit = function(visitor) {
18643 return visitor.visitNullExpression(this); 18668 return visitor.visitNullExpression(this);
18644 } 18669 }
18645 NullExpression.prototype.visit$1 = function($0) { 18670 NullExpression.prototype.visit$1 = function($0) {
18646 return this.visit(($0 && $0.is$TreeVisitor())); 18671 return this.visit(($0 && $0.is$TreeVisitor()));
18647 }; 18672 };
18648 // ********** Code for LiteralExpression ************** 18673 // ********** Code for LiteralExpression **************
18649 function LiteralExpression(value, type, text, span) { 18674 function LiteralExpression(value, type, text, span) {
18650 this.value = value; 18675 this.value = value;
18651 this.type = type; 18676 this.type = type;
18652 this.text = text; 18677 this.text = text;
18653 // Initializers done 18678 // Initializers done
18654 Expression.call(this, span); 18679 lang_Expression.call(this, span);
18655 } 18680 }
18656 $inherits(LiteralExpression, Expression); 18681 $inherits(LiteralExpression, lang_Expression);
18657 LiteralExpression.prototype.get$value = function() { return this.value; }; 18682 LiteralExpression.prototype.get$value = function() { return this.value; };
18658 LiteralExpression.prototype.set$value = function(value) { return this.value = va lue; }; 18683 LiteralExpression.prototype.set$value = function(value) { return this.value = va lue; };
18659 LiteralExpression.prototype.get$type = function() { return this.type; }; 18684 LiteralExpression.prototype.get$type = function() { return this.type; };
18660 LiteralExpression.prototype.set$type = function(value) { return this.type = valu e; }; 18685 LiteralExpression.prototype.set$type = function(value) { return this.type = valu e; };
18661 LiteralExpression.prototype.get$text = function() { return this.text; }; 18686 LiteralExpression.prototype.get$text = function() { return this.text; };
18662 LiteralExpression.prototype.set$text = function(value) { return this.text = valu e; }; 18687 LiteralExpression.prototype.set$text = function(value) { return this.text = valu e; };
18663 LiteralExpression.prototype.visit = function(visitor) { 18688 LiteralExpression.prototype.visit = function(visitor) {
18664 return visitor.visitLiteralExpression(this); 18689 return visitor.visitLiteralExpression(this);
18665 } 18690 }
18666 LiteralExpression.prototype.visit$1 = function($0) { 18691 LiteralExpression.prototype.visit$1 = function($0) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
18717 return visitor.visitFunctionTypeReference(this); 18742 return visitor.visitFunctionTypeReference(this);
18718 } 18743 }
18719 FunctionTypeReference.prototype.visit$1 = function($0) { 18744 FunctionTypeReference.prototype.visit$1 = function($0) {
18720 return this.visit(($0 && $0.is$TreeVisitor())); 18745 return this.visit(($0 && $0.is$TreeVisitor()));
18721 }; 18746 };
18722 // ********** Code for ArgumentNode ************** 18747 // ********** Code for ArgumentNode **************
18723 function ArgumentNode(label, value, span) { 18748 function ArgumentNode(label, value, span) {
18724 this.label = label; 18749 this.label = label;
18725 this.value = value; 18750 this.value = value;
18726 // Initializers done 18751 // Initializers done
18727 Node.call(this, span); 18752 lang_Node.call(this, span);
18728 } 18753 }
18729 $inherits(ArgumentNode, Node); 18754 $inherits(ArgumentNode, lang_Node);
18730 ArgumentNode.prototype.is$ArgumentNode = function(){return this;}; 18755 ArgumentNode.prototype.is$ArgumentNode = function(){return this;};
18731 ArgumentNode.prototype.get$value = function() { return this.value; }; 18756 ArgumentNode.prototype.get$value = function() { return this.value; };
18732 ArgumentNode.prototype.set$value = function(value) { return this.value = value; }; 18757 ArgumentNode.prototype.set$value = function(value) { return this.value = value; };
18733 ArgumentNode.prototype.visit = function(visitor) { 18758 ArgumentNode.prototype.visit = function(visitor) {
18734 return visitor.visitArgumentNode(this); 18759 return visitor.visitArgumentNode(this);
18735 } 18760 }
18736 ArgumentNode.prototype.visit$1 = function($0) { 18761 ArgumentNode.prototype.visit$1 = function($0) {
18737 return this.visit(($0 && $0.is$TreeVisitor())); 18762 return this.visit(($0 && $0.is$TreeVisitor()));
18738 }; 18763 };
18739 // ********** Code for FormalNode ************** 18764 // ********** Code for FormalNode **************
18740 function FormalNode(isThis, isRest, type, name, value, span) { 18765 function FormalNode(isThis, isRest, type, name, value, span) {
18741 this.isThis = isThis; 18766 this.isThis = isThis;
18742 this.isRest = isRest; 18767 this.isRest = isRest;
18743 this.type = type; 18768 this.type = type;
18744 this.name = name; 18769 this.name = name;
18745 this.value = value; 18770 this.value = value;
18746 // Initializers done 18771 // Initializers done
18747 Node.call(this, span); 18772 lang_Node.call(this, span);
18748 } 18773 }
18749 $inherits(FormalNode, Node); 18774 $inherits(FormalNode, lang_Node);
18750 FormalNode.prototype.get$type = function() { return this.type; }; 18775 FormalNode.prototype.get$type = function() { return this.type; };
18751 FormalNode.prototype.set$type = function(value) { return this.type = value; }; 18776 FormalNode.prototype.set$type = function(value) { return this.type = value; };
18752 FormalNode.prototype.get$name = function() { return this.name; }; 18777 FormalNode.prototype.get$name = function() { return this.name; };
18753 FormalNode.prototype.set$name = function(value) { return this.name = value; }; 18778 FormalNode.prototype.set$name = function(value) { return this.name = value; };
18754 FormalNode.prototype.get$value = function() { return this.value; }; 18779 FormalNode.prototype.get$value = function() { return this.value; };
18755 FormalNode.prototype.set$value = function(value) { return this.value = value; }; 18780 FormalNode.prototype.set$value = function(value) { return this.value = value; };
18756 FormalNode.prototype.visit = function(visitor) { 18781 FormalNode.prototype.visit = function(visitor) {
18757 return visitor.visitFormalNode(this); 18782 return visitor.visitFormalNode(this);
18758 } 18783 }
18759 FormalNode.prototype.visit$1 = function($0) { 18784 FormalNode.prototype.visit$1 = function($0) {
18760 return this.visit(($0 && $0.is$TreeVisitor())); 18785 return this.visit(($0 && $0.is$TreeVisitor()));
18761 }; 18786 };
18762 // ********** Code for CatchNode ************** 18787 // ********** Code for CatchNode **************
18763 function CatchNode(exception, trace, body, span) { 18788 function CatchNode(exception, trace, body, span) {
18764 this.exception = exception; 18789 this.exception = exception;
18765 this.trace = trace; 18790 this.trace = trace;
18766 this.body = body; 18791 this.body = body;
18767 // Initializers done 18792 // Initializers done
18768 Node.call(this, span); 18793 lang_Node.call(this, span);
18769 } 18794 }
18770 $inherits(CatchNode, Node); 18795 $inherits(CatchNode, lang_Node);
18771 CatchNode.prototype.get$exception = function() { return this.exception; }; 18796 CatchNode.prototype.get$exception = function() { return this.exception; };
18772 CatchNode.prototype.set$exception = function(value) { return this.exception = va lue; }; 18797 CatchNode.prototype.set$exception = function(value) { return this.exception = va lue; };
18773 CatchNode.prototype.visit = function(visitor) { 18798 CatchNode.prototype.visit = function(visitor) {
18774 return visitor.visitCatchNode(this); 18799 return visitor.visitCatchNode(this);
18775 } 18800 }
18776 CatchNode.prototype.visit$1 = function($0) { 18801 CatchNode.prototype.visit$1 = function($0) {
18777 return this.visit(($0 && $0.is$TreeVisitor())); 18802 return this.visit(($0 && $0.is$TreeVisitor()));
18778 }; 18803 };
18779 // ********** Code for CaseNode ************** 18804 // ********** Code for CaseNode **************
18780 function CaseNode(label, cases, statements, span) { 18805 function CaseNode(label, cases, statements, span) {
18781 this.label = label; 18806 this.label = label;
18782 this.cases = cases; 18807 this.cases = cases;
18783 this.statements = statements; 18808 this.statements = statements;
18784 // Initializers done 18809 // Initializers done
18785 Node.call(this, span); 18810 lang_Node.call(this, span);
18786 } 18811 }
18787 $inherits(CaseNode, Node); 18812 $inherits(CaseNode, lang_Node);
18788 CaseNode.prototype.visit = function(visitor) { 18813 CaseNode.prototype.visit = function(visitor) {
18789 return visitor.visitCaseNode(this); 18814 return visitor.visitCaseNode(this);
18790 } 18815 }
18791 CaseNode.prototype.visit$1 = function($0) { 18816 CaseNode.prototype.visit$1 = function($0) {
18792 return this.visit(($0 && $0.is$TreeVisitor())); 18817 return this.visit(($0 && $0.is$TreeVisitor()));
18793 }; 18818 };
18794 // ********** Code for TypeParameter ************** 18819 // ********** Code for TypeParameter **************
18795 function TypeParameter(name, extendsType, span) { 18820 function TypeParameter(name, extendsType, span) {
18796 this.name = name; 18821 this.name = name;
18797 this.extendsType = extendsType; 18822 this.extendsType = extendsType;
18798 // Initializers done 18823 // Initializers done
18799 Node.call(this, span); 18824 lang_Node.call(this, span);
18800 } 18825 }
18801 $inherits(TypeParameter, Node); 18826 $inherits(TypeParameter, lang_Node);
18802 TypeParameter.prototype.get$name = function() { return this.name; }; 18827 TypeParameter.prototype.get$name = function() { return this.name; };
18803 TypeParameter.prototype.set$name = function(value) { return this.name = value; } ; 18828 TypeParameter.prototype.set$name = function(value) { return this.name = value; } ;
18804 TypeParameter.prototype.visit = function(visitor) { 18829 TypeParameter.prototype.visit = function(visitor) {
18805 return visitor.visitTypeParameter(this); 18830 return visitor.visitTypeParameter(this);
18806 } 18831 }
18807 TypeParameter.prototype.visit$1 = function($0) { 18832 TypeParameter.prototype.visit$1 = function($0) {
18808 return this.visit(($0 && $0.is$TreeVisitor())); 18833 return this.visit(($0 && $0.is$TreeVisitor()));
18809 }; 18834 };
18810 // ********** Code for Identifier ************** 18835 // ********** Code for lang_Identifier **************
18811 function Identifier(name, span) { 18836 function lang_Identifier(name, span) {
18812 this.name = name; 18837 this.name = name;
18813 // Initializers done 18838 // Initializers done
18814 Node.call(this, span); 18839 lang_Node.call(this, span);
18815 } 18840 }
18816 $inherits(Identifier, Node); 18841 $inherits(lang_Identifier, lang_Node);
18817 Identifier.prototype.is$Identifier = function(){return this;}; 18842 lang_Identifier.prototype.is$lang_Identifier = function(){return this;};
18818 Identifier.prototype.get$name = function() { return this.name; }; 18843 lang_Identifier.prototype.get$name = function() { return this.name; };
18819 Identifier.prototype.set$name = function(value) { return this.name = value; }; 18844 lang_Identifier.prototype.set$name = function(value) { return this.name = value; };
18820 Identifier.prototype.visit = function(visitor) { 18845 lang_Identifier.prototype.visit = function(visitor) {
18821 return visitor.visitIdentifier(this); 18846 return visitor.visitIdentifier(this);
18822 } 18847 }
18823 Identifier.prototype.visit$1 = function($0) { 18848 lang_Identifier.prototype.visit$1 = function($0) {
18824 return this.visit(($0 && $0.is$TreeVisitor())); 18849 return this.visit(($0 && $0.is$TreeVisitor()));
18825 }; 18850 };
18826 // ********** Code for DeclaredIdentifier ************** 18851 // ********** Code for DeclaredIdentifier **************
18827 function DeclaredIdentifier(type, name, span) { 18852 function DeclaredIdentifier(type, name, span) {
18828 this.type = type; 18853 this.type = type;
18829 this.name = name; 18854 this.name = name;
18830 // Initializers done 18855 // Initializers done
18831 Expression.call(this, span); 18856 lang_Expression.call(this, span);
18832 } 18857 }
18833 $inherits(DeclaredIdentifier, Expression); 18858 $inherits(DeclaredIdentifier, lang_Expression);
18834 DeclaredIdentifier.prototype.is$DeclaredIdentifier = function(){return this;}; 18859 DeclaredIdentifier.prototype.is$DeclaredIdentifier = function(){return this;};
18835 DeclaredIdentifier.prototype.get$type = function() { return this.type; }; 18860 DeclaredIdentifier.prototype.get$type = function() { return this.type; };
18836 DeclaredIdentifier.prototype.set$type = function(value) { return this.type = val ue; }; 18861 DeclaredIdentifier.prototype.set$type = function(value) { return this.type = val ue; };
18837 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; 18862 DeclaredIdentifier.prototype.get$name = function() { return this.name; };
18838 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val ue; }; 18863 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val ue; };
18839 DeclaredIdentifier.prototype.visit = function(visitor) { 18864 DeclaredIdentifier.prototype.visit = function(visitor) {
18840 return visitor.visitDeclaredIdentifier(this); 18865 return visitor.visitDeclaredIdentifier(this);
18841 } 18866 }
18842 DeclaredIdentifier.prototype.visit$1 = function($0) { 18867 DeclaredIdentifier.prototype.visit$1 = function($0) {
18843 return this.visit(($0 && $0.is$TreeVisitor())); 18868 return this.visit(($0 && $0.is$TreeVisitor()));
18844 }; 18869 };
18845 // ********** Code for Type ************** 18870 // ********** Code for lang_Type **************
18846 function Type(name) { 18871 function lang_Type(name) {
18847 this.name = name; 18872 this.name = name;
18848 this.isTested = false; 18873 this.isTested = false;
18849 // Initializers done 18874 // Initializers done
18850 } 18875 }
18851 Type.prototype.is$Type = function(){return this;}; 18876 lang_Type.prototype.is$lang_Type = function(){return this;};
18852 Type.prototype.is$Named = function(){return this;}; 18877 lang_Type.prototype.is$Named = function(){return this;};
18853 Type.prototype.get$name = function() { return this.name; }; 18878 lang_Type.prototype.get$name = function() { return this.name; };
18854 Type.prototype.markUsed = function() { 18879 lang_Type.prototype.markUsed = function() {
18855 18880
18856 } 18881 }
18857 Type.prototype.get$typeMember = function() { 18882 lang_Type.prototype.get$typeMember = function() {
18858 var $0; 18883 var $0;
18859 if (this._typeMember == null) { 18884 if (this._typeMember == null) {
18860 this._typeMember = new TypeMember((this && this.is$DefinedType())); 18885 this._typeMember = new TypeMember((this && this.is$DefinedType()));
18861 } 18886 }
18862 return (($0 = this._typeMember) && $0.is$TypeMember()); 18887 return (($0 = this._typeMember) && $0.is$TypeMember());
18863 } 18888 }
18864 Type.prototype.getMember = function(name) { 18889 lang_Type.prototype.getMember = function(name) {
18865 return null; 18890 return null;
18866 } 18891 }
18867 Type.prototype.get$isVar = function() { 18892 lang_Type.prototype.get$isVar = function() {
18868 return false; 18893 return false;
18869 } 18894 }
18870 Type.prototype.get$isTop = function() { 18895 lang_Type.prototype.get$isTop = function() {
18871 return false; 18896 return false;
18872 } 18897 }
18873 Type.prototype.get$isObject = function() { 18898 lang_Type.prototype.get$isObject = function() {
18874 return false; 18899 return false;
18875 } 18900 }
18876 Type.prototype.get$isString = function() { 18901 lang_Type.prototype.get$isString = function() {
18877 return false; 18902 return false;
18878 } 18903 }
18879 Type.prototype.get$isBool = function() { 18904 lang_Type.prototype.get$isBool = function() {
18880 return false; 18905 return false;
18881 } 18906 }
18882 Type.prototype.get$isFunction = function() { 18907 lang_Type.prototype.get$isFunction = function() {
18883 return false; 18908 return false;
18884 } 18909 }
18885 Type.prototype.get$isList = function() { 18910 lang_Type.prototype.get$isList = function() {
18886 return false; 18911 return false;
18887 } 18912 }
18888 Type.prototype.get$isNum = function() { 18913 lang_Type.prototype.get$isNum = function() {
18889 return false; 18914 return false;
18890 } 18915 }
18891 Type.prototype.get$isVoid = function() { 18916 lang_Type.prototype.get$isVoid = function() {
18892 return false; 18917 return false;
18893 } 18918 }
18894 Type.prototype.get$isNullable = function() { 18919 lang_Type.prototype.get$isNullable = function() {
18895 return true; 18920 return true;
18896 } 18921 }
18897 Type.prototype.get$isVarOrFunction = function() { 18922 lang_Type.prototype.get$isVarOrFunction = function() {
18898 return $notnull_bool(this.get$isVar()) || $notnull_bool(this.get$isFunction()) ; 18923 return $notnull_bool(this.get$isVar()) || $notnull_bool(this.get$isFunction()) ;
18899 } 18924 }
18900 Type.prototype.get$isVarOrObject = function() { 18925 lang_Type.prototype.get$isVarOrObject = function() {
18901 return $notnull_bool(this.get$isVar()) || $notnull_bool(this.get$isObject()); 18926 return $notnull_bool(this.get$isVar()) || $notnull_bool(this.get$isObject());
18902 } 18927 }
18903 Type.prototype.getCallMethod = function() { 18928 lang_Type.prototype.getCallMethod = function() {
18904 return null; 18929 return null;
18905 } 18930 }
18906 Type.prototype.get$isClosed = function() { 18931 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()); 18932 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 } 18933 }
18909 Type.prototype.get$isUsed = function() { 18934 lang_Type.prototype.get$isUsed = function() {
18910 return false; 18935 return false;
18911 } 18936 }
18912 Type.prototype.get$isGeneric = function() { 18937 lang_Type.prototype.get$isGeneric = function() {
18913 return false; 18938 return false;
18914 } 18939 }
18915 Type.prototype.get$isNativeType = function() { 18940 lang_Type.prototype.get$isNativeType = function() {
18916 return false; 18941 return false;
18917 } 18942 }
18918 Type.prototype.get$isNative = function() { 18943 lang_Type.prototype.get$isNative = function() {
18919 return this.get$isNativeType(); 18944 return this.get$isNativeType();
18920 } 18945 }
18921 Type.prototype.get$hasTypeParams = function() { 18946 lang_Type.prototype.get$hasTypeParams = function() {
18922 return false; 18947 return false;
18923 } 18948 }
18924 Type.prototype.get$typeofName = function() { 18949 lang_Type.prototype.get$typeofName = function() {
18925 return null; 18950 return null;
18926 } 18951 }
18927 Type.prototype.get$jsname = function() { 18952 lang_Type.prototype.get$jsname = function() {
18928 return this._jsname == null ? this.name : this._jsname; 18953 return this._jsname == null ? this.name : this._jsname;
18929 } 18954 }
18930 Type.prototype.set$jsname = function(name) { 18955 lang_Type.prototype.set$jsname = function(name) {
18931 return this._jsname = name; 18956 return this._jsname = name;
18932 } 18957 }
18933 Type.prototype.get$members = function() { 18958 lang_Type.prototype.get$members = function() {
18934 return null; 18959 return null;
18935 } 18960 }
18936 Type.prototype.get$definition = function() { 18961 lang_Type.prototype.get$definition = function() {
18937 return null; 18962 return null;
18938 } 18963 }
18939 Type.prototype.get$factories = function() { 18964 lang_Type.prototype.get$factories = function() {
18940 return null; 18965 return null;
18941 } 18966 }
18942 Type.prototype.get$typeArgsInOrder = function() { 18967 lang_Type.prototype.get$typeArgsInOrder = function() {
18943 return null; 18968 return null;
18944 } 18969 }
18945 Type.prototype.get$genericType = function() { 18970 lang_Type.prototype.get$genericType = function() {
18946 return (this && this.is$DefinedType()); 18971 return (this && this.is$DefinedType());
18947 } 18972 }
18948 Type.prototype.get$interfaces = function() { 18973 lang_Type.prototype.get$interfaces = function() {
18949 return null; 18974 return null;
18950 } 18975 }
18951 Type.prototype.get$parent = function() { 18976 lang_Type.prototype.get$parent = function() {
18952 return null; 18977 return null;
18953 } 18978 }
18954 Type.prototype.getAllMembers = function() { 18979 lang_Type.prototype.getAllMembers = function() {
18955 return $map([]); 18980 return $map([]);
18956 } 18981 }
18957 Type.prototype.hashCode = function() { 18982 lang_Type.prototype.hashCode = function() {
18958 return this.name.hashCode(); 18983 return this.name.hashCode();
18959 } 18984 }
18960 Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) { 18985 lang_Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) {
18961 if (!$notnull_bool(this.isSubtypeOf(other))) { 18986 if (!$notnull_bool(this.isSubtypeOf(other))) {
18962 var msg = ('type ' + this.name + ' is not a subtype of ' + other.name + ''); 18987 var msg = ('type ' + this.name + ' is not a subtype of ' + other.name + '');
18963 if ($notnull_bool(typeErrors)) { 18988 if ($notnull_bool(typeErrors)) {
18964 world.error($assert_String(msg), span); 18989 world.error($assert_String(msg), span);
18965 } 18990 }
18966 else { 18991 else {
18967 world.warning($assert_String(msg), span); 18992 world.warning($assert_String(msg), span);
18968 } 18993 }
18969 } 18994 }
18970 } 18995 }
18971 Type.prototype.needsVarCall = function(args) { 18996 lang_Type.prototype.needsVarCall = function(args) {
18972 if ($notnull_bool(this.get$isVarOrFunction())) { 18997 if ($notnull_bool(this.get$isVarOrFunction())) {
18973 return true; 18998 return true;
18974 } 18999 }
18975 var call = this.getCallMethod(); 19000 var call = this.getCallMethod();
18976 if ($notnull_bool($ne(call, null))) { 19001 if ($notnull_bool($ne(call, null))) {
18977 if (args.get$length() != call.get$parameters().length || !$notnull_bool(call .namesInOrder$1(args))) { 19002 if (args.get$length() != call.get$parameters().length || !$notnull_bool(call .namesInOrder$1(args))) {
18978 return true; 19003 return true;
18979 } 19004 }
18980 } 19005 }
18981 return false; 19006 return false;
18982 } 19007 }
18983 Type.union = function(x, y) { 19008 lang_Type.union = function(x, y) {
18984 if ($eq(x, y)) return x; 19009 if ($eq(x, y)) return x;
18985 if ($notnull_bool(x.get$isNum()) && $notnull_bool(y.get$isNum())) return world .numType; 19010 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; 19011 if ($notnull_bool(x.get$isString()) && $notnull_bool(y.get$isString())) return world.stringType;
18987 return world.varType; 19012 return world.varType;
18988 } 19013 }
18989 Type.prototype.isAssignable = function(other) { 19014 lang_Type.prototype.isAssignable = function(other) {
18990 return $notnull_bool(this.isSubtypeOf(other)) || $notnull_bool(other.isSubtype Of(this)); 19015 return $notnull_bool(this.isSubtypeOf(other)) || $notnull_bool(other.isSubtype Of(this));
18991 } 19016 }
18992 Type.prototype._isDirectSupertypeOf = function(other) { 19017 lang_Type.prototype._isDirectSupertypeOf = function(other) {
18993 var $this = this; // closure support 19018 var $this = this; // closure support
18994 if ($notnull_bool(other.get$isClass())) { 19019 if ($notnull_bool(other.get$isClass())) {
18995 return $eq(other.get$parent(), this) || $notnull_bool(this.get$isObject()) & & other.get$parent() == null; 19020 return $eq(other.get$parent(), this) || $notnull_bool(this.get$isObject()) & & other.get$parent() == null;
18996 } 19021 }
18997 else { 19022 else {
18998 if (other.get$interfaces() == null || other.get$interfaces().isEmpty()) { 19023 if (other.get$interfaces() == null || other.get$interfaces().isEmpty()) {
18999 return this.get$isObject(); 19024 return this.get$isObject();
19000 } 19025 }
19001 else { 19026 else {
19002 return other.get$interfaces().some((function (i) { 19027 return other.get$interfaces().some((function (i) {
19003 return $eq(i, $this); 19028 return $eq(i, $this);
19004 }) 19029 })
19005 ); 19030 );
19006 } 19031 }
19007 } 19032 }
19008 } 19033 }
19009 Type.prototype.isSubtypeOf = function(other) { 19034 lang_Type.prototype.isSubtypeOf = function(other) {
19010 if ((other instanceof ParameterType)) { 19035 if ((other instanceof ParameterType)) {
19011 return true; 19036 return true;
19012 } 19037 }
19013 if ($eq(this, other)) return true; 19038 if ($eq(this, other)) return true;
19014 if ($notnull_bool(this.get$isVar())) return true; 19039 if ($notnull_bool(this.get$isVar())) return true;
19015 if ($notnull_bool(other.get$isVar())) return true; 19040 if ($notnull_bool(other.get$isVar())) return true;
19016 if ($notnull_bool(other._isDirectSupertypeOf(this))) return true; 19041 if ($notnull_bool(other._isDirectSupertypeOf(this))) return true;
19017 var call = this.getCallMethod(); 19042 var call = this.getCallMethod();
19018 var otherCall = other.getCallMethod(); 19043 var otherCall = other.getCallMethod();
19019 if ($notnull_bool($ne(call, null)) && $notnull_bool($ne(otherCall, null))) { 19044 if ($notnull_bool($ne(call, null)) && $notnull_bool($ne(otherCall, null))) {
19020 return Type._isFunctionSubtypeOf((call && call.is$MethodMember()), (otherCal l && otherCall.is$MethodMember())); 19045 return lang_Type._isFunctionSubtypeOf((call && call.is$MethodMember()), (oth erCall && otherCall.is$MethodMember()));
19021 } 19046 }
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) { 19047 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(); 19048 var t = this.get$typeArgsInOrder().iterator$0();
19024 var s = other.get$typeArgsInOrder().iterator$0(); 19049 var s = other.get$typeArgsInOrder().iterator$0();
19025 while ($notnull_bool(t.hasNext$0())) { 19050 while ($notnull_bool(t.hasNext$0())) {
19026 if (!$notnull_bool(t.next$0().isSubtypeOf$1(s.next$0()))) return false; 19051 if (!$notnull_bool(t.next$0().isSubtypeOf$1(s.next$0()))) return false;
19027 } 19052 }
19028 return true; 19053 return true;
19029 } 19054 }
19030 if (this.get$parent() != null && $notnull_bool(this.get$parent().isSubtypeOf(o ther))) { 19055 if (this.get$parent() != null && $notnull_bool(this.get$parent().isSubtypeOf(o ther))) {
19031 return true; 19056 return true;
19032 } 19057 }
19033 if (this.get$interfaces() != null && this.get$interfaces().some((function (i) { 19058 if (this.get$interfaces() != null && this.get$interfaces().some((function (i) {
19034 return i.isSubtypeOf$1(other); 19059 return i.isSubtypeOf$1(other);
19035 }) 19060 })
19036 )) { 19061 )) {
19037 return true; 19062 return true;
19038 } 19063 }
19039 return false; 19064 return false;
19040 } 19065 }
19041 Type._isFunctionSubtypeOf = function(t, s) { 19066 lang_Type._isFunctionSubtypeOf = function(t, s) {
19042 if (!$notnull_bool(s.returnType.get$isVoid()) && !$notnull_bool(s.returnType.i sAssignable(t.returnType))) { 19067 if (!$notnull_bool(s.returnType.get$isVoid()) && !$notnull_bool(s.returnType.i sAssignable(t.returnType))) {
19043 return false; 19068 return false;
19044 } 19069 }
19045 var tp = t.parameters; 19070 var tp = t.parameters;
19046 var sp = s.parameters; 19071 var sp = s.parameters;
19047 if (tp.length < sp.length) return false; 19072 if (tp.length < sp.length) return false;
19048 for (var i = 0; 19073 for (var i = 0;
19049 i < sp.length; i++) { 19074 i < sp.length; i++) {
19050 if ($ne(tp.$index(i).get$isOptional(), sp.$index(i).get$isOptional())) retur n false; 19075 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; 19076 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; 19077 if (!$notnull_bool(tp.$index(i).type.isAssignable$1(sp.$index(i).type))) ret urn false;
19053 } 19078 }
19054 if (tp.length > sp.length && !$notnull_bool(tp.$index(sp.length).get$isOptiona l())) return false; 19079 if (tp.length > sp.length && !$notnull_bool(tp.$index(sp.length).get$isOptiona l())) return false;
19055 return true; 19080 return true;
19056 } 19081 }
19057 Type.prototype.addDirectSubtype$1 = function($0) { 19082 lang_Type.prototype.addDirectSubtype$1 = function($0) {
19058 return this.addDirectSubtype(($0 && $0.is$Type())); 19083 return this.addDirectSubtype(($0 && $0.is$lang_Type()));
19059 }; 19084 };
19060 Type.prototype.ensureSubtypeOf$3 = function($0, $1, $2) { 19085 lang_Type.prototype.ensureSubtypeOf$3 = function($0, $1, $2) {
19061 return this.ensureSubtypeOf(($0 && $0.is$Type()), ($1 && $1.is$SourceSpan()), $assert_bool($2)); 19086 return this.ensureSubtypeOf(($0 && $0.is$lang_Type()), ($1 && $1.is$SourceSpan ()), $assert_bool($2));
19062 }; 19087 };
19063 Type.prototype.getConstructor$1 = function($0) { 19088 lang_Type.prototype.getConstructor$1 = function($0) {
19064 return this.getConstructor($assert_String($0)); 19089 return this.getConstructor($assert_String($0));
19065 }; 19090 };
19066 Type.prototype.getFactory$2 = function($0, $1) { 19091 lang_Type.prototype.getFactory$2 = function($0, $1) {
19067 return this.getFactory(($0 && $0.is$Type()), $assert_String($1)); 19092 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1));
19068 }; 19093 };
19069 Type.prototype.getMember$1 = function($0) { 19094 lang_Type.prototype.getMember$1 = function($0) {
19070 return this.getMember($assert_String($0)); 19095 return this.getMember($assert_String($0));
19071 }; 19096 };
19072 Type.prototype.getOrMakeConcreteType$1 = function($0) { 19097 lang_Type.prototype.getOrMakeConcreteType$1 = function($0) {
19073 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); 19098 return this.getOrMakeConcreteType(($0 && $0.is$List$Type()));
19074 }; 19099 };
19075 Type.prototype.hashCode$0 = function() { 19100 lang_Type.prototype.hashCode$0 = function() {
19076 return this.hashCode(); 19101 return this.hashCode();
19077 }; 19102 };
19078 Type.prototype.isAssignable$1 = function($0) { 19103 lang_Type.prototype.isAssignable$1 = function($0) {
19079 return this.isAssignable(($0 && $0.is$Type())); 19104 return this.isAssignable(($0 && $0.is$lang_Type()));
19080 }; 19105 };
19081 Type.prototype.isSubtypeOf$1 = function($0) { 19106 lang_Type.prototype.isSubtypeOf$1 = function($0) {
19082 return this.isSubtypeOf(($0 && $0.is$Type())); 19107 return this.isSubtypeOf(($0 && $0.is$lang_Type()));
19083 }; 19108 };
19084 Type.prototype.markUsed$0 = function() { 19109 lang_Type.prototype.markUsed$0 = function() {
19085 return this.markUsed(); 19110 return this.markUsed();
19086 }; 19111 };
19087 Type.prototype.resolveMember$1 = function($0) { 19112 lang_Type.prototype.resolveMember$1 = function($0) {
19088 return this.resolveMember($assert_String($0)); 19113 return this.resolveMember($assert_String($0));
19089 }; 19114 };
19090 Type.prototype.resolveTypeParams$1 = function($0) { 19115 lang_Type.prototype.resolveTypeParams$1 = function($0) {
19091 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); 19116 return this.resolveTypeParams(($0 && $0.is$ConcreteType()));
19092 }; 19117 };
19093 // ********** Code for ParameterType ************** 19118 // ********** Code for ParameterType **************
19094 function ParameterType(name, typeParameter) { 19119 function ParameterType(name, typeParameter) {
19095 this.typeParameter = typeParameter; 19120 this.typeParameter = typeParameter;
19096 // Initializers done 19121 // Initializers done
19097 Type.call(this, name); 19122 lang_Type.call(this, name);
19098 } 19123 }
19099 $inherits(ParameterType, Type); 19124 $inherits(ParameterType, lang_Type);
19100 ParameterType.prototype.is$ParameterType = function(){return this;}; 19125 ParameterType.prototype.is$ParameterType = function(){return this;};
19101 ParameterType.prototype.get$isClass = function() { 19126 ParameterType.prototype.get$isClass = function() {
19102 return false; 19127 return false;
19103 } 19128 }
19104 ParameterType.prototype.get$library = function() { 19129 ParameterType.prototype.get$library = function() {
19105 return null; 19130 return null;
19106 } 19131 }
19107 ParameterType.prototype.get$span = function() { 19132 ParameterType.prototype.get$span = function() {
19108 return this.typeParameter.span; 19133 return this.typeParameter.span;
19109 } 19134 }
(...skipping 13 matching lines...) Expand all
19123 return this.extendsType.resolveMember(memberName); 19148 return this.extendsType.resolveMember(memberName);
19124 } 19149 }
19125 ParameterType.prototype.getConstructor = function(constructorName) { 19150 ParameterType.prototype.getConstructor = function(constructorName) {
19126 world.internalError('no constructors on type parameters yet'); 19151 world.internalError('no constructors on type parameters yet');
19127 } 19152 }
19128 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) { 19153 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) {
19129 world.internalError('no concrete types of type parameters yet', this.get$span( )); 19154 world.internalError('no concrete types of type parameters yet', this.get$span( ));
19130 } 19155 }
19131 ParameterType.prototype.resolveTypeParams = function(inType) { 19156 ParameterType.prototype.resolveTypeParams = function(inType) {
19132 var $0; 19157 var $0;
19133 return (($0 = inType.typeArguments.$index(this.name)) && $0.is$Type()); 19158 return (($0 = inType.typeArguments.$index(this.name)) && $0.is$lang_Type());
19134 } 19159 }
19135 ParameterType.prototype.addDirectSubtype = function(type) { 19160 ParameterType.prototype.addDirectSubtype = function(type) {
19136 world.internalError('no subtypes of type parameters yet', this.get$span()); 19161 world.internalError('no subtypes of type parameters yet', this.get$span());
19137 } 19162 }
19138 ParameterType.prototype.resolve = function(inType) { 19163 ParameterType.prototype.resolve = function(inType) {
19139 if (this.typeParameter.extendsType != null) { 19164 if (this.typeParameter.extendsType != null) {
19140 this.extendsType = inType.resolveType(this.typeParameter.extendsType, true); 19165 this.extendsType = inType.resolveType(this.typeParameter.extendsType, true);
19141 } 19166 }
19142 else { 19167 else {
19143 this.extendsType = world.objectType; 19168 this.extendsType = world.objectType;
19144 } 19169 }
19145 } 19170 }
19146 ParameterType.prototype.addDirectSubtype$1 = function($0) { 19171 ParameterType.prototype.addDirectSubtype$1 = function($0) {
19147 return this.addDirectSubtype(($0 && $0.is$Type())); 19172 return this.addDirectSubtype(($0 && $0.is$lang_Type()));
19148 }; 19173 };
19149 ParameterType.prototype.getConstructor$1 = function($0) { 19174 ParameterType.prototype.getConstructor$1 = function($0) {
19150 return this.getConstructor($assert_String($0)); 19175 return this.getConstructor($assert_String($0));
19151 }; 19176 };
19152 ParameterType.prototype.getOrMakeConcreteType$1 = function($0) { 19177 ParameterType.prototype.getOrMakeConcreteType$1 = function($0) {
19153 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); 19178 return this.getOrMakeConcreteType(($0 && $0.is$List$Type()));
19154 }; 19179 };
19155 ParameterType.prototype.isSubtypeOf$1 = function($0) { 19180 ParameterType.prototype.isSubtypeOf$1 = function($0) {
19156 return this.isSubtypeOf(($0 && $0.is$Type())); 19181 return this.isSubtypeOf(($0 && $0.is$lang_Type()));
19157 }; 19182 };
19158 ParameterType.prototype.resolve$1 = function($0) { 19183 ParameterType.prototype.resolve$1 = function($0) {
19159 return this.resolve(($0 && $0.is$Type())); 19184 return this.resolve(($0 && $0.is$lang_Type()));
19160 }; 19185 };
19161 ParameterType.prototype.resolveMember$1 = function($0) { 19186 ParameterType.prototype.resolveMember$1 = function($0) {
19162 return this.resolveMember($assert_String($0)); 19187 return this.resolveMember($assert_String($0));
19163 }; 19188 };
19164 ParameterType.prototype.resolveTypeParams$1 = function($0) { 19189 ParameterType.prototype.resolveTypeParams$1 = function($0) {
19165 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); 19190 return this.resolveTypeParams(($0 && $0.is$ConcreteType()));
19166 }; 19191 };
19167 // ********** Code for NonNullableType ************** 19192 // ********** Code for NonNullableType **************
19168 function NonNullableType(type) { 19193 function NonNullableType(type) {
19169 this.type = type; 19194 this.type = type;
19170 // Initializers done 19195 // Initializers done
19171 Type.call(this, type.name); 19196 lang_Type.call(this, type.name);
19172 } 19197 }
19173 $inherits(NonNullableType, Type); 19198 $inherits(NonNullableType, lang_Type);
19174 NonNullableType.prototype.get$type = function() { return this.type; }; 19199 NonNullableType.prototype.get$type = function() { return this.type; };
19175 NonNullableType.prototype.get$isNullable = function() { 19200 NonNullableType.prototype.get$isNullable = function() {
19176 return false; 19201 return false;
19177 } 19202 }
19178 NonNullableType.prototype.get$isBool = function() { 19203 NonNullableType.prototype.get$isBool = function() {
19179 return this.type.get$isBool(); 19204 return this.type.get$isBool();
19180 } 19205 }
19181 NonNullableType.prototype.get$isUsed = function() { 19206 NonNullableType.prototype.get$isUsed = function() {
19182 return false; 19207 return false;
19183 } 19208 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
19268 NonNullableType.prototype.get$parent = function() { 19293 NonNullableType.prototype.get$parent = function() {
19269 return this.type.get$parent(); 19294 return this.type.get$parent();
19270 } 19295 }
19271 NonNullableType.prototype.getAllMembers = function() { 19296 NonNullableType.prototype.getAllMembers = function() {
19272 return this.type.getAllMembers(); 19297 return this.type.getAllMembers();
19273 } 19298 }
19274 NonNullableType.prototype.get$isNativeType = function() { 19299 NonNullableType.prototype.get$isNativeType = function() {
19275 return this.type.get$isNativeType(); 19300 return this.type.get$isNativeType();
19276 } 19301 }
19277 NonNullableType.prototype.addDirectSubtype$1 = function($0) { 19302 NonNullableType.prototype.addDirectSubtype$1 = function($0) {
19278 return this.addDirectSubtype(($0 && $0.is$Type())); 19303 return this.addDirectSubtype(($0 && $0.is$lang_Type()));
19279 }; 19304 };
19280 NonNullableType.prototype.getConstructor$1 = function($0) { 19305 NonNullableType.prototype.getConstructor$1 = function($0) {
19281 return this.getConstructor($assert_String($0)); 19306 return this.getConstructor($assert_String($0));
19282 }; 19307 };
19283 NonNullableType.prototype.getFactory$2 = function($0, $1) { 19308 NonNullableType.prototype.getFactory$2 = function($0, $1) {
19284 return this.getFactory(($0 && $0.is$Type()), $assert_String($1)); 19309 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1));
19285 }; 19310 };
19286 NonNullableType.prototype.getMember$1 = function($0) { 19311 NonNullableType.prototype.getMember$1 = function($0) {
19287 return this.getMember($assert_String($0)); 19312 return this.getMember($assert_String($0));
19288 }; 19313 };
19289 NonNullableType.prototype.getOrMakeConcreteType$1 = function($0) { 19314 NonNullableType.prototype.getOrMakeConcreteType$1 = function($0) {
19290 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); 19315 return this.getOrMakeConcreteType(($0 && $0.is$List$Type()));
19291 }; 19316 };
19292 NonNullableType.prototype.isSubtypeOf$1 = function($0) { 19317 NonNullableType.prototype.isSubtypeOf$1 = function($0) {
19293 return this.isSubtypeOf(($0 && $0.is$Type())); 19318 return this.isSubtypeOf(($0 && $0.is$lang_Type()));
19294 }; 19319 };
19295 NonNullableType.prototype.markUsed$0 = function() { 19320 NonNullableType.prototype.markUsed$0 = function() {
19296 return this.markUsed(); 19321 return this.markUsed();
19297 }; 19322 };
19298 NonNullableType.prototype.resolveMember$1 = function($0) { 19323 NonNullableType.prototype.resolveMember$1 = function($0) {
19299 return this.resolveMember($assert_String($0)); 19324 return this.resolveMember($assert_String($0));
19300 }; 19325 };
19301 NonNullableType.prototype.resolveTypeParams$1 = function($0) { 19326 NonNullableType.prototype.resolveTypeParams$1 = function($0) {
19302 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); 19327 return this.resolveTypeParams(($0 && $0.is$ConcreteType()));
19303 }; 19328 };
19304 // ********** Code for ConcreteType ************** 19329 // ********** Code for ConcreteType **************
19305 function ConcreteType(name, genericType, typeArguments, typeArgsInOrder) { 19330 function ConcreteType(name, genericType, typeArguments, typeArgsInOrder) {
19306 this.genericType = genericType; 19331 this.genericType = genericType;
19307 this.typeArguments = typeArguments; 19332 this.typeArguments = typeArguments;
19308 this.typeArgsInOrder = typeArgsInOrder; 19333 this.typeArgsInOrder = typeArgsInOrder;
19309 this.constructors = $map([]); 19334 this.constructors = $map([]);
19310 this.members = $map([]); 19335 this.members = $map([]);
19311 this.factories = new FactoryMap(); 19336 this.factories = new FactoryMap();
19312 // Initializers done 19337 // Initializers done
19313 Type.call(this, name); 19338 lang_Type.call(this, name);
19314 } 19339 }
19315 $inherits(ConcreteType, Type); 19340 $inherits(ConcreteType, lang_Type);
19316 ConcreteType.prototype.is$ConcreteType = function(){return this;}; 19341 ConcreteType.prototype.is$ConcreteType = function(){return this;};
19317 ConcreteType.prototype.get$genericType = function() { return this.genericType; } ; 19342 ConcreteType.prototype.get$genericType = function() { return this.genericType; } ;
19318 ConcreteType.prototype.get$typeArgsInOrder = function() { return this.typeArgsIn Order; }; 19343 ConcreteType.prototype.get$typeArgsInOrder = function() { return this.typeArgsIn Order; };
19319 ConcreteType.prototype.set$typeArgsInOrder = function(value) { return this.typeA rgsInOrder = value; }; 19344 ConcreteType.prototype.set$typeArgsInOrder = function(value) { return this.typeA rgsInOrder = value; };
19320 ConcreteType.prototype.get$isList = function() { 19345 ConcreteType.prototype.get$isList = function() {
19321 return this.genericType.get$isList(); 19346 return this.genericType.get$isList();
19322 } 19347 }
19323 ConcreteType.prototype.get$isClass = function() { 19348 ConcreteType.prototype.get$isClass = function() {
19324 return this.genericType.isClass; 19349 return this.genericType.isClass;
19325 } 19350 }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
19436 var $list = this.genericType.get$subtypes(); 19461 var $list = this.genericType.get$subtypes();
19437 for (var $i = this.genericType.get$subtypes().iterator(); $i.hasNext$0(); ) { 19462 for (var $i = this.genericType.get$subtypes().iterator(); $i.hasNext$0(); ) {
19438 var t = $i.next$0(); 19463 var t = $i.next$0();
19439 var m = t.get$members().$index(memberName); 19464 var m = t.get$members().$index(memberName);
19440 if ($notnull_bool($ne(m, null))) ret.add$1(m); 19465 if ($notnull_bool($ne(m, null))) ret.add$1(m);
19441 } 19466 }
19442 return (ret && ret.is$MemberSet()); 19467 return (ret && ret.is$MemberSet());
19443 } 19468 }
19444 ConcreteType.prototype.resolveType = function(node, isRequired) { 19469 ConcreteType.prototype.resolveType = function(node, isRequired) {
19445 var ret = this.genericType.resolveType(node, isRequired); 19470 var ret = this.genericType.resolveType(node, isRequired);
19446 return (ret && ret.is$Type()); 19471 return (ret && ret.is$lang_Type());
19447 } 19472 }
19448 ConcreteType.prototype.addDirectSubtype = function(type) { 19473 ConcreteType.prototype.addDirectSubtype = function(type) {
19449 this.genericType.addDirectSubtype(type); 19474 this.genericType.addDirectSubtype(type);
19450 } 19475 }
19451 ConcreteType.prototype.addDirectSubtype$1 = function($0) { 19476 ConcreteType.prototype.addDirectSubtype$1 = function($0) {
19452 return this.addDirectSubtype(($0 && $0.is$Type())); 19477 return this.addDirectSubtype(($0 && $0.is$lang_Type()));
19453 }; 19478 };
19454 ConcreteType.prototype.getConstructor$1 = function($0) { 19479 ConcreteType.prototype.getConstructor$1 = function($0) {
19455 return this.getConstructor($assert_String($0)); 19480 return this.getConstructor($assert_String($0));
19456 }; 19481 };
19457 ConcreteType.prototype.getFactory$2 = function($0, $1) { 19482 ConcreteType.prototype.getFactory$2 = function($0, $1) {
19458 return this.getFactory(($0 && $0.is$Type()), $assert_String($1)); 19483 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1));
19459 }; 19484 };
19460 ConcreteType.prototype.getMember$1 = function($0) { 19485 ConcreteType.prototype.getMember$1 = function($0) {
19461 return this.getMember($assert_String($0)); 19486 return this.getMember($assert_String($0));
19462 }; 19487 };
19463 ConcreteType.prototype.getOrMakeConcreteType$1 = function($0) { 19488 ConcreteType.prototype.getOrMakeConcreteType$1 = function($0) {
19464 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); 19489 return this.getOrMakeConcreteType(($0 && $0.is$List$Type()));
19465 }; 19490 };
19466 ConcreteType.prototype.markUsed$0 = function() { 19491 ConcreteType.prototype.markUsed$0 = function() {
19467 return this.markUsed(); 19492 return this.markUsed();
19468 }; 19493 };
19469 ConcreteType.prototype.resolveMember$1 = function($0) { 19494 ConcreteType.prototype.resolveMember$1 = function($0) {
19470 return this.resolveMember($assert_String($0)); 19495 return this.resolveMember($assert_String($0));
19471 }; 19496 };
19472 ConcreteType.prototype.resolveTypeParams$1 = function($0) { 19497 ConcreteType.prototype.resolveTypeParams$1 = function($0) {
19473 return this.resolveTypeParams(($0 && $0.is$ConcreteType())); 19498 return this.resolveTypeParams(($0 && $0.is$ConcreteType()));
19474 }; 19499 };
19475 // ********** Code for DefinedType ************** 19500 // ********** Code for DefinedType **************
19476 function DefinedType(name, library, definition, isClass) { 19501 function DefinedType(name, library, definition, isClass) {
19477 this.isUsed = false 19502 this.isUsed = false
19478 this.isNativeType = false 19503 this.isNativeType = false
19479 this.library = library; 19504 this.library = library;
19480 this.isClass = isClass; 19505 this.isClass = isClass;
19481 this.directSubtypes = new HashSetImplementation(); 19506 this.directSubtypes = new HashSetImplementation();
19482 this.constructors = $map([]); 19507 this.constructors = $map([]);
19483 this.members = $map([]); 19508 this.members = $map([]);
19484 this.factories = new FactoryMap(); 19509 this.factories = new FactoryMap();
19485 this._resolvedMembers = $map([]); 19510 this._resolvedMembers = $map([]);
19486 // Initializers done 19511 // Initializers done
19487 Type.call(this, name); 19512 lang_Type.call(this, name);
19488 this.setDefinition(definition); 19513 this.setDefinition(definition);
19489 } 19514 }
19490 $inherits(DefinedType, Type); 19515 $inherits(DefinedType, lang_Type);
19491 DefinedType.prototype.is$DefinedType = function(){return this;}; 19516 DefinedType.prototype.is$DefinedType = function(){return this;};
19492 DefinedType.prototype.get$definition = function() { return this.definition; }; 19517 DefinedType.prototype.get$definition = function() { return this.definition; };
19493 DefinedType.prototype.set$definition = function(value) { return this.definition = value; }; 19518 DefinedType.prototype.set$definition = function(value) { return this.definition = value; };
19494 DefinedType.prototype.get$library = function() { return this.library; }; 19519 DefinedType.prototype.get$library = function() { return this.library; };
19495 DefinedType.prototype.get$isClass = function() { return this.isClass; }; 19520 DefinedType.prototype.get$isClass = function() { return this.isClass; };
19496 DefinedType.prototype.get$parent = function() { 19521 DefinedType.prototype.get$parent = function() {
19497 return this._parent; 19522 return this._parent;
19498 } 19523 }
19499 DefinedType.prototype.set$parent = function(p) { 19524 DefinedType.prototype.set$parent = function(p) {
19500 this._parent = p; 19525 this._parent = p;
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
19986 name = $assert_String(typeRef.names.last().get$name()); 20011 name = $assert_String(typeRef.names.last().get$name());
19987 } 20012 }
19988 else { 20013 else {
19989 name = typeRef.name.name; 20014 name = typeRef.name.name;
19990 } 20015 }
19991 if (this.typeParameters != null) { 20016 if (this.typeParameters != null) {
19992 var $list = this.typeParameters; 20017 var $list = this.typeParameters;
19993 for (var $i = 0;$i < $list.length; $i++) { 20018 for (var $i = 0;$i < $list.length; $i++) {
19994 var tp = $list.$index($i); 20019 var tp = $list.$index($i);
19995 if ($notnull_bool($eq(tp.get$name(), name))) { 20020 if ($notnull_bool($eq(tp.get$name(), name))) {
19996 typeRef.type = (tp && tp.is$Type()); 20021 typeRef.type = (tp && tp.is$lang_Type());
19997 } 20022 }
19998 } 20023 }
19999 } 20024 }
20000 if (typeRef.type == null) { 20025 if (typeRef.type == null) {
20001 typeRef.type = this.library.findType(typeRef); 20026 typeRef.type = this.library.findType(typeRef);
20002 } 20027 }
20003 if (typeRef.type == null) { 20028 if (typeRef.type == null) {
20004 var message = ('can not find type ' + DefinedType._getDottedName(typeRef) + ''); 20029 var message = ('can not find type ' + DefinedType._getDottedName(typeRef) + '');
20005 if ($notnull_bool(typeErrors)) { 20030 if ($notnull_bool(typeErrors)) {
20006 world.error($assert_String(message), typeRef.span); 20031 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(); 20083 var paramName = this.typeParameters.$index(i).get$name();
20059 typeMap.$setindex(paramName, typeArgs.$index(i)); 20084 typeMap.$setindex(paramName, typeArgs.$index(i));
20060 names.add$1(typeArgs.$index(i).get$name()); 20085 names.add$1(typeArgs.$index(i).get$name());
20061 } 20086 }
20062 var concreteName = Strings.join((names && names.is$List$String()), '\$'); 20087 var concreteName = Strings.join((names && names.is$List$String()), '\$');
20063 var ret = this._concreteTypes.$index(concreteName); 20088 var ret = this._concreteTypes.$index(concreteName);
20064 if ($notnull_bool(ret == null)) { 20089 if ($notnull_bool(ret == null)) {
20065 ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs ); 20090 ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs );
20066 this._concreteTypes.$setindex(concreteName, ret); 20091 this._concreteTypes.$setindex(concreteName, ret);
20067 } 20092 }
20068 return (ret && ret.is$Type()); 20093 return (ret && ret.is$lang_Type());
20069 } 20094 }
20070 DefinedType.prototype.getCallStub = function(args) { 20095 DefinedType.prototype.getCallStub = function(args) {
20071 $assert(this.get$isFunction(), "isFunction", "type.dart", 1251, 12); 20096 $assert(this.get$isFunction(), "isFunction", "type.dart", 1251, 12);
20072 var name = _getCallStubName('call', args); 20097 var name = _getCallStubName('call', args);
20073 if (this.varStubs == null) this.varStubs = $map([]); 20098 if (this.varStubs == null) this.varStubs = $map([]);
20074 var stub = this.varStubs.$index(name); 20099 var stub = this.varStubs.$index(name);
20075 if ($notnull_bool(stub == null)) { 20100 if ($notnull_bool(stub == null)) {
20076 stub = new VarFunctionStub($assert_String(name), args); 20101 stub = new VarFunctionStub($assert_String(name), args);
20077 this.varStubs.$setindex(name, stub); 20102 this.varStubs.$setindex(name, stub);
20078 } 20103 }
20079 return (stub && stub.is$VarFunctionStub()); 20104 return (stub && stub.is$VarFunctionStub());
20080 } 20105 }
20081 DefinedType.prototype.addDirectSubtype$1 = function($0) { 20106 DefinedType.prototype.addDirectSubtype$1 = function($0) {
20082 return this.addDirectSubtype(($0 && $0.is$Type())); 20107 return this.addDirectSubtype(($0 && $0.is$lang_Type()));
20083 }; 20108 };
20084 DefinedType.prototype.addMethod$2 = function($0, $1) { 20109 DefinedType.prototype.addMethod$2 = function($0, $1) {
20085 return this.addMethod($assert_String($0), ($1 && $1.is$FunctionDefinition())); 20110 return this.addMethod($assert_String($0), ($1 && $1.is$FunctionDefinition()));
20086 }; 20111 };
20087 DefinedType.prototype.getConstructor$1 = function($0) { 20112 DefinedType.prototype.getConstructor$1 = function($0) {
20088 return this.getConstructor($assert_String($0)); 20113 return this.getConstructor($assert_String($0));
20089 }; 20114 };
20090 DefinedType.prototype.getFactory$2 = function($0, $1) { 20115 DefinedType.prototype.getFactory$2 = function($0, $1) {
20091 return this.getFactory(($0 && $0.is$Type()), $assert_String($1)); 20116 return this.getFactory(($0 && $0.is$lang_Type()), $assert_String($1));
20092 }; 20117 };
20093 DefinedType.prototype.getMember$1 = function($0) { 20118 DefinedType.prototype.getMember$1 = function($0) {
20094 return this.getMember($assert_String($0)); 20119 return this.getMember($assert_String($0));
20095 }; 20120 };
20096 DefinedType.prototype.getOrMakeConcreteType$1 = function($0) { 20121 DefinedType.prototype.getOrMakeConcreteType$1 = function($0) {
20097 return this.getOrMakeConcreteType(($0 && $0.is$List$Type())); 20122 return this.getOrMakeConcreteType(($0 && $0.is$List$Type()));
20098 }; 20123 };
20099 DefinedType.prototype.markUsed$0 = function() { 20124 DefinedType.prototype.markUsed$0 = function() {
20100 return this.markUsed(); 20125 return this.markUsed();
20101 }; 20126 };
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
20267 } 20292 }
20268 var member = this._resolveMember(context, name, null, true); 20293 var member = this._resolveMember(context, name, null, true);
20269 return $notnull_bool($ne(member, null)) && $notnull_bool(member.canInvoke$2(co ntext, args)); 20294 return $notnull_bool($ne(member, null)) && $notnull_bool(member.canInvoke$2(co ntext, args));
20270 } 20295 }
20271 Value.prototype._hasOverriddenNoSuchMethod = function() { 20296 Value.prototype._hasOverriddenNoSuchMethod = function() {
20272 if ($notnull_bool(this.isSuper)) { 20297 if ($notnull_bool(this.isSuper)) {
20273 var m = this.type.getMember('noSuchMethod'); 20298 var m = this.type.getMember('noSuchMethod');
20274 return $notnull_bool($ne(m, null)) && !$notnull_bool(m.declaringType.get$isO bject()); 20299 return $notnull_bool($ne(m, null)) && !$notnull_bool(m.declaringType.get$isO bject());
20275 } 20300 }
20276 else { 20301 else {
20277 return this.type.resolveMember('noSuchMethod').members.length > 1; 20302 var m = this.type.resolveMember('noSuchMethod');
20303 return $notnull_bool($ne(m, null)) && m.get$members().length > 1;
20278 } 20304 }
20279 } 20305 }
20280 Value.prototype._tryResolveMember = function(context, name) { 20306 Value.prototype._tryResolveMember = function(context, name) {
20281 if ($notnull_bool(this.isSuper)) { 20307 if ($notnull_bool(this.isSuper)) {
20282 return this.type.getMember(name); 20308 return this.type.getMember(name);
20283 } 20309 }
20284 else { 20310 else {
20285 return this.type.resolveMember(name); 20311 return this.type.resolveMember(name);
20286 } 20312 }
20287 } 20313 }
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
20480 for (var i = 0; 20506 for (var i = 0;
20481 i < args.get$length(); i++) { 20507 i < args.get$length(); i++) {
20482 argsCode.add$1(args.values.$index(i).code); 20508 argsCode.add$1(args.values.$index(i).code);
20483 } 20509 }
20484 pos = Strings.join((argsCode && argsCode.is$List$String()), ", "); 20510 pos = Strings.join((argsCode && argsCode.is$List$String()), ", ");
20485 } 20511 }
20486 var noSuchArgs = [new Value(world.stringType, ('"' + name + '"'), node.span, t rue), new Value(world.listType, ('[' + pos + ']'), node.span, true)]; 20512 var noSuchArgs = [new Value(world.stringType, ('"' + name + '"'), node.span, t rue), new Value(world.listType, ('[' + pos + ']'), node.span, true)];
20487 return this._resolveMember(context, 'noSuchMethod', node, false).invoke$4(cont ext, node, this, new Arguments(null, noSuchArgs)); 20513 return this._resolveMember(context, 'noSuchMethod', node, false).invoke$4(cont ext, node, this, new Arguments(null, noSuchArgs));
20488 } 20514 }
20489 Value.prototype.invokeSpecial = function(name, args, returnType) { 20515 Value.prototype.invokeSpecial = function(name, args, returnType) {
20490 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 483, 12 ); 20516 $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 484, 12 );
20491 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4 84, 12); 20517 $assert(!$notnull_bool(args.get$hasNames()), "!args.hasNames", "value.dart", 4 85, 12);
20492 var argsString = args.getCode(); 20518 var argsString = args.getCode();
20493 if (name == '\$index' || name == '\$setindex') { 20519 if (name == '\$index' || name == '\$setindex') {
20494 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString + ')'), this.span, true); 20520 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString + ')'), this.span, true);
20495 } 20521 }
20496 else { 20522 else {
20497 if (argsString.length > 0) argsString = (', ' + argsString + ''); 20523 if (argsString.length > 0) argsString = (', ' + argsString + '');
20498 world.gen.corejs.useOperator(name); 20524 world.gen.corejs.useOperator(name);
20499 return new Value(returnType, ('' + name + '(' + this.code + '' + argsString + ')'), this.span, true); 20525 return new Value(returnType, ('' + name + '(' + this.code + '' + argsString + ')'), this.span, true);
20500 } 20526 }
20501 } 20527 }
20502 Value.prototype.checkFirstClass$1 = function($0) { 20528 Value.prototype.checkFirstClass$1 = function($0) {
20503 return this.checkFirstClass(($0 && $0.is$SourceSpan())); 20529 return this.checkFirstClass(($0 && $0.is$SourceSpan()));
20504 }; 20530 };
20505 Value.prototype.convertTo$3 = function($0, $1, $2) { 20531 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); 20532 return this.convertTo(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type( )), ($2 && $2.is$lang_Node()), false);
20507 }; 20533 };
20508 Value.prototype.convertTo$4 = function($0, $1, $2, $3) { 20534 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)); 20535 return this.convertTo(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type( )), ($2 && $2.is$lang_Node()), $assert_bool($3));
20510 }; 20536 };
20511 Value.prototype.get_$3 = function($0, $1, $2) { 20537 Value.prototype.get_$3 = function($0, $1, $2) {
20512 return this.get_(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $ 2.is$Node())); 20538 return this.get_(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $ 2.is$lang_Node()));
20513 }; 20539 };
20514 Value.prototype.instanceOf$3$isTrue$forceCheck = function($0, $1, $2, isTrue, fo rceCheck) { 20540 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)); 20541 return this.instanceOf(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type ()), ($2 && $2.is$SourceSpan()), $assert_bool(isTrue), $assert_bool(forceCheck)) ;
20516 }; 20542 };
20517 Value.prototype.instanceOf$4 = function($0, $1, $2, $3) { 20543 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); 20544 return this.instanceOf(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Type ()), ($2 && $2.is$SourceSpan()), $assert_bool($3), false);
20519 }; 20545 };
20520 Value.prototype.invoke$4 = function($0, $1, $2, $3) { 20546 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); 20547 return this.invoke(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$lang_Node()), ($3 && $3.is$Arguments()), false);
20522 }; 20548 };
20523 Value.prototype.invoke$4$isDynamic = function($0, $1, $2, $3, isDynamic) { 20549 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)); 20550 return this.invoke(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$lang_Node()), ($3 && $3.is$Arguments()), $assert_bool(isDynamic));
20525 }; 20551 };
20526 Value.prototype.invoke$5 = function($0, $1, $2, $3, $4) { 20552 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)); 20553 return this.invoke(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$lang_Node()), ($3 && $3.is$Arguments()), $assert_bool($4));
20528 }; 20554 };
20529 Value.prototype.needsConversion$1 = function($0) { 20555 Value.prototype.needsConversion$1 = function($0) {
20530 return this.needsConversion(($0 && $0.is$Type())); 20556 return this.needsConversion(($0 && $0.is$lang_Type()));
20531 }; 20557 };
20532 Value.prototype.set_$4 = function($0, $1, $2, $3) { 20558 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); 20559 return this.set_(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $ 2.is$lang_Node()), ($3 && $3.is$Value()), false);
20534 }; 20560 };
20535 // ********** Code for EvaluatedValue ************** 20561 // ********** Code for EvaluatedValue **************
20536 function EvaluatedValue() {} 20562 function EvaluatedValue() {}
20537 EvaluatedValue._internal$ctor = function(type, actualValue, canonicalCode, span, code) { 20563 EvaluatedValue._internal$ctor = function(type, actualValue, canonicalCode, span, code) {
20538 this.actualValue = actualValue; 20564 this.actualValue = actualValue;
20539 this.canonicalCode = canonicalCode; 20565 this.canonicalCode = canonicalCode;
20540 // Initializers done 20566 // Initializers done
20541 Value.call(this, type, code, span, false); 20567 Value.call(this, type, code, span, false);
20542 } 20568 }
20543 EvaluatedValue._internal$ctor.prototype = EvaluatedValue.prototype; 20569 EvaluatedValue._internal$ctor.prototype = EvaluatedValue.prototype;
20544 $inherits(EvaluatedValue, Value); 20570 $inherits(EvaluatedValue, Value);
20545 EvaluatedValue.EvaluatedValue$factory = function(type, actualValue, canonicalCod e, span) { 20571 EvaluatedValue.EvaluatedValue$factory = function(type, actualValue, canonicalCod e, span) {
20546 return new EvaluatedValue._internal$ctor(type, actualValue, canonicalCode, spa n, EvaluatedValue.codeWithComments(canonicalCode, span)); 20572 return new EvaluatedValue._internal$ctor(type, actualValue, canonicalCode, spa n, EvaluatedValue.codeWithComments(canonicalCode, span));
20547 } 20573 }
20548 EvaluatedValue.prototype.get$actualValue = function() { return this.actualValue; }; 20574 EvaluatedValue.prototype.get$actualValue = function() { return this.actualValue; };
20549 EvaluatedValue.prototype.set$actualValue = function(value) { return this.actualV alue = value; }; 20575 EvaluatedValue.prototype.set$actualValue = function(value) { return this.actualV alue = value; };
20550 EvaluatedValue.prototype.get$isConst = function() { 20576 EvaluatedValue.prototype.get$isConst = function() {
20551 return true; 20577 return true;
20552 } 20578 }
20553 EvaluatedValue.prototype.get$canonicalCode = function() { return this.canonicalC ode; }; 20579 EvaluatedValue.prototype.get$canonicalCode = function() { return this.canonicalC ode; };
20554 EvaluatedValue.prototype.set$canonicalCode = function(value) { return this.canon icalCode = value; }; 20580 EvaluatedValue.prototype.set$canonicalCode = function(value) { return this.canon icalCode = value; };
20555 EvaluatedValue.codeWithComments = function(canonicalCode, span) { 20581 EvaluatedValue.codeWithComments = function(canonicalCode, span) {
20556 return (span != null && span.get$text() != canonicalCode) ? ('' + canonicalCod e + '/*' + span.get$text() + '*/') : canonicalCode; 20582 return (span != null && span.get$text() != canonicalCode) ? ('' + canonicalCod e + '/*' + span.get$text() + '*/') : canonicalCode;
20557 } 20583 }
20558 // ********** Code for ConstListValue ************** 20584 // ********** Code for ConstListValue **************
20559 function ConstListValue() {} 20585 function ConstListValue() {}
20560 ConstListValue._internal$ctor = function(type, values, actualValue, canonicalCod e, span, code) { 20586 ConstListValue._internal$ctor = function(type, values, actualValue, canonicalCod e, span, code) {
20561 this.values = values; 20587 this.values = values;
20562 // Initializers done 20588 // Initializers done
20563 EvaluatedValue._internal$ctor.call(this, (type && type.is$Type()), actualValue , canonicalCode, (span && span.is$SourceSpan()), $assert_String(code)); 20589 EvaluatedValue._internal$ctor.call(this, (type && type.is$lang_Type()), actual Value, canonicalCode, (span && span.is$SourceSpan()), $assert_String(code));
20564 } 20590 }
20565 ConstListValue._internal$ctor.prototype = ConstListValue.prototype; 20591 ConstListValue._internal$ctor.prototype = ConstListValue.prototype;
20566 $inherits(ConstListValue, EvaluatedValue); 20592 $inherits(ConstListValue, EvaluatedValue);
20567 ConstListValue.ConstListValue$factory = function(type, values, actualValue, cano nicalCode, span) { 20593 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)); 20594 return new ConstListValue._internal$ctor(type, values, actualValue, canonicalC ode, span, EvaluatedValue.codeWithComments(canonicalCode, span));
20569 } 20595 }
20570 // ********** Code for ConstMapValue ************** 20596 // ********** Code for ConstMapValue **************
20571 function ConstMapValue() {} 20597 function ConstMapValue() {}
20572 ConstMapValue._internal$ctor = function(type, values, actualValue, canonicalCode , span, code) { 20598 ConstMapValue._internal$ctor = function(type, values, actualValue, canonicalCode , span, code) {
20573 this.values = values; 20599 this.values = values;
20574 // Initializers done 20600 // Initializers done
20575 EvaluatedValue._internal$ctor.call(this, (type && type.is$Type()), actualValue , canonicalCode, (span && span.is$SourceSpan()), $assert_String(code)); 20601 EvaluatedValue._internal$ctor.call(this, (type && type.is$lang_Type()), actual Value, canonicalCode, (span && span.is$SourceSpan()), $assert_String(code));
20576 } 20602 }
20577 ConstMapValue._internal$ctor.prototype = ConstMapValue.prototype; 20603 ConstMapValue._internal$ctor.prototype = ConstMapValue.prototype;
20578 $inherits(ConstMapValue, EvaluatedValue); 20604 $inherits(ConstMapValue, EvaluatedValue);
20579 ConstMapValue.ConstMapValue$factory = function(type, keyValuePairs, actualValue, canonicalCode, span) { 20605 ConstMapValue.ConstMapValue$factory = function(type, keyValuePairs, actualValue, canonicalCode, span) {
20580 var values = new HashMapImplementation(); 20606 var values = new HashMapImplementation();
20581 for (var i = 0; 20607 for (var i = 0;
20582 i < keyValuePairs.length; i += 2) { 20608 i < keyValuePairs.length; i += 2) {
20583 values.$setindex(keyValuePairs.$index(i).get$actualValue(), keyValuePairs.$i ndex(i + 1)); 20609 values.$setindex(keyValuePairs.$index(i).get$actualValue(), keyValuePairs.$i ndex(i + 1));
20584 } 20610 }
20585 return new ConstMapValue._internal$ctor(type, values, actualValue, canonicalCo de, span, EvaluatedValue.codeWithComments(canonicalCode, span)); 20611 return new ConstMapValue._internal$ctor(type, values, actualValue, canonicalCo de, span, EvaluatedValue.codeWithComments(canonicalCode, span));
20586 } 20612 }
20587 // ********** Code for ConstObjectValue ************** 20613 // ********** Code for ConstObjectValue **************
20588 function ConstObjectValue() {} 20614 function ConstObjectValue() {}
20589 ConstObjectValue._internal$ctor = function(type, fields, actualValue, canonicalC ode, span, code) { 20615 ConstObjectValue._internal$ctor = function(type, fields, actualValue, canonicalC ode, span, code) {
20590 this.fields = fields; 20616 this.fields = fields;
20591 // Initializers done 20617 // Initializers done
20592 EvaluatedValue._internal$ctor.call(this, (type && type.is$Type()), actualValue , canonicalCode, (span && span.is$SourceSpan()), $assert_String(code)); 20618 EvaluatedValue._internal$ctor.call(this, (type && type.is$lang_Type()), actual Value, canonicalCode, (span && span.is$SourceSpan()), $assert_String(code));
20593 } 20619 }
20594 ConstObjectValue._internal$ctor.prototype = ConstObjectValue.prototype; 20620 ConstObjectValue._internal$ctor.prototype = ConstObjectValue.prototype;
20595 $inherits(ConstObjectValue, EvaluatedValue); 20621 $inherits(ConstObjectValue, EvaluatedValue);
20596 ConstObjectValue.ConstObjectValue$factory = function(type, fields, canonicalCode , span) { 20622 ConstObjectValue.ConstObjectValue$factory = function(type, fields, canonicalCode , span) {
20597 var fieldValues = []; 20623 var fieldValues = [];
20598 var $list = fields.getKeys(); 20624 var $list = fields.getKeys();
20599 for (var $i = fields.getKeys().iterator$0(); $i.hasNext$0(); ) { 20625 for (var $i = fields.getKeys().iterator$0(); $i.hasNext$0(); ) {
20600 var f = $i.next$0(); 20626 var f = $i.next$0();
20601 fieldValues.add(('' + f + ' = ' + fields.$index(f).get$actualValue() + '')); 20627 fieldValues.add(('' + f + ' = ' + fields.$index(f).get$actualValue() + ''));
20602 } 20628 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
20679 return this.compareTo(($0 && $0.is$GlobalValue())); 20705 return this.compareTo(($0 && $0.is$GlobalValue()));
20680 }; 20706 };
20681 // ********** Code for BareValue ************** 20707 // ********** Code for BareValue **************
20682 function BareValue(home, outermost, span) { 20708 function BareValue(home, outermost, span) {
20683 this.home = home; 20709 this.home = home;
20684 // Initializers done 20710 // Initializers done
20685 Value.call(this, outermost.method.declaringType, null, span, false); 20711 Value.call(this, outermost.method.declaringType, null, span, false);
20686 this.isType = outermost.get$isStatic(); 20712 this.isType = outermost.get$isStatic();
20687 } 20713 }
20688 $inherits(BareValue, Value); 20714 $inherits(BareValue, Value);
20715 BareValue.prototype._ensureCode = function() {
20716 if (this.code != null) return;
20717 if ($notnull_bool(this.isType)) {
20718 this.code = this.type.get$jsname();
20719 }
20720 else {
20721 this.code = this.home._makeThisCode();
20722 }
20723 }
20689 BareValue.prototype._tryResolveMember = function(context, name) { 20724 BareValue.prototype._tryResolveMember = function(context, name) {
20690 $assert($eq(context, this.home), "context == home", "value.dart", 688, 12); 20725 $assert($eq(context, this.home), "context == home", "value.dart", 699, 12);
20691 var member = this.type.resolveMember(name); 20726 var member = this.type.resolveMember(name);
20692 if ($notnull_bool($ne(member, null))) { 20727 if ($notnull_bool($ne(member, null))) {
20693 $assert(this.code == null, "code == null", "value.dart", 693, 14); 20728 this._ensureCode();
20694 if ($notnull_bool(this.isType)) {
20695 this.code = this.type.get$jsname();
20696 }
20697 else {
20698 this.code = this.home._makeThisCode();
20699 }
20700 return member; 20729 return member;
20701 } 20730 }
20702 member = this.home.get$library().lookup(name, this.span); 20731 member = this.home.get$library().lookup(name, this.span);
20703 if ($notnull_bool($ne(member, null))) { 20732 if ($notnull_bool($ne(member, null))) {
20704 return member; 20733 return member;
20705 } 20734 }
20735 this._ensureCode();
20706 return null; 20736 return null;
20707 } 20737 }
20708 // ********** Code for CompilerException ************** 20738 // ********** Code for CompilerException **************
20709 function CompilerException(_message, _location) { 20739 function CompilerException(_message, _location) {
20710 this._lang_message = _message; 20740 this._lang_message = _message;
20711 this._location = _location; 20741 this._location = _location;
20712 // Initializers done 20742 // Initializers done
20713 } 20743 }
20714 CompilerException.prototype.toString = function() { 20744 CompilerException.prototype.toString = function() {
20715 if (this._location != null) { 20745 if (this._location != null) {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
20856 throw exc; 20886 throw exc;
20857 } 20887 }
20858 } 20888 }
20859 this.printStatus(); 20889 this.printStatus();
20860 return !$notnull_bool(this.get$hasErrors()); 20890 return !$notnull_bool(this.get$hasErrors());
20861 } 20891 }
20862 World.prototype.runLeg = function() { 20892 World.prototype.runLeg = function() {
20863 var $this = this; // closure support 20893 var $this = this; // closure support
20864 if (!$notnull_bool(options.enableLeg)) return false; 20894 if (!$notnull_bool(options.enableLeg)) return false;
20865 var res = $assert_bool(this.withTiming('try leg compile', (function () { 20895 var res = $assert_bool(this.withTiming('try leg compile', (function () {
20866 return leg_compile($this); 20896 return compile($this);
20867 }) 20897 })
20868 )); 20898 ));
20869 if (!$notnull_bool(res) && $notnull_bool(options.legOnly)) { 20899 if (!$notnull_bool(res) && $notnull_bool(options.legOnly)) {
20870 this.fatal(("Leg could not compile " + options.dartScript + "")); 20900 this.fatal(("Leg could not compile " + options.dartScript + ""));
20871 return true; 20901 return true;
20872 } 20902 }
20873 return res; 20903 return res;
20874 } 20904 }
20875 World.prototype.runCompilationPhases = function() { 20905 World.prototype.runCompilationPhases = function() {
20876 var $this = this; // closure support 20906 var $this = this; // closure support
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
21182 VarMember.prototype.get$returnType = function() { 21212 VarMember.prototype.get$returnType = function() {
21183 return world.varType; 21213 return world.varType;
21184 } 21214 }
21185 VarMember.prototype.invoke = function(context, node, target, args) { 21215 VarMember.prototype.invoke = function(context, node, target, args) {
21186 return new Value(this.get$returnType(), ('' + target.code + '.' + this.name + '(' + args.getCode() + ')'), node.span, true); 21216 return new Value(this.get$returnType(), ('' + target.code + '.' + this.name + '(' + args.getCode() + ')'), node.span, true);
21187 } 21217 }
21188 VarMember.prototype.generate$1 = function($0) { 21218 VarMember.prototype.generate$1 = function($0) {
21189 return this.generate(($0 && $0.is$CodeWriter())); 21219 return this.generate(($0 && $0.is$CodeWriter()));
21190 }; 21220 };
21191 VarMember.prototype.invoke$4 = function($0, $1, $2, $3) { 21221 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())); 21222 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()));
21193 }; 21223 };
21194 // ********** Code for VarFunctionStub ************** 21224 // ********** Code for VarFunctionStub **************
21195 function VarFunctionStub(name, callArgs) { 21225 function VarFunctionStub(name, callArgs) {
21196 this.args = callArgs.toCallStubArgs(); 21226 this.args = callArgs.toCallStubArgs();
21197 // Initializers done 21227 // Initializers done
21198 VarMember.call(this, name); 21228 VarMember.call(this, name);
21199 world.gen.corejs.useGenStub = true; 21229 world.gen.corejs.useGenStub = true;
21200 } 21230 }
21201 $inherits(VarFunctionStub, VarMember); 21231 $inherits(VarFunctionStub, VarMember);
21202 VarFunctionStub.prototype.is$VarFunctionStub = function(){return this;}; 21232 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) { 21266 function VarMethodStub(name, member, args, body) {
21237 this.member = member; 21267 this.member = member;
21238 this.args = args; 21268 this.args = args;
21239 this.body = body; 21269 this.body = body;
21240 // Initializers done 21270 // Initializers done
21241 VarMember.call(this, name); 21271 VarMember.call(this, name);
21242 } 21272 }
21243 $inherits(VarMethodStub, VarMember); 21273 $inherits(VarMethodStub, VarMember);
21244 VarMethodStub.prototype.get$returnType = function() { 21274 VarMethodStub.prototype.get$returnType = function() {
21245 var $0; 21275 var $0;
21246 return (($0 = this.member != null ? this.member.get$returnType() : world.varTy pe) && $0.is$Type()); 21276 return (($0 = this.member != null ? this.member.get$returnType() : world.varTy pe) && $0.is$lang_Type());
21247 } 21277 }
21248 VarMethodStub.prototype.get$typeName = function() { 21278 VarMethodStub.prototype.get$typeName = function() {
21249 return this.member != null ? this.member.declaringType.get$jsname() : 'Object' ; 21279 return this.member != null ? this.member.declaringType.get$jsname() : 'Object' ;
21250 } 21280 }
21251 VarMethodStub.prototype.generate = function(code) { 21281 VarMethodStub.prototype.generate = function(code) {
21252 code.write(('' + this.get$typeName() + '.prototype.' + this.name + ' = ')); 21282 code.write(('' + this.get$typeName() + '.prototype.' + this.name + ' = '));
21253 this.generateBody(code, ';'); 21283 this.generateBody(code, ';');
21254 } 21284 }
21255 VarMethodStub.prototype.generateBody = function(code, end) { 21285 VarMethodStub.prototype.generateBody = function(code, end) {
21256 if ($notnull_bool(this._useDirectCall(this.member, this.args))) { 21286 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++) { 21342 for (var $i = 0;$i < $list.length; $i++) {
21313 var member = $list.$index($i); 21343 var member = $list.$index($i);
21314 var target = new Value(member.declaringType, 'this', node.span, true); 21344 var target = new Value(member.declaringType, 'this', node.span, true);
21315 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru e); 21345 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru e);
21316 var stub = new VarMethodStub(this.name, member, this.args, result); 21346 var stub = new VarMethodStub(this.name, member, this.args, result);
21317 var type = member.declaringType; 21347 var type = member.declaringType;
21318 if ($notnull_bool(type.get$isObject())) { 21348 if ($notnull_bool(type.get$isObject())) {
21319 objectStub = stub; 21349 objectStub = stub;
21320 } 21350 }
21321 else if ($ne(type.get$library(), world.get$dom())) { 21351 else if ($ne(type.get$library(), world.get$dom())) {
21322 VarMethodSet._addVarStub((type && type.is$Type()), (stub && stub.is$VarMem ber())); 21352 VarMethodSet._addVarStub((type && type.is$lang_Type()), (stub && stub.is$V arMember()));
21323 } 21353 }
21324 else { 21354 else {
21325 this._fallbackStubs.add(stub); 21355 this._fallbackStubs.add(stub);
21326 } 21356 }
21327 } 21357 }
21328 if ($notnull_bool(objectStub == null)) { 21358 if ($notnull_bool(objectStub == null)) {
21329 var target = new Value(world.objectType, 'this', node.span, true); 21359 var target = new Value(world.objectType, 'this', node.span, true);
21330 var result = target.invokeNoSuchMethod(context, this.get$baseName(), node, t his.args); 21360 var result = target.invokeNoSuchMethod(context, this.get$baseName(), node, t his.args);
21331 objectStub = new VarMethodStub(this.name, null, this.args, result); 21361 objectStub = new VarMethodStub(this.name, null, this.args, result);
21332 } 21362 }
(...skipping 18 matching lines...) Expand all
21351 var stub = $list.$index($i); 21381 var stub = $list.$index($i);
21352 code.write(('"' + stub.get$typeName() + '": ')); 21382 code.write(('"' + stub.get$typeName() + '": '));
21353 stub.generateBody$2(code, $notnull_bool($eq(stub, lastOne)) ? '' : ','); 21383 stub.generateBody$2(code, $notnull_bool($eq(stub, lastOne)) ? '' : ',');
21354 } 21384 }
21355 code.exitBlock('});'); 21385 code.exitBlock('});');
21356 } 21386 }
21357 VarMethodSet.prototype.generate$1 = function($0) { 21387 VarMethodSet.prototype.generate$1 = function($0) {
21358 return this.generate(($0 && $0.is$CodeWriter())); 21388 return this.generate(($0 && $0.is$CodeWriter()));
21359 }; 21389 };
21360 VarMethodSet.prototype.invoke$4 = function($0, $1, $2, $3) { 21390 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())); 21391 return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()));
21362 }; 21392 };
21363 // ********** Code for top level ************** 21393 // ********** Code for top level **************
21364 function map(source, mapper) { 21394 function map(source, mapper) {
21365 var result = new ListFactory(); 21395 var result = new ListFactory();
21366 if (!!(source && source.is$List)) { 21396 if (!!(source && source.is$List)) {
21367 var list = (source && source.is$List()); 21397 var list = (source && source.is$List());
21368 result.length = list.length; 21398 result.length = list.length;
21369 for (var i = 0; 21399 for (var i = 0;
21370 i < list.length; i++) { 21400 i < list.length; i++) {
21371 result.$setindex(i, mapper(list.$index(i))); 21401 result.$setindex(i, mapper(list.$index(i)));
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
21442 else { 21472 else {
21443 return text; 21473 return text;
21444 } 21474 }
21445 } 21475 }
21446 var world; 21476 var world;
21447 function initializeWorld(files) { 21477 function initializeWorld(files) {
21448 $assert(world == null, "world == null", "world.dart", 13, 10); 21478 $assert(world == null, "world == null", "world.dart", 13, 10);
21449 world = new World(files); 21479 world = new World(files);
21450 world.init(); 21480 world.init();
21451 } 21481 }
21452 function compile(homedir, args, files) { 21482 function lang_compile(homedir, args, files) {
21453 parseOptions(homedir, args, files); 21483 parseOptions(homedir, args, files);
21454 initializeWorld(files); 21484 initializeWorld(files);
21455 var success = world.compile(); 21485 var success = world.compile();
21456 if (options.outfile != null) { 21486 if (options.outfile != null) {
21457 if ($notnull_bool(success)) { 21487 if ($notnull_bool(success)) {
21458 var code = world.getGeneratedCode(); 21488 var code = world.getGeneratedCode();
21459 if (!options.outfile.endsWith('.js')) { 21489 if (!options.outfile.endsWith('.js')) {
21460 code = '#!/usr/bin/env node\n' + code; 21490 code = '#!/usr/bin/env node\n' + code;
21461 } 21491 }
21462 world.files.writeString(options.outfile, $assert_String(code)); 21492 world.files.writeString(options.outfile, $assert_String(code));
(...skipping 15 matching lines...) Expand all
21478 i < args.get$length(); i++) { 21508 i < args.get$length(); i++) {
21479 nameBuilder.add('\$').add(args.getName(i)); 21509 nameBuilder.add('\$').add(args.getName(i));
21480 } 21510 }
21481 return nameBuilder.toString(); 21511 return nameBuilder.toString();
21482 } 21512 }
21483 // ********** Library frog ************** 21513 // ********** Library frog **************
21484 // ********** Code for top level ************** 21514 // ********** Code for top level **************
21485 function main() { 21515 function main() {
21486 var homedir = path.dirname(fs.realpathSync($assert_String(process.argv.$index( 1)))); 21516 var homedir = path.dirname(fs.realpathSync($assert_String(process.argv.$index( 1))));
21487 var argv = ListFactory.ListFactory$from$factory(process.argv); 21517 var argv = ListFactory.ListFactory$from$factory(process.argv);
21488 if ($notnull_bool(compile($assert_String(homedir), (argv && argv.is$List$Strin g()), new NodeFileSystem()))) { 21518 if ($notnull_bool(lang_compile($assert_String(homedir), (argv && argv.is$List$ String()), new NodeFileSystem()))) {
21489 var code = world.getGeneratedCode(); 21519 var code = world.getGeneratedCode();
21490 if (!$notnull_bool(options.compileOnly)) { 21520 if (!$notnull_bool(options.compileOnly)) {
21491 process.argv = [argv.$index(0), argv.$index(1)]; 21521 process.argv = [argv.$index(0), argv.$index(1)];
21492 process.argv.addAll(options.childArgs); 21522 process.argv.addAll(options.childArgs);
21493 vm.runInNewContext($assert_String(code), createSandbox()); 21523 vm.runInNewContext($assert_String(code), createSandbox());
21494 } 21524 }
21495 } 21525 }
21496 else { 21526 else {
21497 process.exit(1); 21527 process.exit(1);
21498 } 21528 }
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
21786 INTERFACE, 21816 INTERFACE,
21787 LIBRARY, 21817 LIBRARY,
21788 NATIVE, 21818 NATIVE,
21789 NEGATE, 21819 NEGATE,
21790 OPERATOR, 21820 OPERATOR,
21791 SET, 21821 SET,
21792 SOURCE, 21822 SOURCE,
21793 STATIC, 21823 STATIC,
21794 TYPEDEF ]*/; 21824 TYPEDEF ]*/;
21795 main(); 21825 main();
OLDNEW
« no previous file with comments | « no previous file | frog/gen.dart » ('j') | frog/tokenizer.g.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698