| OLD | NEW |
| 1 #!/usr/bin/env node | 1 #!/usr/bin/env node |
| 2 // ********** Library dart:core ************** | 2 // ********** Library dart:core ************** |
| 3 // ********** Natives core.js ************** | 3 // ********** Natives core.js ************** |
| 4 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 4 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 5 // for details. All rights reserved. Use of this source code is governed by a | 5 // for details. All rights reserved. Use of this source code is governed by a |
| 6 // BSD-style license that can be found in the LICENSE file. | 6 // BSD-style license that can be found in the LICENSE file. |
| 7 | 7 |
| 8 // TODO(jimhug): Completeness - see tests/corelib | 8 // TODO(jimhug): Completeness - see tests/corelib |
| 9 | 9 |
| 10 /** Implements extends for dart classes on javascript prototypes. */ | 10 /** Implements extends for dart classes on javascript prototypes. */ |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 ListIterator.prototype.hasNext = function() { | 554 ListIterator.prototype.hasNext = function() { |
| 555 return this._array.length > this._pos; | 555 return this._array.length > this._pos; |
| 556 } | 556 } |
| 557 ListIterator.prototype.next = function() { | 557 ListIterator.prototype.next = function() { |
| 558 if (!this.hasNext()) { | 558 if (!this.hasNext()) { |
| 559 $throw(const$9/*const NoMoreElementsException()*/); | 559 $throw(const$9/*const NoMoreElementsException()*/); |
| 560 } | 560 } |
| 561 return this._array.$index(this._pos++); | 561 return this._array.$index(this._pos++); |
| 562 } | 562 } |
| 563 // ********** Code for ImmutableList ************** | 563 // ********** Code for ImmutableList ************** |
| 564 function ImmutableList(length) { | 564 function ImmutableList(length0) { |
| 565 this._length = length; | 565 this._length = length0; |
| 566 ListFactory$E.call(this, length); | 566 ListFactory$E.call(this, length0); |
| 567 // Initializers done | 567 // Initializers done |
| 568 } | 568 } |
| 569 $inherits(ImmutableList, ListFactory$E); | 569 $inherits(ImmutableList, ListFactory$E); |
| 570 ImmutableList.ImmutableList$from$factory = function(other) { | 570 ImmutableList.ImmutableList$from$factory = function(other) { |
| 571 var list = new ImmutableList(other.length); | 571 var list = new ImmutableList(other.length); |
| 572 for (var i = 0; | 572 for (var i = 0; |
| 573 i < other.length; i++) { | 573 i < other.length; i++) { |
| 574 list._setindex(i, other.$index(i)); | 574 list._setindex(i, other.$index(i)); |
| 575 } | 575 } |
| 576 return list; | 576 return list; |
| 577 } | 577 } |
| 578 ImmutableList.prototype.get$length = function() { | 578 ImmutableList.prototype.get$length = function() { |
| 579 return this._length; | 579 return this._length; |
| 580 } | 580 } |
| 581 ImmutableList.prototype.set$length = function(length) { | 581 ImmutableList.prototype.set$length = function(length0) { |
| 582 $throw(const$0/*const IllegalAccessException()*/); | 582 $throw(const$0/*const IllegalAccessException()*/); |
| 583 } | 583 } |
| 584 Object.defineProperty(ImmutableList.prototype, "length", { | 584 Object.defineProperty(ImmutableList.prototype, "length", { |
| 585 get: ImmutableList.prototype.get$length, | 585 get: ImmutableList.prototype.get$length, |
| 586 set: ImmutableList.prototype.set$length | 586 set: ImmutableList.prototype.set$length |
| 587 }); | 587 }); |
| 588 ImmutableList.prototype._setindex = function(index, value) { | 588 ImmutableList.prototype._setindex = function(index, value) { |
| 589 return this[index] = value; | 589 return this[index] = value; |
| 590 } | 590 } |
| 591 ImmutableList.prototype.$setindex = function(index, value) { | 591 ImmutableList.prototype.$setindex = function(index, value) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 this.ignoreCase = this.re.ignoreCase; | 648 this.ignoreCase = this.re.ignoreCase; |
| 649 } | 649 } |
| 650 JSSyntaxRegExp._create$ctor.prototype = JSSyntaxRegExp.prototype; | 650 JSSyntaxRegExp._create$ctor.prototype = JSSyntaxRegExp.prototype; |
| 651 JSSyntaxRegExp.prototype.firstMatch = function(str) { | 651 JSSyntaxRegExp.prototype.firstMatch = function(str) { |
| 652 var m = this.re.exec(str); | 652 var m = this.re.exec(str); |
| 653 return m && new MatchImplementation( | 653 return m && new MatchImplementation( |
| 654 this.pattern, str, m.index, this.re.lastIndex, m); | 654 this.pattern, str, m.index, this.re.lastIndex, m); |
| 655 } | 655 } |
| 656 // ********** Code for MatchImplementation ************** | 656 // ********** Code for MatchImplementation ************** |
| 657 function MatchImplementation() {} | 657 function MatchImplementation() {} |
| 658 MatchImplementation.prototype.$index = function(group) { | 658 MatchImplementation.prototype.$index = function(group0) { |
| 659 return this._groups.$index(group); | 659 return this._groups.$index(group0); |
| 660 } | 660 } |
| 661 // ********** Code for _AllMatchesIterable ************** | 661 // ********** Code for _AllMatchesIterable ************** |
| 662 function _AllMatchesIterable() {} | 662 function _AllMatchesIterable() {} |
| 663 _AllMatchesIterable.prototype.iterator = function() { | 663 _AllMatchesIterable.prototype.iterator = function() { |
| 664 return new _AllMatchesIterator(this._re, this._str); | 664 return new _AllMatchesIterator(this._re, this._str); |
| 665 } | 665 } |
| 666 // ********** Code for _AllMatchesIterator ************** | 666 // ********** Code for _AllMatchesIterator ************** |
| 667 function _AllMatchesIterator(re, _str) { | 667 function _AllMatchesIterator(re, _str) { |
| 668 this._str = _str; | 668 this._str = _str; |
| 669 this._done = false; | 669 this._done = false; |
| 670 this._re = new JSSyntaxRegExp._create$ctor(re.pattern, 'g' + (re.multiLine ? '
m' : '') + (re.ignoreCase ? 'i' : '')); | 670 this._re = new JSSyntaxRegExp._create$ctor(re.pattern, 'g' + (re.multiLine ? '
m' : '') + (re.ignoreCase ? 'i' : '')); |
| 671 // Initializers done | 671 // Initializers done |
| 672 } | 672 } |
| 673 _AllMatchesIterator.prototype.next = function() { | 673 _AllMatchesIterator.prototype.next = function() { |
| 674 if (!this.hasNext()) { | 674 if (!this.hasNext()) { |
| 675 $throw(const$9/*const NoMoreElementsException()*/); | 675 $throw(const$9/*const NoMoreElementsException()*/); |
| 676 } | 676 } |
| 677 var next = this._next; | 677 var next0 = this._next; |
| 678 this._next = null; | 678 this._next = null; |
| 679 return next; | 679 return next0; |
| 680 } | 680 } |
| 681 _AllMatchesIterator.prototype.hasNext = function() { | 681 _AllMatchesIterator.prototype.hasNext = function() { |
| 682 if (this._done) { | 682 if (this._done) { |
| 683 return false; | 683 return false; |
| 684 } | 684 } |
| 685 else if (this._next) { | 685 else if (this._next) { |
| 686 return true; | 686 return true; |
| 687 } | 687 } |
| 688 this._next = this._re.firstMatch(this._str); | 688 this._next = this._re.firstMatch(this._str); |
| 689 if (this._next == null) { | 689 if (this._next == null) { |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 var result = new HashMapImplementation(); | 841 var result = new HashMapImplementation(); |
| 842 other.forEach((function (key, value) { | 842 other.forEach((function (key, value) { |
| 843 result.$setindex(key, value); | 843 result.$setindex(key, value); |
| 844 }) | 844 }) |
| 845 ); | 845 ); |
| 846 return result; | 846 return result; |
| 847 } | 847 } |
| 848 HashMapImplementation._computeLoadLimit = function(capacity) { | 848 HashMapImplementation._computeLoadLimit = function(capacity) { |
| 849 return $truncdiv((capacity * 3), 4); | 849 return $truncdiv((capacity * 3), 4); |
| 850 } | 850 } |
| 851 HashMapImplementation._firstProbe = function(hashCode, length) { | 851 HashMapImplementation._firstProbe = function(hashCode, length0) { |
| 852 return hashCode & (length - 1); | 852 return hashCode & (length0 - 1); |
| 853 } | 853 } |
| 854 HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length
) { | 854 HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length
0) { |
| 855 return (currentProbe + numberOfProbes) & (length - 1); | 855 return (currentProbe + numberOfProbes) & (length0 - 1); |
| 856 } | 856 } |
| 857 HashMapImplementation.prototype._probeForAdding = function(key) { | 857 HashMapImplementation.prototype._probeForAdding = function(key) { |
| 858 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length
); | 858 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length
); |
| 859 var numberOfProbes = 1; | 859 var numberOfProbes = 1; |
| 860 var initialHash = hash; | 860 var initialHash = hash; |
| 861 var insertionIndex = -1; | 861 var insertionIndex = -1; |
| 862 while (true) { | 862 while (true) { |
| 863 var existingKey = this._keys.$index(hash); | 863 var existingKey = this._keys.$index(hash); |
| 864 if (existingKey == null) { | 864 if (existingKey == null) { |
| 865 if (insertionIndex < 0) return hash; | 865 if (insertionIndex < 0) return hash; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 HashMapImplementation.prototype.isEmpty = function() { | 950 HashMapImplementation.prototype.isEmpty = function() { |
| 951 return this._numberOfEntries == 0; | 951 return this._numberOfEntries == 0; |
| 952 } | 952 } |
| 953 HashMapImplementation.prototype.get$length = function() { | 953 HashMapImplementation.prototype.get$length = function() { |
| 954 return this._numberOfEntries; | 954 return this._numberOfEntries; |
| 955 } | 955 } |
| 956 Object.defineProperty(HashMapImplementation.prototype, "length", { | 956 Object.defineProperty(HashMapImplementation.prototype, "length", { |
| 957 get: HashMapImplementation.prototype.get$length, | 957 get: HashMapImplementation.prototype.get$length, |
| 958 }); | 958 }); |
| 959 HashMapImplementation.prototype.forEach = function(f) { | 959 HashMapImplementation.prototype.forEach = function(f) { |
| 960 var length = this._keys.length; | 960 var length0 = this._keys.length; |
| 961 for (var i = 0; | 961 for (var i = 0; |
| 962 i < length; i++) { | 962 i < length0; i++) { |
| 963 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== HashMapImple
mentation._deletedKey)) { | 963 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== HashMapImple
mentation._deletedKey)) { |
| 964 f(this._keys.$index(i), this._values.$index(i)); | 964 f(this._keys.$index(i), this._values.$index(i)); |
| 965 } | 965 } |
| 966 } | 966 } |
| 967 } | 967 } |
| 968 HashMapImplementation.prototype.getKeys = function() { | 968 HashMapImplementation.prototype.getKeys = function() { |
| 969 var list = new ListFactory$K(this.get$length()); | 969 var list = new ListFactory$K(this.get$length()); |
| 970 var i = 0; | 970 var i = 0; |
| 971 this.forEach(function _(key, value) { | 971 this.forEach(function _(key, value) { |
| 972 list.$setindex(i++, key); | 972 list.$setindex(i++, key); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 996 this._numberOfEntries = 0; | 996 this._numberOfEntries = 0; |
| 997 this._numberOfDeleted = 0; | 997 this._numberOfDeleted = 0; |
| 998 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); | 998 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); |
| 999 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 999 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
| 1000 this._values = new ListFactory$E(8/*HashMapImplementation._INITIAL_CAPACITY*/)
; | 1000 this._values = new ListFactory$E(8/*HashMapImplementation._INITIAL_CAPACITY*/)
; |
| 1001 } | 1001 } |
| 1002 $inherits(HashMapImplementation$E$E, HashMapImplementation); | 1002 $inherits(HashMapImplementation$E$E, HashMapImplementation); |
| 1003 HashMapImplementation$E$E._computeLoadLimit = function(capacity) { | 1003 HashMapImplementation$E$E._computeLoadLimit = function(capacity) { |
| 1004 return $truncdiv((capacity * 3), 4); | 1004 return $truncdiv((capacity * 3), 4); |
| 1005 } | 1005 } |
| 1006 HashMapImplementation$E$E._firstProbe = function(hashCode, length) { | 1006 HashMapImplementation$E$E._firstProbe = function(hashCode, length0) { |
| 1007 return hashCode & (length - 1); | 1007 return hashCode & (length0 - 1); |
| 1008 } | 1008 } |
| 1009 HashMapImplementation$E$E._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { | 1009 HashMapImplementation$E$E._nextProbe = function(currentProbe, numberOfProbes, le
ngth0) { |
| 1010 return (currentProbe + numberOfProbes) & (length - 1); | 1010 return (currentProbe + numberOfProbes) & (length0 - 1); |
| 1011 } | 1011 } |
| 1012 HashMapImplementation$E$E.prototype._probeForAdding = function(key) { | 1012 HashMapImplementation$E$E.prototype._probeForAdding = function(key) { |
| 1013 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length
); | 1013 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length
); |
| 1014 var numberOfProbes = 1; | 1014 var numberOfProbes = 1; |
| 1015 var initialHash = hash; | 1015 var initialHash = hash; |
| 1016 var insertionIndex = -1; | 1016 var insertionIndex = -1; |
| 1017 while (true) { | 1017 while (true) { |
| 1018 var existingKey = this._keys.$index(hash); | 1018 var existingKey = this._keys.$index(hash); |
| 1019 if (existingKey == null) { | 1019 if (existingKey == null) { |
| 1020 if (insertionIndex < 0) return hash; | 1020 if (insertionIndex < 0) return hash; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 this._keys.$setindex(index, HashMapImplementation._deletedKey); | 1094 this._keys.$setindex(index, HashMapImplementation._deletedKey); |
| 1095 this._numberOfDeleted++; | 1095 this._numberOfDeleted++; |
| 1096 return value; | 1096 return value; |
| 1097 } | 1097 } |
| 1098 return null; | 1098 return null; |
| 1099 } | 1099 } |
| 1100 HashMapImplementation$E$E.prototype.isEmpty = function() { | 1100 HashMapImplementation$E$E.prototype.isEmpty = function() { |
| 1101 return this._numberOfEntries == 0; | 1101 return this._numberOfEntries == 0; |
| 1102 } | 1102 } |
| 1103 HashMapImplementation$E$E.prototype.forEach = function(f) { | 1103 HashMapImplementation$E$E.prototype.forEach = function(f) { |
| 1104 var length = this._keys.length; | 1104 var length0 = this._keys.length; |
| 1105 for (var i = 0; | 1105 for (var i = 0; |
| 1106 i < length; i++) { | 1106 i < length0; i++) { |
| 1107 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== HashMapImple
mentation._deletedKey)) { | 1107 if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== HashMapImple
mentation._deletedKey)) { |
| 1108 f(this._keys.$index(i), this._values.$index(i)); | 1108 f(this._keys.$index(i), this._values.$index(i)); |
| 1109 } | 1109 } |
| 1110 } | 1110 } |
| 1111 } | 1111 } |
| 1112 HashMapImplementation$E$E.prototype.getKeys = function() { | 1112 HashMapImplementation$E$E.prototype.getKeys = function() { |
| 1113 var list = new ListFactory$E(this.get$length()); | 1113 var list = new ListFactory$E(this.get$length()); |
| 1114 var i = 0; | 1114 var i = 0; |
| 1115 this.forEach(function _(key, value) { | 1115 this.forEach(function _(key, value) { |
| 1116 list.$setindex(i++, key); | 1116 list.$setindex(i++, key); |
| (...skipping 3990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5107 this.listener.beginLibraryTag(token); | 5107 this.listener.beginLibraryTag(token); |
| 5108 token = this.parseIdentifier(this.next(token)); | 5108 token = this.parseIdentifier(this.next(token)); |
| 5109 token = this.expect(const$358/*const SourceString("(")*/, token); | 5109 token = this.expect(const$358/*const SourceString("(")*/, token); |
| 5110 while (token != null && token.kind != 40/*null.LPAREN_TOKEN*/ && token.kind !=
41/*null.RPAREN_TOKEN*/) { | 5110 while (token != null && token.kind != 40/*null.LPAREN_TOKEN*/ && token.kind !=
41/*null.RPAREN_TOKEN*/) { |
| 5111 token = this.next(token); | 5111 token = this.next(token); |
| 5112 } | 5112 } |
| 5113 token = this.expect(const$359/*const SourceString(")")*/, token); | 5113 token = this.expect(const$359/*const SourceString(")")*/, token); |
| 5114 return this.expect(const$360/*const SourceString(";")*/, token); | 5114 return this.expect(const$360/*const SourceString(";")*/, token); |
| 5115 } | 5115 } |
| 5116 // ********** Code for BodyParser ************** | 5116 // ********** Code for BodyParser ************** |
| 5117 function BodyParser(listener) { | 5117 function BodyParser(listener0) { |
| 5118 Parser.call(this, listener); | 5118 Parser.call(this, listener0); |
| 5119 // Initializers done | 5119 // Initializers done |
| 5120 } | 5120 } |
| 5121 $inherits(BodyParser, Parser); | 5121 $inherits(BodyParser, Parser); |
| 5122 BodyParser.prototype.parseFunction = function(token) { | 5122 BodyParser.prototype.parseFunction = function(token) { |
| 5123 this.listener.beginFunction(token); | 5123 this.listener.beginFunction(token); |
| 5124 token = this.parseReturnTypeOpt(token); | 5124 token = this.parseReturnTypeOpt(token); |
| 5125 this.listener.beginFunctionName(token); | 5125 this.listener.beginFunctionName(token); |
| 5126 token = this.parseIdentifier(token); | 5126 token = this.parseIdentifier(token); |
| 5127 this.listener.endFunctionName(token); | 5127 this.listener.endFunctionName(token); |
| 5128 token = this.parseFormalParameters(token); | 5128 token = this.parseFormalParameters(token); |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5379 this.beginToken = beginToken; | 5379 this.beginToken = beginToken; |
| 5380 this.builderFunction = builderFunction; | 5380 this.builderFunction = builderFunction; |
| 5381 // Initializers done | 5381 // Initializers done |
| 5382 } | 5382 } |
| 5383 DeclarationBuilder.prototype.get$name = function() { return this.name; }; | 5383 DeclarationBuilder.prototype.get$name = function() { return this.name; }; |
| 5384 DeclarationBuilder.prototype.set$name = function(value) { return this.name = val
ue; }; | 5384 DeclarationBuilder.prototype.set$name = function(value) { return this.name = val
ue; }; |
| 5385 DeclarationBuilder.prototype.build = function() { | 5385 DeclarationBuilder.prototype.build = function() { |
| 5386 return (this.builderFunction)(this); | 5386 return (this.builderFunction)(this); |
| 5387 } | 5387 } |
| 5388 // ********** Code for PartialFunctionElement ************** | 5388 // ********** Code for PartialFunctionElement ************** |
| 5389 function PartialFunctionElement(name, beginToken, endToken) { | 5389 function PartialFunctionElement(name0, beginToken, endToken) { |
| 5390 this.beginToken = beginToken; | 5390 this.beginToken = beginToken; |
| 5391 this.endToken = endToken; | 5391 this.endToken = endToken; |
| 5392 Element.call(this, name); | 5392 Element.call(this, name0); |
| 5393 // Initializers done | 5393 // Initializers done |
| 5394 } | 5394 } |
| 5395 $inherits(PartialFunctionElement, Element); | 5395 $inherits(PartialFunctionElement, Element); |
| 5396 PartialFunctionElement.prototype.parseNode = function(canceler, logger) { | 5396 PartialFunctionElement.prototype.parseNode = function(canceler, logger) { |
| 5397 if (this.node == null) { | 5397 if (this.node == null) { |
| 5398 var listener = new BodyListener(canceler, logger); | 5398 var listener = new BodyListener(canceler, logger); |
| 5399 new BodyParser(listener).parseFunction(this.beginToken); | 5399 new BodyParser(listener).parseFunction(this.beginToken); |
| 5400 logger.log(("parsed function: " + listener.functionExpression + "")); | 5400 logger.log(("parsed function: " + listener.functionExpression + "")); |
| 5401 this.node = listener.functionExpression; | 5401 this.node = listener.functionExpression; |
| 5402 } | 5402 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5435 var head = this.expressions.get$head(); | 5435 var head = this.expressions.get$head(); |
| 5436 this.expressions = this.expressions.get$tail(); | 5436 this.expressions = this.expressions.get$tail(); |
| 5437 return head; | 5437 return head; |
| 5438 } | 5438 } |
| 5439 ExpressionContext.prototype.popAll = function() { | 5439 ExpressionContext.prototype.popAll = function() { |
| 5440 var result = this.expressions; | 5440 var result = this.expressions; |
| 5441 this.expressions = const$351/*const EmptyLink<DeclarationBuilder>()*/; | 5441 this.expressions = const$351/*const EmptyLink<DeclarationBuilder>()*/; |
| 5442 return result; | 5442 return result; |
| 5443 } | 5443 } |
| 5444 // ********** Code for BodyListener ************** | 5444 // ********** Code for BodyListener ************** |
| 5445 function BodyListener(canceler, logger) { | 5445 function BodyListener(canceler0, logger) { |
| 5446 this.logger = logger; | 5446 this.logger = logger; |
| 5447 this.expressionContext = new ExpressionContext(null); | 5447 this.expressionContext = new ExpressionContext(null); |
| 5448 Listener.call(this, canceler); | 5448 Listener.call(this, canceler0); |
| 5449 // Initializers done | 5449 // Initializers done |
| 5450 } | 5450 } |
| 5451 $inherits(BodyListener, Listener); | 5451 $inherits(BodyListener, Listener); |
| 5452 BodyListener.prototype.beginFormalParameters = function(token) { | 5452 BodyListener.prototype.beginFormalParameters = function(token) { |
| 5453 this.functionContext.beginFormalsToken = token; | 5453 this.functionContext.beginFormalsToken = token; |
| 5454 } | 5454 } |
| 5455 BodyListener.prototype.endFormalParameters = function(token) { | 5455 BodyListener.prototype.endFormalParameters = function(token) { |
| 5456 this.functionContext.buildFormals(token); | 5456 this.functionContext.buildFormals(token); |
| 5457 } | 5457 } |
| 5458 BodyListener.prototype.beginArguments = function(token) { | 5458 BodyListener.prototype.beginArguments = function(token) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5569 // ********** Code for Token ************** | 5569 // ********** Code for Token ************** |
| 5570 function Token(kind, charOffset) { | 5570 function Token(kind, charOffset) { |
| 5571 this.kind = kind; | 5571 this.kind = kind; |
| 5572 this.charOffset = charOffset; | 5572 this.charOffset = charOffset; |
| 5573 // Initializers done | 5573 // Initializers done |
| 5574 } | 5574 } |
| 5575 Token.prototype.toString = function() { | 5575 Token.prototype.toString = function() { |
| 5576 return Strings.String$fromCharCodes$factory([this.kind]); | 5576 return Strings.String$fromCharCodes$factory([this.kind]); |
| 5577 } | 5577 } |
| 5578 // ********** Code for KeywordToken ************** | 5578 // ********** Code for KeywordToken ************** |
| 5579 function KeywordToken(value, charOffset) { | 5579 function KeywordToken(value, charOffset0) { |
| 5580 this.value = value; | 5580 this.value = value; |
| 5581 Token.call(this, 107/*null.KEYWORD_TOKEN*/, charOffset); | 5581 Token.call(this, 107/*null.KEYWORD_TOKEN*/, charOffset0); |
| 5582 // Initializers done | 5582 // Initializers done |
| 5583 } | 5583 } |
| 5584 $inherits(KeywordToken, Token); | 5584 $inherits(KeywordToken, Token); |
| 5585 KeywordToken.prototype.get$value = function() { return this.value; }; | 5585 KeywordToken.prototype.get$value = function() { return this.value; }; |
| 5586 KeywordToken.prototype.toString = function() { | 5586 KeywordToken.prototype.toString = function() { |
| 5587 return this.value.syntax; | 5587 return this.value.syntax; |
| 5588 } | 5588 } |
| 5589 // ********** Code for StringToken ************** | 5589 // ********** Code for StringToken ************** |
| 5590 function StringToken(kind, value, charOffset) { | 5590 function StringToken(kind0, value0, charOffset0) { |
| 5591 this.value = new StringWrapper(value); | 5591 this.value = new StringWrapper(value0); |
| 5592 Token.call(this, kind, charOffset); | 5592 Token.call(this, kind0, charOffset0); |
| 5593 // Initializers done | 5593 // Initializers done |
| 5594 } | 5594 } |
| 5595 $inherits(StringToken, Token); | 5595 $inherits(StringToken, Token); |
| 5596 StringToken.prototype.get$value = function() { return this.value; }; | 5596 StringToken.prototype.get$value = function() { return this.value; }; |
| 5597 StringToken.prototype.toString = function() { | 5597 StringToken.prototype.toString = function() { |
| 5598 return this.value.toString(); | 5598 return this.value.toString(); |
| 5599 } | 5599 } |
| 5600 // ********** Code for StringWrapper ************** | 5600 // ********** Code for StringWrapper ************** |
| 5601 function StringWrapper(internalString) { | 5601 function StringWrapper(internalString) { |
| 5602 this.internalString = internalString; | 5602 this.internalString = internalString; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 5620 } | 5620 } |
| 5621 Keyword.prototype.is$SourceString = function(){return this;}; | 5621 Keyword.prototype.is$SourceString = function(){return this;}; |
| 5622 Keyword.get$keywords = function() { | 5622 Keyword.get$keywords = function() { |
| 5623 if (Keyword._keywords == null) { | 5623 if (Keyword._keywords == null) { |
| 5624 Keyword._keywords = Keyword.computeKeywordMap(); | 5624 Keyword._keywords = Keyword.computeKeywordMap(); |
| 5625 } | 5625 } |
| 5626 return Keyword._keywords; | 5626 return Keyword._keywords; |
| 5627 } | 5627 } |
| 5628 Keyword.computeKeywordMap = function() { | 5628 Keyword.computeKeywordMap = function() { |
| 5629 var result = new LinkedHashMapImplementation$String$Keyword(); | 5629 var result = new LinkedHashMapImplementation$String$Keyword(); |
| 5630 for (var $i = const$347/*Keyword.values*/.iterator(); $i.hasNext(); ) { | 5630 for (var $i0 = const$347/*Keyword.values*/.iterator(); $i0.hasNext(); ) { |
| 5631 var keyword = $i.next(); | 5631 var keyword = $i0.next(); |
| 5632 result.$setindex(keyword.syntax, keyword); | 5632 result.$setindex(keyword.syntax, keyword); |
| 5633 } | 5633 } |
| 5634 return result; | 5634 return result; |
| 5635 } | 5635 } |
| 5636 Keyword.prototype.hashCode = function() { | 5636 Keyword.prototype.hashCode = function() { |
| 5637 return this.syntax.hashCode(); | 5637 return this.syntax.hashCode(); |
| 5638 } | 5638 } |
| 5639 Keyword.prototype.$eq = function(other) { | 5639 Keyword.prototype.$eq = function(other) { |
| 5640 return !!(other && other.is$SourceString) && this.toString() == other.toString
(); | 5640 return !!(other && other.is$SourceString) && this.toString() == other.toString
(); |
| 5641 } | 5641 } |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5881 Identifier.prototype.get$source = function() { | 5881 Identifier.prototype.get$source = function() { |
| 5882 return this.token.get$value(); | 5882 return this.token.get$value(); |
| 5883 } | 5883 } |
| 5884 Identifier.prototype.accept = function(visitor) { | 5884 Identifier.prototype.accept = function(visitor) { |
| 5885 return visitor.visitIdentifier(this); | 5885 return visitor.visitIdentifier(this); |
| 5886 } | 5886 } |
| 5887 Identifier.prototype.get$beginToken = function() { | 5887 Identifier.prototype.get$beginToken = function() { |
| 5888 return this.token; | 5888 return this.token; |
| 5889 } | 5889 } |
| 5890 // ********** Code for Operator ************** | 5890 // ********** Code for Operator ************** |
| 5891 function Operator(token) { | 5891 function Operator(token0) { |
| 5892 Identifier.call(this, token); | 5892 Identifier.call(this, token0); |
| 5893 // Initializers done | 5893 // Initializers done |
| 5894 } | 5894 } |
| 5895 $inherits(Operator, Identifier); | 5895 $inherits(Operator, Identifier); |
| 5896 Operator.prototype.accept = function(visitor) { | 5896 Operator.prototype.accept = function(visitor) { |
| 5897 return visitor.visitOperator(this); | 5897 return visitor.visitOperator(this); |
| 5898 } | 5898 } |
| 5899 Operator.prototype.get$beginToken = function() { | 5899 Operator.prototype.get$beginToken = function() { |
| 5900 return this.token; | 5900 return this.token; |
| 5901 } | 5901 } |
| 5902 // ********** Code for Parameter ************** | 5902 // ********** Code for Parameter ************** |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5965 this.enclosingElement = enclosingElement; | 5965 this.enclosingElement = enclosingElement; |
| 5966 // Initializers done | 5966 // Initializers done |
| 5967 } | 5967 } |
| 5968 Element.prototype.get$name = function() { return this.name; }; | 5968 Element.prototype.get$name = function() { return this.name; }; |
| 5969 Element.prototype.hashCode = function() { | 5969 Element.prototype.hashCode = function() { |
| 5970 return this.name.hashCode(); | 5970 return this.name.hashCode(); |
| 5971 } | 5971 } |
| 5972 // ********** Code for top level ************** | 5972 // ********** Code for top level ************** |
| 5973 // ********** Library ssa ************** | 5973 // ********** Library ssa ************** |
| 5974 // ********** Code for SsaBuilderTask ************** | 5974 // ********** Code for SsaBuilderTask ************** |
| 5975 function SsaBuilderTask(pipeline) { | 5975 function SsaBuilderTask(pipeline0) { |
| 5976 CompilerTask.call(this, pipeline); | 5976 CompilerTask.call(this, pipeline0); |
| 5977 // Initializers done | 5977 // Initializers done |
| 5978 } | 5978 } |
| 5979 $inherits(SsaBuilderTask, CompilerTask); | 5979 $inherits(SsaBuilderTask, CompilerTask); |
| 5980 SsaBuilderTask.prototype.get$name = function() { | 5980 SsaBuilderTask.prototype.get$name = function() { |
| 5981 return 'SSA builder'; | 5981 return 'SSA builder'; |
| 5982 } | 5982 } |
| 5983 SsaBuilderTask.prototype.build = function(tree) { | 5983 SsaBuilderTask.prototype.build = function(tree) { |
| 5984 var $this = this; // closure support | 5984 var $this = this; // closure support |
| 5985 return this.measure((function () { | 5985 return this.measure((function () { |
| 5986 var function_ = tree; | 5986 var function_ = tree; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6071 } | 6071 } |
| 6072 SsaBuilder.prototype.visitReturn = function(node) { | 6072 SsaBuilder.prototype.visitReturn = function(node) { |
| 6073 this.visit(node.expression); | 6073 this.visit(node.expression); |
| 6074 var value = this.pop(); | 6074 var value = this.pop(); |
| 6075 this.add(new HReturn(value)); | 6075 this.add(new HReturn(value)); |
| 6076 } | 6076 } |
| 6077 SsaBuilder.prototype.visitTypeAnnotation = function(node) { | 6077 SsaBuilder.prototype.visitTypeAnnotation = function(node) { |
| 6078 | 6078 |
| 6079 } | 6079 } |
| 6080 // ********** Code for SsaCodeGeneratorTask ************** | 6080 // ********** Code for SsaCodeGeneratorTask ************** |
| 6081 function SsaCodeGeneratorTask(pipeline) { | 6081 function SsaCodeGeneratorTask(pipeline0) { |
| 6082 CompilerTask.call(this, pipeline); | 6082 CompilerTask.call(this, pipeline0); |
| 6083 // Initializers done | 6083 // Initializers done |
| 6084 } | 6084 } |
| 6085 $inherits(SsaCodeGeneratorTask, CompilerTask); | 6085 $inherits(SsaCodeGeneratorTask, CompilerTask); |
| 6086 SsaCodeGeneratorTask.prototype.get$name = function() { | 6086 SsaCodeGeneratorTask.prototype.get$name = function() { |
| 6087 return 'SSA code generator'; | 6087 return 'SSA code generator'; |
| 6088 } | 6088 } |
| 6089 SsaCodeGeneratorTask.prototype.generate = function(tree, graph) { | 6089 SsaCodeGeneratorTask.prototype.generate = function(tree, graph) { |
| 6090 var $this = this; // closure support | 6090 var $this = this; // closure support |
| 6091 return this.measure((function () { | 6091 return this.measure((function () { |
| 6092 var function_ = tree; | 6092 var function_ = tree; |
| 6093 var name = function_.name; | 6093 var name0 = function_.name; |
| 6094 var code = $this.generateMethod(name.get$source(), graph); | 6094 var code = $this.generateMethod(name0.get$source(), graph); |
| 6095 return code; | 6095 return code; |
| 6096 }) | 6096 }) |
| 6097 ); | 6097 ); |
| 6098 } | 6098 } |
| 6099 SsaCodeGeneratorTask.prototype.generateMethod = function(methodName, graph) { | 6099 SsaCodeGeneratorTask.prototype.generateMethod = function(methodName, graph) { |
| 6100 var buffer = new StringBufferImpl(""); | 6100 var buffer = new StringBufferImpl(""); |
| 6101 var codegen = new SsaCodeGenerator(this.pipeline, buffer); | 6101 var codegen = new SsaCodeGenerator(this.pipeline, buffer); |
| 6102 graph.number(); | 6102 graph.number(); |
| 6103 codegen.visitGraph(graph); | 6103 codegen.visitGraph(graph); |
| 6104 return ('function ' + methodName + '() {\n' + buffer + '}\n'); | 6104 return ('function ' + methodName + '() {\n' + buffer + '}\n'); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6253 } | 6253 } |
| 6254 $inherits(HBaseVisitor, HGraphVisitor); | 6254 $inherits(HBaseVisitor, HGraphVisitor); |
| 6255 HBaseVisitor.prototype.visitBasicBlock = function(node) { | 6255 HBaseVisitor.prototype.visitBasicBlock = function(node) { |
| 6256 this.currentBlock = node; | 6256 this.currentBlock = node; |
| 6257 var instruction = node.first; | 6257 var instruction = node.first; |
| 6258 while (instruction != null) { | 6258 while (instruction != null) { |
| 6259 instruction.accept(this); | 6259 instruction.accept(this); |
| 6260 instruction = instruction.next; | 6260 instruction = instruction.next; |
| 6261 } | 6261 } |
| 6262 } | 6262 } |
| 6263 HBaseVisitor.prototype.visitInstruction = function(HInstruction) { | 6263 HBaseVisitor.prototype.visitInstruction = function(HInstruction0) { |
| 6264 | 6264 |
| 6265 } | 6265 } |
| 6266 HBaseVisitor.prototype.visitAdd = function(node) { | 6266 HBaseVisitor.prototype.visitAdd = function(node) { |
| 6267 return this.visitInvoke(node); | 6267 return this.visitInvoke(node); |
| 6268 } | 6268 } |
| 6269 HBaseVisitor.prototype.visitGoto = function(node) { | 6269 HBaseVisitor.prototype.visitGoto = function(node) { |
| 6270 return this.visitInstruction(node); | 6270 return this.visitInstruction(node); |
| 6271 } | 6271 } |
| 6272 HBaseVisitor.prototype.visitInvoke = function(node) { | 6272 HBaseVisitor.prototype.visitInvoke = function(node) { |
| 6273 return this.visitInstruction(node); | 6273 return this.visitInstruction(node); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6398 } | 6398 } |
| 6399 } | 6399 } |
| 6400 this._usedBy = null; | 6400 this._usedBy = null; |
| 6401 } | 6401 } |
| 6402 HInstruction.prototype.isValid = function() { | 6402 HInstruction.prototype.isValid = function() { |
| 6403 var validator = new HValidator(); | 6403 var validator = new HValidator(); |
| 6404 validator.visitInstruction(this); | 6404 validator.visitInstruction(this); |
| 6405 return validator.isValid; | 6405 return validator.isValid; |
| 6406 } | 6406 } |
| 6407 // ********** Code for HInvoke ************** | 6407 // ********** Code for HInvoke ************** |
| 6408 function HInvoke(selector, inputs) { | 6408 function HInvoke(selector, inputs0) { |
| 6409 this.selector = selector; | 6409 this.selector = selector; |
| 6410 HInstruction.call(this, inputs); | 6410 HInstruction.call(this, inputs0); |
| 6411 // Initializers done | 6411 // Initializers done |
| 6412 } | 6412 } |
| 6413 $inherits(HInvoke, HInstruction); | 6413 $inherits(HInvoke, HInstruction); |
| 6414 HInvoke.prototype.toString = function() { | 6414 HInvoke.prototype.toString = function() { |
| 6415 return ('invoke: ' + this.selector + ''); | 6415 return ('invoke: ' + this.selector + ''); |
| 6416 } | 6416 } |
| 6417 HInvoke.prototype.hasSideEffects = function() { | 6417 HInvoke.prototype.hasSideEffects = function() { |
| 6418 return true; | 6418 return true; |
| 6419 } | 6419 } |
| 6420 HInvoke.prototype.accept = function(visitor) { | 6420 HInvoke.prototype.accept = function(visitor) { |
| 6421 return visitor.visitInvoke(this); | 6421 return visitor.visitInvoke(this); |
| 6422 } | 6422 } |
| 6423 // ********** Code for HAdd ************** | 6423 // ********** Code for HAdd ************** |
| 6424 function HAdd(inputs) { | 6424 function HAdd(inputs0) { |
| 6425 HInvoke.call(this, const$370/*const SourceString('+')*/, inputs); | 6425 HInvoke.call(this, const$370/*const SourceString('+')*/, inputs0); |
| 6426 // Initializers done | 6426 // Initializers done |
| 6427 } | 6427 } |
| 6428 $inherits(HAdd, HInvoke); | 6428 $inherits(HAdd, HInvoke); |
| 6429 HAdd.prototype.hasSideEffects = function() { | 6429 HAdd.prototype.hasSideEffects = function() { |
| 6430 return true; | 6430 return true; |
| 6431 } | 6431 } |
| 6432 HAdd.prototype.accept = function(visitor) { | 6432 HAdd.prototype.accept = function(visitor) { |
| 6433 return visitor.visitAdd(this); | 6433 return visitor.visitAdd(this); |
| 6434 } | 6434 } |
| 6435 // ********** Code for HGoto ************** | 6435 // ********** Code for HGoto ************** |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6470 HReturn.prototype.toString = function() { | 6470 HReturn.prototype.toString = function() { |
| 6471 return 'return'; | 6471 return 'return'; |
| 6472 } | 6472 } |
| 6473 HReturn.prototype.hasSideEffects = function() { | 6473 HReturn.prototype.hasSideEffects = function() { |
| 6474 return true; | 6474 return true; |
| 6475 } | 6475 } |
| 6476 HReturn.prototype.accept = function(visitor) { | 6476 HReturn.prototype.accept = function(visitor) { |
| 6477 return visitor.visitReturn(this); | 6477 return visitor.visitReturn(this); |
| 6478 } | 6478 } |
| 6479 // ********** Code for SsaOptimizerTask ************** | 6479 // ********** Code for SsaOptimizerTask ************** |
| 6480 function SsaOptimizerTask(pipeline) { | 6480 function SsaOptimizerTask(pipeline0) { |
| 6481 CompilerTask.call(this, pipeline); | 6481 CompilerTask.call(this, pipeline0); |
| 6482 // Initializers done | 6482 // Initializers done |
| 6483 } | 6483 } |
| 6484 $inherits(SsaOptimizerTask, CompilerTask); | 6484 $inherits(SsaOptimizerTask, CompilerTask); |
| 6485 SsaOptimizerTask.prototype.get$name = function() { | 6485 SsaOptimizerTask.prototype.get$name = function() { |
| 6486 return 'SSA optimizer'; | 6486 return 'SSA optimizer'; |
| 6487 } | 6487 } |
| 6488 SsaOptimizerTask.prototype.optimize = function(graph) { | 6488 SsaOptimizerTask.prototype.optimize = function(graph) { |
| 6489 this.measure((function () { | 6489 this.measure((function () { |
| 6490 new SsaConstantFolder().visitGraph(graph); | 6490 new SsaConstantFolder().visitGraph(graph); |
| 6491 new SsaDeadCodeEliminator().visitGraph(graph); | 6491 new SsaDeadCodeEliminator().visitGraph(graph); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6629 return HValidator.everyInstruction(instruction0.get$usedBy(), (function (use
, count) { | 6629 return HValidator.everyInstruction(instruction0.get$usedBy(), (function (use
, count) { |
| 6630 return HValidator.countInstruction(use.inputs, instruction0) == count; | 6630 return HValidator.countInstruction(use.inputs, instruction0) == count; |
| 6631 }) | 6631 }) |
| 6632 ); | 6632 ); |
| 6633 } | 6633 } |
| 6634 this.isValid = this.isValid && hasCorrectInputs(instruction) && hasCorrectUses
(instruction); | 6634 this.isValid = this.isValid && hasCorrectInputs(instruction) && hasCorrectUses
(instruction); |
| 6635 } | 6635 } |
| 6636 // ********** Code for top level ************** | 6636 // ********** Code for top level ************** |
| 6637 // ********** Library leg ************** | 6637 // ********** Library leg ************** |
| 6638 // ********** Code for WorldPipeline ************** | 6638 // ********** Code for WorldPipeline ************** |
| 6639 function WorldPipeline(world, script) { | 6639 function WorldPipeline(world, script0) { |
| 6640 this.world = world; | 6640 this.world = world; |
| 6641 Pipeline.call(this, script); | 6641 Pipeline.call(this, script0); |
| 6642 // Initializers done | 6642 // Initializers done |
| 6643 } | 6643 } |
| 6644 $inherits(WorldPipeline, Pipeline); | 6644 $inherits(WorldPipeline, Pipeline); |
| 6645 WorldPipeline.prototype.log = function(message) { | 6645 WorldPipeline.prototype.log = function(message) { |
| 6646 if (options.showInfo) { | 6646 if (options.showInfo) { |
| 6647 this.world.info(('[leg] ' + message + '')); | 6647 this.world.info(('[leg] ' + message + '')); |
| 6648 } | 6648 } |
| 6649 } | 6649 } |
| 6650 WorldPipeline.prototype.run = function() { | 6650 WorldPipeline.prototype.run = function() { |
| 6651 var success = Pipeline.prototype.run.call(this); | 6651 var success = Pipeline.prototype.run.call(this); |
| 6652 if (success) { | 6652 if (success) { |
| 6653 var code = this.getGeneratedCode(); | 6653 var code = this.getGeneratedCode(); |
| 6654 this.world.legCode = code; | 6654 this.world.legCode = code; |
| 6655 this.world.jsBytesWritten = code.length; | 6655 this.world.jsBytesWritten = code.length; |
| 6656 var $list = this.tasks; | 6656 var $list = this.tasks; |
| 6657 for (var $i = 0;$i < $list.length; $i++) { | 6657 for (var $i0 = 0;$i0 < $list.length; $i0++) { |
| 6658 var task = $list.$index($i); | 6658 var task = $list.$index($i0); |
| 6659 this.log(('' + task.get$name() + ' took ' + task.get$timing() + 'msec')); | 6659 this.log(('' + task.get$name() + ' took ' + task.get$timing() + 'msec')); |
| 6660 } | 6660 } |
| 6661 } | 6661 } |
| 6662 return success; | 6662 return success; |
| 6663 } | 6663 } |
| 6664 WorldPipeline.prototype.spanFromNode = function(node) { | 6664 WorldPipeline.prototype.spanFromNode = function(node) { |
| 6665 var token = node.get$beginToken(); | 6665 var token = node.get$beginToken(); |
| 6666 if (token == null) { | 6666 if (token == null) { |
| 6667 this.cancel(('cannot find token for node ' + node + ' to produce error messa
ge.')); | 6667 this.cancel(('cannot find token for node ' + node + ' to produce error messa
ge.')); |
| 6668 } | 6668 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6751 // ********** Code for PipelineCancelledException ************** | 6751 // ********** Code for PipelineCancelledException ************** |
| 6752 function PipelineCancelledException(reason) { | 6752 function PipelineCancelledException(reason) { |
| 6753 this.reason = reason; | 6753 this.reason = reason; |
| 6754 // Initializers done | 6754 // Initializers done |
| 6755 } | 6755 } |
| 6756 PipelineCancelledException.prototype.toString = function() { | 6756 PipelineCancelledException.prototype.toString = function() { |
| 6757 var banner = 'pipeline cancelled'; | 6757 var banner = 'pipeline cancelled'; |
| 6758 return (this.reason != null) ? ('' + banner + ': ' + this.reason + '') : ('' +
banner + ''); | 6758 return (this.reason != null) ? ('' + banner + ': ' + this.reason + '') : ('' +
banner + ''); |
| 6759 } | 6759 } |
| 6760 // ********** Code for ResolverTask ************** | 6760 // ********** Code for ResolverTask ************** |
| 6761 function ResolverTask(pipeline) { | 6761 function ResolverTask(pipeline0) { |
| 6762 CompilerTask.call(this, pipeline); | 6762 CompilerTask.call(this, pipeline0); |
| 6763 // Initializers done | 6763 // Initializers done |
| 6764 } | 6764 } |
| 6765 $inherits(ResolverTask, CompilerTask); | 6765 $inherits(ResolverTask, CompilerTask); |
| 6766 ResolverTask.prototype.get$name = function() { | 6766 ResolverTask.prototype.get$name = function() { |
| 6767 return 'Resolver'; | 6767 return 'Resolver'; |
| 6768 } | 6768 } |
| 6769 ResolverTask.prototype.resolve = function(tree) { | 6769 ResolverTask.prototype.resolve = function(tree) { |
| 6770 var $this = this; // closure support | 6770 var $this = this; // closure support |
| 6771 return this.measure((function () { | 6771 return this.measure((function () { |
| 6772 var visitor = new ResolverVisitor($this.pipeline, new Types()); | 6772 var visitor = new ResolverVisitor($this.pipeline, new Types()); |
| 6773 visitor.visit(tree); | 6773 visitor.visit(tree); |
| 6774 return visitor.elements; | 6774 return visitor.elements; |
| 6775 }) | 6775 }) |
| 6776 ); | 6776 ); |
| 6777 } | 6777 } |
| 6778 // ********** Code for ResolverVisitor ************** | 6778 // ********** Code for ResolverVisitor ************** |
| 6779 function ResolverVisitor(pipeline, types) { | 6779 function ResolverVisitor(pipeline0, types) { |
| 6780 this.types = types; | 6780 this.types = types; |
| 6781 this.context = new Context(null, pipeline.universe.scope, pipeline.universe.el
ements); | 6781 this.context = new Context(null, pipeline0.universe.scope, pipeline0.universe.
elements); |
| 6782 this.elements = new HashMapImplementation$Node$Element(); | 6782 this.elements = new HashMapImplementation$Node$Element(); |
| 6783 this.pipeline = pipeline; | 6783 this.pipeline = pipeline0; |
| 6784 // Initializers done | 6784 // Initializers done |
| 6785 } | 6785 } |
| 6786 ResolverVisitor.prototype.fail = function(node) { | 6786 ResolverVisitor.prototype.fail = function(node) { |
| 6787 this.pipeline.cancel(('cannot resolve ' + node.get$debugString() + '')); | 6787 this.pipeline.cancel(('cannot resolve ' + node.get$debugString() + '')); |
| 6788 } | 6788 } |
| 6789 ResolverVisitor.prototype.getType = function(annotation) { | 6789 ResolverVisitor.prototype.getType = function(annotation) { |
| 6790 if (annotation == null || annotation.typeName == null) { | 6790 if (annotation == null || annotation.typeName == null) { |
| 6791 return this.types.DYNAMIC; | 6791 return this.types.DYNAMIC; |
| 6792 } | 6792 } |
| 6793 var name = annotation.typeName.get$source(); | 6793 var name = annotation.typeName.get$source(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6838 !link.isEmpty(); link = link.get$tail()) { | 6838 !link.isEmpty(); link = link.get$tail()) { |
| 6839 this.visit(link.get$head()); | 6839 this.visit(link.get$head()); |
| 6840 } | 6840 } |
| 6841 } | 6841 } |
| 6842 ResolverVisitor.prototype.visitExpressionStatement = function(node) { | 6842 ResolverVisitor.prototype.visitExpressionStatement = function(node) { |
| 6843 this.visit(node.expression); | 6843 this.visit(node.expression); |
| 6844 } | 6844 } |
| 6845 ResolverVisitor.prototype.visitFunctionExpression = function(node) { | 6845 ResolverVisitor.prototype.visitFunctionExpression = function(node) { |
| 6846 var returnType = this.getType(node.returnType); | 6846 var returnType = this.getType(node.returnType); |
| 6847 var parameterTypes = []; | 6847 var parameterTypes = []; |
| 6848 var elements = $map([]); | 6848 var elements0 = $map([]); |
| 6849 for (var link = node.parameters.nodes; | 6849 for (var link = node.parameters.nodes; |
| 6850 !link.isEmpty(); link = link.get$tail()) { | 6850 !link.isEmpty(); link = link.get$tail()) { |
| 6851 var parameter = link.get$head(); | 6851 var parameter = link.get$head(); |
| 6852 var parameterElement = this.visit(parameter); | 6852 var parameterElement = this.visit(parameter); |
| 6853 elements.$setindex(parameter.get$name(), parameterElement); | 6853 elements0.$setindex(parameter.get$name(), parameterElement); |
| 6854 parameterTypes.add(parameterElement.type); | 6854 parameterTypes.add(parameterElement.type); |
| 6855 } | 6855 } |
| 6856 var type = new FunctionType(returnType, LinkFactory.Link$fromList$factory(para
meterTypes)); | 6856 var type = new FunctionType(returnType, LinkFactory.Link$fromList$factory(para
meterTypes)); |
| 6857 var element = null; | 6857 var element = null; |
| 6858 var name = node.name; | 6858 var name = node.name; |
| 6859 if (name != null) { | 6859 if (name != null) { |
| 6860 element = this.context.lookup(name.get$source()); | 6860 element = this.context.lookup(name.get$source()); |
| 6861 element.type = type; | 6861 element.type = type; |
| 6862 } | 6862 } |
| 6863 this.visitIn(node.body, new Context(this.context, element, elements)); | 6863 this.visitIn(node.body, new Context(this.context, element, elements0)); |
| 6864 return element; | 6864 return element; |
| 6865 } | 6865 } |
| 6866 ResolverVisitor.prototype.visitIdentifier = function(node) { | 6866 ResolverVisitor.prototype.visitIdentifier = function(node) { |
| 6867 var element = this.context.lookup(node.get$source()); | 6867 var element = this.context.lookup(node.get$source()); |
| 6868 if (element == null) this.fail(node); | 6868 if (element == null) this.fail(node); |
| 6869 return element; | 6869 return element; |
| 6870 } | 6870 } |
| 6871 ResolverVisitor.prototype.visitInvocation = function(node) { | 6871 ResolverVisitor.prototype.visitInvocation = function(node) { |
| 6872 var selector = node.selector; | 6872 var selector = node.selector; |
| 6873 var target = this.pipeline.universe.find(selector.get$source()); | 6873 var target = this.pipeline.universe.find(selector.get$source()); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 6902 return new Element(this.context.element, node.name, this.getType(node.typeAnno
tation)); | 6902 return new Element(this.context.element, node.name, this.getType(node.typeAnno
tation)); |
| 6903 } | 6903 } |
| 6904 ResolverVisitor.prototype.visitReturn = function(node) { | 6904 ResolverVisitor.prototype.visitReturn = function(node) { |
| 6905 this.visit(node.expression); | 6905 this.visit(node.expression); |
| 6906 return null; | 6906 return null; |
| 6907 } | 6907 } |
| 6908 ResolverVisitor.prototype.visitTypeAnnotation = function(node) { | 6908 ResolverVisitor.prototype.visitTypeAnnotation = function(node) { |
| 6909 | 6909 |
| 6910 } | 6910 } |
| 6911 // ********** Code for Context ************** | 6911 // ********** Code for Context ************** |
| 6912 function Context(parent, element, elements) { | 6912 function Context(parent, element, elements0) { |
| 6913 this.parent = parent; | 6913 this.parent = parent; |
| 6914 this.element = element; | 6914 this.element = element; |
| 6915 this.elements = (elements == null) ? $map([]) : elements; | 6915 this.elements = (elements0 == null) ? $map([]) : elements0; |
| 6916 // Initializers done | 6916 // Initializers done |
| 6917 } | 6917 } |
| 6918 Context.prototype.get$parent = function() { return this.parent; }; | 6918 Context.prototype.get$parent = function() { return this.parent; }; |
| 6919 Context.prototype.get$element = function() { return this.element; }; | 6919 Context.prototype.get$element = function() { return this.element; }; |
| 6920 Context.prototype.lookup = function(name) { | 6920 Context.prototype.lookup = function(name) { |
| 6921 if (this.elements != null && this.elements.$index(name) != null) { | 6921 if (this.elements != null && this.elements.$index(name) != null) { |
| 6922 return this.elements.$index(name); | 6922 return this.elements.$index(name); |
| 6923 } | 6923 } |
| 6924 else if (this.parent != null) { | 6924 else if (this.parent != null) { |
| 6925 return this.parent.lookup(name); | 6925 return this.parent.lookup(name); |
| 6926 } | 6926 } |
| 6927 else { | 6927 else { |
| 6928 return null; | 6928 return null; |
| 6929 } | 6929 } |
| 6930 } | 6930 } |
| 6931 // ********** Code for ScannerTask ************** | 6931 // ********** Code for ScannerTask ************** |
| 6932 function ScannerTask(pipeline) { | 6932 function ScannerTask(pipeline0) { |
| 6933 CompilerTask.call(this, pipeline); | 6933 CompilerTask.call(this, pipeline0); |
| 6934 // Initializers done | 6934 // Initializers done |
| 6935 } | 6935 } |
| 6936 $inherits(ScannerTask, CompilerTask); | 6936 $inherits(ScannerTask, CompilerTask); |
| 6937 ScannerTask.prototype.get$name = function() { | 6937 ScannerTask.prototype.get$name = function() { |
| 6938 return 'Scanner'; | 6938 return 'Scanner'; |
| 6939 } | 6939 } |
| 6940 ScannerTask.prototype.scan = function(script) { | 6940 ScannerTask.prototype.scan = function(script) { |
| 6941 var $this = this; // closure support | 6941 var $this = this; // closure support |
| 6942 this.measure((function () { | 6942 this.measure((function () { |
| 6943 var elements = $this.scanElements(script.get$text()); | 6943 var elements = $this.scanElements(script.get$text()); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 6957 } | 6957 } |
| 6958 // ********** Code for leg_Script ************** | 6958 // ********** Code for leg_Script ************** |
| 6959 function leg_Script(file) { | 6959 function leg_Script(file) { |
| 6960 this.file = file; | 6960 this.file = file; |
| 6961 // Initializers done | 6961 // Initializers done |
| 6962 } | 6962 } |
| 6963 leg_Script.prototype.get$text = function() { | 6963 leg_Script.prototype.get$text = function() { |
| 6964 return this.file.get$text(); | 6964 return this.file.get$text(); |
| 6965 } | 6965 } |
| 6966 // ********** Code for TypeCheckerTask ************** | 6966 // ********** Code for TypeCheckerTask ************** |
| 6967 function TypeCheckerTask(pipeline) { | 6967 function TypeCheckerTask(pipeline0) { |
| 6968 CompilerTask.call(this, pipeline); | 6968 CompilerTask.call(this, pipeline0); |
| 6969 // Initializers done | 6969 // Initializers done |
| 6970 } | 6970 } |
| 6971 $inherits(TypeCheckerTask, CompilerTask); | 6971 $inherits(TypeCheckerTask, CompilerTask); |
| 6972 TypeCheckerTask.prototype.get$name = function() { | 6972 TypeCheckerTask.prototype.get$name = function() { |
| 6973 return "Type checker"; | 6973 return "Type checker"; |
| 6974 } | 6974 } |
| 6975 TypeCheckerTask.prototype.check = function(tree, elements) { | 6975 TypeCheckerTask.prototype.check = function(tree, elements) { |
| 6976 var $this = this; // closure support | 6976 var $this = this; // closure support |
| 6977 this.measure((function () { | 6977 this.measure((function () { |
| 6978 var visitor = new TypeCheckerVisitor($this.pipeline, elements, new Types()); | 6978 var visitor = new TypeCheckerVisitor($this.pipeline, elements, new Types()); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7159 CodeWriter.prototype.get$text = function() { | 7159 CodeWriter.prototype.get$text = function() { |
| 7160 return this._buf.toString(); | 7160 return this._buf.toString(); |
| 7161 } | 7161 } |
| 7162 CodeWriter.prototype._indent = function() { | 7162 CodeWriter.prototype._indent = function() { |
| 7163 this._pendingIndent = false; | 7163 this._pendingIndent = false; |
| 7164 for (var i = 0; | 7164 for (var i = 0; |
| 7165 i < this._indentation; i++) { | 7165 i < this._indentation; i++) { |
| 7166 this._buf.add(' '/*CodeWriter.INDENTATION*/); | 7166 this._buf.add(' '/*CodeWriter.INDENTATION*/); |
| 7167 } | 7167 } |
| 7168 } | 7168 } |
| 7169 CodeWriter.prototype.comment = function(text) { | 7169 CodeWriter.prototype.comment = function(text0) { |
| 7170 if (this.writeComments) { | 7170 if (this.writeComments) { |
| 7171 this.writeln(text); | 7171 this.writeln(text0); |
| 7172 } | 7172 } |
| 7173 } | 7173 } |
| 7174 CodeWriter.prototype.write = function(text) { | 7174 CodeWriter.prototype.write = function(text0) { |
| 7175 if (text.length == 0) return; | 7175 if (text0.length == 0) return; |
| 7176 if (this._pendingIndent) this._indent(); | 7176 if (this._pendingIndent) this._indent(); |
| 7177 if (text.indexOf('\n', 0) != -1) { | 7177 if (text0.indexOf('\n', 0) != -1) { |
| 7178 var lines = text.split('\n'); | 7178 var lines = text0.split('\n'); |
| 7179 for (var i = 0; | 7179 for (var i = 0; |
| 7180 i < lines.length - 1; i++) { | 7180 i < lines.length - 1; i++) { |
| 7181 this.writeln(lines.$index(i)); | 7181 this.writeln(lines.$index(i)); |
| 7182 } | 7182 } |
| 7183 this.write(lines.$index(lines.length - 1)); | 7183 this.write(lines.$index(lines.length - 1)); |
| 7184 } | 7184 } |
| 7185 else { | 7185 else { |
| 7186 this._buf.add(text); | 7186 this._buf.add(text0); |
| 7187 } | 7187 } |
| 7188 } | 7188 } |
| 7189 CodeWriter.prototype.writeln = function(text) { | 7189 CodeWriter.prototype.writeln = function(text0) { |
| 7190 if (text != null) { | 7190 if (text0 != null) { |
| 7191 this.write(text); | 7191 this.write(text0); |
| 7192 } | 7192 } |
| 7193 if (!text.endsWith('\n')) this._buf.add('\n'/*CodeWriter.NEWLINE*/); | 7193 if (!text0.endsWith('\n')) this._buf.add('\n'/*CodeWriter.NEWLINE*/); |
| 7194 this._pendingIndent = true; | 7194 this._pendingIndent = true; |
| 7195 } | 7195 } |
| 7196 CodeWriter.prototype.enterBlock = function(text) { | 7196 CodeWriter.prototype.enterBlock = function(text0) { |
| 7197 this.writeln(text); | 7197 this.writeln(text0); |
| 7198 this._indentation++; | 7198 this._indentation++; |
| 7199 } | 7199 } |
| 7200 CodeWriter.prototype.exitBlock = function(text) { | 7200 CodeWriter.prototype.exitBlock = function(text0) { |
| 7201 this._indentation--; | 7201 this._indentation--; |
| 7202 this.writeln(text); | 7202 this.writeln(text0); |
| 7203 } | 7203 } |
| 7204 CodeWriter.prototype.nextBlock = function(text) { | 7204 CodeWriter.prototype.nextBlock = function(text0) { |
| 7205 this._indentation--; | 7205 this._indentation--; |
| 7206 this.writeln(text); | 7206 this.writeln(text0); |
| 7207 this._indentation++; | 7207 this._indentation++; |
| 7208 } | 7208 } |
| 7209 // ********** Code for WorldGenerator ************** | 7209 // ********** Code for WorldGenerator ************** |
| 7210 function WorldGenerator(main, writer) { | 7210 function WorldGenerator(main, writer) { |
| 7211 this.main = main; | 7211 this.main = main; |
| 7212 this.writer = writer; | 7212 this.writer = writer; |
| 7213 this.globals = $map([]); | 7213 this.globals = $map([]); |
| 7214 // Initializers done | 7214 // Initializers done |
| 7215 } | 7215 } |
| 7216 WorldGenerator.prototype.run = function() { | 7216 WorldGenerator.prototype.run = function() { |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7455 for (var $i = list.iterator(); $i.hasNext(); ) { | 7455 for (var $i = list.iterator(); $i.hasNext(); ) { |
| 7456 var global = $i.next(); | 7456 var global = $i.next(); |
| 7457 if (global.field != null) { | 7457 if (global.field != null) { |
| 7458 this._writeStaticField(global.field); | 7458 this._writeStaticField(global.field); |
| 7459 } | 7459 } |
| 7460 else { | 7460 else { |
| 7461 this.writer.writeln(('var ' + global.get$name() + ' = ' + global.exp.code
+ ';')); | 7461 this.writer.writeln(('var ' + global.get$name() + ' = ' + global.exp.code
+ ';')); |
| 7462 } | 7462 } |
| 7463 } | 7463 } |
| 7464 } | 7464 } |
| 7465 WorldGenerator.prototype._orderValues = function(map) { | 7465 WorldGenerator.prototype._orderValues = function(map0) { |
| 7466 var values = map.getValues(); | 7466 var values = map0.getValues(); |
| 7467 values.sort(this.get$_compareMembers()); | 7467 values.sort(this.get$_compareMembers()); |
| 7468 return values; | 7468 return values; |
| 7469 } | 7469 } |
| 7470 WorldGenerator.prototype._compareMembers = function(x, y) { | 7470 WorldGenerator.prototype._compareMembers = function(x, y) { |
| 7471 if (x.get$span() != null && y.get$span() != null) { | 7471 if (x.get$span() != null && y.get$span() != null) { |
| 7472 var spans = x.get$span().compareTo(y.get$span()); | 7472 var spans = x.get$span().compareTo(y.get$span()); |
| 7473 if (spans != 0) return spans; | 7473 if (spans != 0) return spans; |
| 7474 } | 7474 } |
| 7475 if (x.get$span() == null) return 1; | 7475 if (x.get$span() == null) return 1; |
| 7476 if (y.get$span() == null) return -1; | 7476 if (y.get$span() == null) return -1; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 7487 this.genMethod(c); | 7487 this.genMethod(c); |
| 7488 return factType; | 7488 return factType; |
| 7489 } | 7489 } |
| 7490 // ********** Code for BlockScope ************** | 7490 // ********** Code for BlockScope ************** |
| 7491 function BlockScope(enclosingMethod, parent, reentrant) { | 7491 function BlockScope(enclosingMethod, parent, reentrant) { |
| 7492 this.enclosingMethod = enclosingMethod; | 7492 this.enclosingMethod = enclosingMethod; |
| 7493 this.parent = parent; | 7493 this.parent = parent; |
| 7494 this.reentrant = reentrant; | 7494 this.reentrant = reentrant; |
| 7495 this._vars = $map([]); | 7495 this._vars = $map([]); |
| 7496 // Initializers done | 7496 // Initializers done |
| 7497 if (this.parent != null && $eq(this.parent.enclosingMethod, this.enclosingMeth
od)) { | 7497 if (this.get$isMethodScope()) { |
| 7498 this._closedOver = new HashSetImplementation$String(); |
| 7499 } |
| 7500 else { |
| 7498 this.reentrant = this.reentrant || this.parent.reentrant; | 7501 this.reentrant = this.reentrant || this.parent.reentrant; |
| 7499 } | 7502 } |
| 7500 } | 7503 } |
| 7501 BlockScope.prototype.get$parent = function() { return this.parent; }; | 7504 BlockScope.prototype.get$parent = function() { return this.parent; }; |
| 7502 BlockScope.prototype.set$parent = function(value) { return this.parent = value;
}; | 7505 BlockScope.prototype.set$parent = function(value) { return this.parent = value;
}; |
| 7506 BlockScope.prototype.get$isMethodScope = function() { |
| 7507 return this.parent == null || $ne(this.parent.enclosingMethod, this.enclosingM
ethod); |
| 7508 } |
| 7509 BlockScope.prototype.get$methodScope = function() { |
| 7510 var s = this; |
| 7511 while (!s.get$isMethodScope()) s = s.get$parent(); |
| 7512 return s; |
| 7513 } |
| 7503 BlockScope.prototype.lookup = function(name) { | 7514 BlockScope.prototype.lookup = function(name) { |
| 7504 var ret = this._vars.$index(name); | 7515 var ret = this._vars.$index(name); |
| 7505 if ($ne(ret, null)) return ret; | 7516 if ($ne(ret, null)) return ret; |
| 7506 for (var s = this.parent; | 7517 for (var s = this.parent; |
| 7507 $ne(s, null); s = s.get$parent()) { | 7518 $ne(s, null); s = s.get$parent()) { |
| 7508 ret = s._vars.$index(name); | 7519 ret = s._vars.$index(name); |
| 7509 if ($ne(ret, null)) { | 7520 if ($ne(ret, null)) { |
| 7510 if (this.enclosingMethod.captures != null && s.reentrant && $ne(s.enclosin
gMethod, this.enclosingMethod)) { | 7521 if ($ne(s.enclosingMethod, this.enclosingMethod)) { |
| 7511 this.enclosingMethod.captures.add(name); | 7522 s.get$methodScope()._closedOver.add(ret.code); |
| 7523 if (this.enclosingMethod.captures != null && s.reentrant) { |
| 7524 this.enclosingMethod.captures.add(ret.code); |
| 7525 } |
| 7512 } | 7526 } |
| 7513 return ret; | 7527 return ret; |
| 7514 } | 7528 } |
| 7515 } | 7529 } |
| 7516 } | 7530 } |
| 7517 BlockScope.prototype._isDefined = function(name) { | 7531 BlockScope.prototype._isDefinedInParent = function(name) { |
| 7518 if (this._vars.containsKey(name)) return true; | 7532 if (this.get$isMethodScope() && this._closedOver.contains(name)) return true; |
| 7519 if (this.parent != null) return this.parent._isDefined(name); | 7533 for (var s = this.parent; |
| 7534 $ne(s, null); s = s.get$parent()) { |
| 7535 if (s._vars.containsKey(name)) return true; |
| 7536 if (s.get$isMethodScope() && s._closedOver.contains(name)) return true; |
| 7537 } |
| 7538 var type = this.enclosingMethod.method.declaringType; |
| 7539 if (type.resolveMember(name) != null) return true; |
| 7540 if (type.get$library().lookup(name, null) != null) return true; |
| 7520 return false; | 7541 return false; |
| 7521 } | 7542 } |
| 7522 BlockScope.prototype.create = function(name, type, location) { | 7543 BlockScope.prototype.create = function(name, type, location) { |
| 7523 var jsName = world.toJsIdentifier(name); | 7544 var jsName = world.toJsIdentifier(name); |
| 7524 if (this._vars.containsKey(name)) { | 7545 if (this._vars.containsKey(name)) { |
| 7525 if (location != null) { | 7546 if (location != null) { |
| 7526 world.error(('duplicate name "' + name + '"'), location.span); | 7547 world.error(('duplicate name "' + name + '"'), location.span); |
| 7527 } | 7548 } |
| 7528 else { | 7549 else { |
| 7529 world.internalError(('conflict with temporary name "' + name + '"')); | 7550 world.internalError(('conflict with temporary name "' + name + '"')); |
| 7530 } | 7551 } |
| 7531 } | 7552 } |
| 7532 if (this.parent != null) { | 7553 var index = 0; |
| 7533 var index = 0; | 7554 while (this._isDefinedInParent(jsName)) { |
| 7534 while (this.parent._isDefined(jsName)) { | 7555 jsName = ('' + name + '' + index++ + ''); |
| 7535 jsName = ('' + name + '' + index++ + ''); | |
| 7536 } | |
| 7537 } | 7556 } |
| 7538 var ret = new Value(type, jsName, false, false, false); | 7557 var ret = new Value(type, jsName, false, false, false); |
| 7539 this._vars.$setindex(name, ret); | 7558 this._vars.$setindex(name, ret); |
| 7540 return ret; | 7559 return ret; |
| 7541 } | 7560 } |
| 7542 BlockScope.prototype.declare = function(id) { | 7561 BlockScope.prototype.declare = function(id) { |
| 7543 var type = this.enclosingMethod.method.resolveType(id.type, false); | 7562 var type = this.enclosingMethod.method.resolveType(id.type, false); |
| 7544 return this.create(id.name.name, type, id); | 7563 return this.create(id.name.name, type, id); |
| 7545 } | 7564 } |
| 7546 BlockScope.prototype.getRethrow = function() { | 7565 BlockScope.prototype.getRethrow = function() { |
| (...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8876 return this.visitPostfixExpression($0, false); | 8895 return this.visitPostfixExpression($0, false); |
| 8877 } | 8896 } |
| 8878 ; | 8897 ; |
| 8879 // ********** Code for Arguments ************** | 8898 // ********** Code for Arguments ************** |
| 8880 function Arguments(nodes, values) { | 8899 function Arguments(nodes, values) { |
| 8881 this.nodes = nodes; | 8900 this.nodes = nodes; |
| 8882 this.values = values; | 8901 this.values = values; |
| 8883 // Initializers done | 8902 // Initializers done |
| 8884 } | 8903 } |
| 8885 Arguments.Arguments$bare$factory = function(arity) { | 8904 Arguments.Arguments$bare$factory = function(arity) { |
| 8886 var values = []; | 8905 var values0 = []; |
| 8887 for (var i = 0; | 8906 for (var i = 0; |
| 8888 i < arity; i++) { | 8907 i < arity; i++) { |
| 8889 values.add(new Value(world.varType, ('\$' + i + ''), false, false, false)); | 8908 values0.add(new Value(world.varType, ('\$' + i + ''), false, false, false)); |
| 8890 } | 8909 } |
| 8891 return new Arguments(null, values); | 8910 return new Arguments(null, values0); |
| 8892 } | 8911 } |
| 8893 Arguments.get$EMPTY = function() { | 8912 Arguments.get$EMPTY = function() { |
| 8894 if (Arguments._empty == null) { | 8913 if (Arguments._empty == null) { |
| 8895 Arguments._empty = new Arguments(null, []); | 8914 Arguments._empty = new Arguments(null, []); |
| 8896 } | 8915 } |
| 8897 return Arguments._empty; | 8916 return Arguments._empty; |
| 8898 } | 8917 } |
| 8899 Arguments.prototype.get$nameCount = function() { | 8918 Arguments.prototype.get$nameCount = function() { |
| 8900 return this.get$length() - this.get$bareCount(); | 8919 return this.get$length() - this.get$bareCount(); |
| 8901 } | 8920 } |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9018 if (filename.startsWith('file:///')) return filename; | 9037 if (filename.startsWith('file:///')) return filename; |
| 9019 if (filename.startsWith('http://')) return filename; | 9038 if (filename.startsWith('http://')) return filename; |
| 9020 return joinPaths(this.sourceDir, filename); | 9039 return joinPaths(this.sourceDir, filename); |
| 9021 } | 9040 } |
| 9022 Library.prototype.addImport = function(fullname, prefix) { | 9041 Library.prototype.addImport = function(fullname, prefix) { |
| 9023 this.imports.add(new LibraryImport(world.getOrAddLibrary(fullname), prefix)); | 9042 this.imports.add(new LibraryImport(world.getOrAddLibrary(fullname), prefix)); |
| 9024 } | 9043 } |
| 9025 Library.prototype.addNative = function(fullname) { | 9044 Library.prototype.addNative = function(fullname) { |
| 9026 this.natives.add(world.reader.readFile(fullname)); | 9045 this.natives.add(world.reader.readFile(fullname)); |
| 9027 } | 9046 } |
| 9028 Library.prototype.getOrAddFunctionType = function(name, func, inType) { | 9047 Library.prototype.getOrAddFunctionType = function(name0, func, inType) { |
| 9029 var def = new FunctionTypeDefinition(func, null, func.span); | 9048 var def = new FunctionTypeDefinition(func, null, func.span); |
| 9030 var type = new DefinedType(name, this, def, false); | 9049 var type = new DefinedType(name0, this, def, false); |
| 9031 type.addMethod('\$call', func); | 9050 type.addMethod('\$call', func); |
| 9032 type.members.$index('\$call').resolve(inType); | 9051 type.members.$index('\$call').resolve(inType); |
| 9033 return type; | 9052 return type; |
| 9034 } | 9053 } |
| 9035 Library.prototype.addType = function(name, definition, isClass) { | 9054 Library.prototype.addType = function(name0, definition, isClass) { |
| 9036 if (this.types.containsKey(name)) { | 9055 if (this.types.containsKey(name0)) { |
| 9037 var existingType = this.types.$index(name); | 9056 var existingType = this.types.$index(name0); |
| 9038 if (this.get$isCore() && existingType.get$definition() == null) { | 9057 if (this.get$isCore() && existingType.get$definition() == null) { |
| 9039 existingType.setDefinition(definition); | 9058 existingType.setDefinition(definition); |
| 9040 } | 9059 } |
| 9041 else { | 9060 else { |
| 9042 world.warning(('duplicate definition of ' + name + ''), definition.span); | 9061 world.warning(('duplicate definition of ' + name0 + ''), definition.span); |
| 9043 } | 9062 } |
| 9044 } | 9063 } |
| 9045 else { | 9064 else { |
| 9046 this.types.$setindex(name, new DefinedType(name, this, definition, isClass))
; | 9065 this.types.$setindex(name0, new DefinedType(name0, this, definition, isClass
)); |
| 9047 } | 9066 } |
| 9048 return this.types.$index(name); | 9067 return this.types.$index(name0); |
| 9049 } | 9068 } |
| 9050 Library.prototype.findType = function(type) { | 9069 Library.prototype.findType = function(type) { |
| 9051 var result = this.findTypeByName(type.name.name); | 9070 var result = this.findTypeByName(type.name.name); |
| 9052 if (result == null) return null; | 9071 if (result == null) return null; |
| 9053 if (type.names != null) { | 9072 if (type.names != null) { |
| 9054 if (type.names.length > 1) { | 9073 if (type.names.length > 1) { |
| 9055 return null; | 9074 return null; |
| 9056 } | 9075 } |
| 9057 if (!result.get$isTop()) { | 9076 if (!result.get$isTop()) { |
| 9058 return null; | 9077 return null; |
| 9059 } | 9078 } |
| 9060 return result.get$library().findTypeByName(type.names.$index(0).get$name()); | 9079 return result.get$library().findTypeByName(type.names.$index(0).get$name()); |
| 9061 } | 9080 } |
| 9062 return result; | 9081 return result; |
| 9063 } | 9082 } |
| 9064 Library.prototype.findTypeByName = function(name) { | 9083 Library.prototype.findTypeByName = function(name0) { |
| 9065 var ret = this.types.$index(name); | 9084 var ret = this.types.$index(name0); |
| 9066 var $list = this.imports; | 9085 var $list = this.imports; |
| 9067 for (var $i = 0;$i < $list.length; $i++) { | 9086 for (var $i = 0;$i < $list.length; $i++) { |
| 9068 var imported = $list.$index($i); | 9087 var imported = $list.$index($i); |
| 9069 var newRet = null; | 9088 var newRet = null; |
| 9070 if (imported.prefix == null) { | 9089 if (imported.prefix == null) { |
| 9071 newRet = imported.get$library().types.$index(name); | 9090 newRet = imported.get$library().types.$index(name0); |
| 9072 } | 9091 } |
| 9073 else if (imported.prefix == name) { | 9092 else if (imported.prefix == name0) { |
| 9074 newRet = imported.get$library().topType; | 9093 newRet = imported.get$library().topType; |
| 9075 } | 9094 } |
| 9076 if ($ne(newRet, null)) { | 9095 if ($ne(newRet, null)) { |
| 9077 if ($ne(ret, null) && $ne(ret, newRet)) { | 9096 if ($ne(ret, null) && $ne(ret, newRet)) { |
| 9078 world.error(('conflicting types for "' + name + '"'), ret.get$span()); | 9097 world.error(('conflicting types for "' + name0 + '"'), ret.get$span()); |
| 9079 world.error(('conflicting types for "' + name + '"'), newRet.get$span())
; | 9098 world.error(('conflicting types for "' + name0 + '"'), newRet.get$span()
); |
| 9080 } | 9099 } |
| 9081 else { | 9100 else { |
| 9082 ret = newRet; | 9101 ret = newRet; |
| 9083 } | 9102 } |
| 9084 } | 9103 } |
| 9085 } | 9104 } |
| 9086 return ret; | 9105 return ret; |
| 9087 } | 9106 } |
| 9088 Library.prototype.lookup = function(name, span) { | 9107 Library.prototype.lookup = function(name0, span0) { |
| 9089 var retType = this.findTypeByName(name); | 9108 var retType = this.findTypeByName(name0); |
| 9090 var ret = null; | 9109 var ret = null; |
| 9091 if ($ne(retType, null)) { | 9110 if ($ne(retType, null)) { |
| 9092 ret = retType.get$typeMember(); | 9111 ret = retType.get$typeMember(); |
| 9093 } | 9112 } |
| 9094 var newRet = this.topType.getMember(name); | 9113 var newRet = this.topType.getMember(name0); |
| 9095 if ($ne(newRet, null)) { | 9114 if ($ne(newRet, null)) { |
| 9096 if ($ne(ret, null) && $ne(ret, newRet)) { | 9115 if ($ne(ret, null) && $ne(ret, newRet)) { |
| 9097 world.error(('conflicting members for "' + name + '"'), span); | 9116 world.error(('conflicting members for "' + name0 + '"'), span0); |
| 9098 world.error(('conflicting members for "' + name + '"'), ret.get$span()); | 9117 world.error(('conflicting members for "' + name0 + '"'), ret.get$span()); |
| 9099 world.error(('conflicting members for "' + name + '"'), newRet.get$span())
; | 9118 world.error(('conflicting members for "' + name0 + '"'), newRet.get$span()
); |
| 9100 } | 9119 } |
| 9101 else { | 9120 else { |
| 9102 ret = newRet; | 9121 ret = newRet; |
| 9103 } | 9122 } |
| 9104 } | 9123 } |
| 9105 var $list = this.imports; | 9124 var $list = this.imports; |
| 9106 for (var $i = 0;$i < $list.length; $i++) { | 9125 for (var $i = 0;$i < $list.length; $i++) { |
| 9107 var imported = $list.$index($i); | 9126 var imported = $list.$index($i); |
| 9108 if (imported.prefix == null) { | 9127 if (imported.prefix == null) { |
| 9109 newRet = imported.get$library().topType.getMember(name); | 9128 newRet = imported.get$library().topType.getMember(name0); |
| 9110 if ($ne(newRet, null)) { | 9129 if ($ne(newRet, null)) { |
| 9111 if ($ne(ret, null) && $ne(ret, newRet)) { | 9130 if ($ne(ret, null) && $ne(ret, newRet)) { |
| 9112 world.error(('conflicting members for "' + name + '"'), span); | 9131 world.error(('conflicting members for "' + name0 + '"'), span0); |
| 9113 world.error(('conflicting members for "' + name + '"'), ret.get$span()
); | 9132 world.error(('conflicting members for "' + name0 + '"'), ret.get$span(
)); |
| 9114 world.error(('conflicting members for "' + name + '"'), newRet.get$spa
n()); | 9133 world.error(('conflicting members for "' + name0 + '"'), newRet.get$sp
an()); |
| 9115 } | 9134 } |
| 9116 else { | 9135 else { |
| 9117 ret = newRet; | 9136 ret = newRet; |
| 9118 } | 9137 } |
| 9119 } | 9138 } |
| 9120 } | 9139 } |
| 9121 } | 9140 } |
| 9122 return ret; | 9141 return ret; |
| 9123 } | 9142 } |
| 9124 Library.prototype.resolve = function() { | 9143 Library.prototype.resolve = function() { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9319 function Member(name, declaringType) { | 9338 function Member(name, declaringType) { |
| 9320 this.name = name; | 9339 this.name = name; |
| 9321 this.declaringType = declaringType; | 9340 this.declaringType = declaringType; |
| 9322 this.isGenerated = false; | 9341 this.isGenerated = false; |
| 9323 // Initializers done | 9342 // Initializers done |
| 9324 } | 9343 } |
| 9325 Member.prototype.get$name = function() { return this.name; }; | 9344 Member.prototype.get$name = function() { return this.name; }; |
| 9326 Member.prototype.get$jsname = function() { | 9345 Member.prototype.get$jsname = function() { |
| 9327 return this._jsname == null ? this.name : this._jsname; | 9346 return this._jsname == null ? this.name : this._jsname; |
| 9328 } | 9347 } |
| 9329 Member.prototype.set$jsname = function(name) { | 9348 Member.prototype.set$jsname = function(name0) { |
| 9330 return this._jsname = name; | 9349 return this._jsname = name0; |
| 9331 } | 9350 } |
| 9332 Member.prototype.get$library = function() { | 9351 Member.prototype.get$library = function() { |
| 9333 return this.declaringType.get$library(); | 9352 return this.declaringType.get$library(); |
| 9334 } | 9353 } |
| 9335 Member.prototype.get$isPrivate = function() { | 9354 Member.prototype.get$isPrivate = function() { |
| 9336 return this.name.startsWith('_'); | 9355 return this.name.startsWith('_'); |
| 9337 } | 9356 } |
| 9338 Member.prototype.get$isConstructor = function() { | 9357 Member.prototype.get$isConstructor = function() { |
| 9339 return false; | 9358 return false; |
| 9340 } | 9359 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9395 Member.prototype.get$generatedFactoryName = function() { | 9414 Member.prototype.get$generatedFactoryName = function() { |
| 9396 var prefix = ('' + this.declaringType.get$jsname() + '.' + this.get$constructo
rName() + '\$'); | 9415 var prefix = ('' + this.declaringType.get$jsname() + '.' + this.get$constructo
rName() + '\$'); |
| 9397 if (this.name == '') { | 9416 if (this.name == '') { |
| 9398 return ('' + prefix + 'factory'); | 9417 return ('' + prefix + 'factory'); |
| 9399 } | 9418 } |
| 9400 else { | 9419 else { |
| 9401 return ('' + prefix + '' + this.name + '\$factory'); | 9420 return ('' + prefix + '' + this.name + '\$factory'); |
| 9402 } | 9421 } |
| 9403 } | 9422 } |
| 9404 // ********** Code for TypeMember ************** | 9423 // ********** Code for TypeMember ************** |
| 9405 function TypeMember(type) { | 9424 function TypeMember(type0) { |
| 9406 this.type = type; | 9425 this.type = type0; |
| 9407 Member.call(this, type.name, type.library.topType); | 9426 Member.call(this, type0.name, type0.library.topType); |
| 9408 // Initializers done | 9427 // Initializers done |
| 9409 } | 9428 } |
| 9410 $inherits(TypeMember, Member); | 9429 $inherits(TypeMember, Member); |
| 9411 TypeMember.prototype.get$span = function() { | 9430 TypeMember.prototype.get$span = function() { |
| 9412 return this.type.definition.span; | 9431 return this.type.definition.span; |
| 9413 } | 9432 } |
| 9414 TypeMember.prototype.get$isStatic = function() { | 9433 TypeMember.prototype.get$isStatic = function() { |
| 9415 return true; | 9434 return true; |
| 9416 } | 9435 } |
| 9417 TypeMember.prototype.get$returnType = function() { | 9436 TypeMember.prototype.get$returnType = function() { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 9432 TypeMember.prototype.get_ = function(gen, node, target) { | 9451 TypeMember.prototype.get_ = function(gen, node, target) { |
| 9433 return new Value(this.type, this.type.get$jsname(), false, false, true); | 9452 return new Value(this.type, this.type.get$jsname(), false, false, true); |
| 9434 } | 9453 } |
| 9435 TypeMember.prototype.set_ = function(gen, node, target, value) { | 9454 TypeMember.prototype.set_ = function(gen, node, target, value) { |
| 9436 world.error('can not set type', this.type.definition); | 9455 world.error('can not set type', this.type.definition); |
| 9437 } | 9456 } |
| 9438 TypeMember.prototype.invoke = function(gen, node, target, args) { | 9457 TypeMember.prototype.invoke = function(gen, node, target, args) { |
| 9439 world.error('can not invoke type', this.type.definition); | 9458 world.error('can not invoke type', this.type.definition); |
| 9440 } | 9459 } |
| 9441 // ********** Code for FieldMember ************** | 9460 // ********** Code for FieldMember ************** |
| 9442 function FieldMember(name, declaringType, definition, value) { | 9461 function FieldMember(name0, declaringType0, definition, value) { |
| 9443 this._providePropertySyntax = false | 9462 this._providePropertySyntax = false |
| 9444 this.definition = definition; | 9463 this.definition = definition; |
| 9445 this.value = value; | 9464 this.value = value; |
| 9446 this.isNative = false; | 9465 this.isNative = false; |
| 9447 Member.call(this, name, declaringType); | 9466 Member.call(this, name0, declaringType0); |
| 9448 // Initializers done | 9467 // Initializers done |
| 9449 } | 9468 } |
| 9450 $inherits(FieldMember, Member); | 9469 $inherits(FieldMember, Member); |
| 9451 FieldMember.prototype.get$definition = function() { return this.definition; }; | 9470 FieldMember.prototype.get$definition = function() { return this.definition; }; |
| 9452 FieldMember.prototype.get$value = function() { return this.value; }; | 9471 FieldMember.prototype.get$value = function() { return this.value; }; |
| 9453 FieldMember.prototype.get$isStatic = function() { return this.isStatic; }; | 9472 FieldMember.prototype.get$isStatic = function() { return this.isStatic; }; |
| 9454 FieldMember.prototype.set$isStatic = function(value) { return this.isStatic = va
lue; }; | 9473 FieldMember.prototype.set$isStatic = function(value) { return this.isStatic = va
lue; }; |
| 9455 FieldMember.prototype.get$isNative = function() { return this.isNative; }; | 9474 FieldMember.prototype.get$isNative = function() { return this.isNative; }; |
| 9456 FieldMember.prototype.set$isNative = function(value) { return this.isNative = va
lue; }; | 9475 FieldMember.prototype.set$isNative = function(value) { return this.isNative = va
lue; }; |
| 9457 FieldMember.prototype.override = function(other) { | 9476 FieldMember.prototype.override = function(other) { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9560 var constTarget = (target instanceof GlobalValue) ? target.exp : target; | 9579 var constTarget = (target instanceof GlobalValue) ? target.exp : target; |
| 9561 if ((constTarget instanceof ConstObjectValue)) { | 9580 if ((constTarget instanceof ConstObjectValue)) { |
| 9562 return constTarget.fields.$index(this.name); | 9581 return constTarget.fields.$index(this.name); |
| 9563 } | 9582 } |
| 9564 else if ($eq(constTarget.type, world.stringType) && this.name == 'length') { | 9583 else if ($eq(constTarget.type, world.stringType) && this.name == 'length') { |
| 9565 return new Value(this.type, ('' + constTarget.get$actualValue().length + '
'), false, true, false); | 9584 return new Value(this.type, ('' + constTarget.get$actualValue().length + '
'), false, true, false); |
| 9566 } | 9585 } |
| 9567 } | 9586 } |
| 9568 return new Value(this.type, ('' + target.code + '.' + this.get$jsname() + ''),
false, true, false); | 9587 return new Value(this.type, ('' + target.code + '.' + this.get$jsname() + ''),
false, true, false); |
| 9569 } | 9588 } |
| 9570 FieldMember.prototype.set_ = function(gen, node, target, value) { | 9589 FieldMember.prototype.set_ = function(gen, node, target, value0) { |
| 9571 var lhs = this.get_(gen, node, target); | 9590 var lhs = this.get_(gen, node, target); |
| 9572 value = value.convertTo(this.type, node); | 9591 value0 = value0.convertTo(this.type, node); |
| 9573 return new Value(this.type, ('' + lhs.code + ' = ' + value.code + ''), false,
true, false); | 9592 return new Value(this.type, ('' + lhs.code + ' = ' + value0.code + ''), false,
true, false); |
| 9574 } | 9593 } |
| 9575 // ********** Code for PropertyMember ************** | 9594 // ********** Code for PropertyMember ************** |
| 9576 function PropertyMember(name, declaringType) { | 9595 function PropertyMember(name0, declaringType0) { |
| 9577 this._provideFieldSyntax = false | 9596 this._provideFieldSyntax = false |
| 9578 Member.call(this, name, declaringType); | 9597 Member.call(this, name0, declaringType0); |
| 9579 // Initializers done | 9598 // Initializers done |
| 9580 } | 9599 } |
| 9581 $inherits(PropertyMember, Member); | 9600 $inherits(PropertyMember, Member); |
| 9582 PropertyMember.prototype.get$span = function() { | 9601 PropertyMember.prototype.get$span = function() { |
| 9583 return this.getter != null ? this.getter.get$span() : null; | 9602 return this.getter != null ? this.getter.get$span() : null; |
| 9584 } | 9603 } |
| 9585 PropertyMember.prototype.get$canGet = function() { | 9604 PropertyMember.prototype.get$canGet = function() { |
| 9586 return this.getter != null; | 9605 return this.getter != null; |
| 9587 } | 9606 } |
| 9588 PropertyMember.prototype.get$canSet = function() { | 9607 PropertyMember.prototype.get$canSet = function() { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9636 } | 9655 } |
| 9637 if (this.getter == null) this.getter = parentMember.getter; | 9656 if (this.getter == null) this.getter = parentMember.getter; |
| 9638 if (this.setter == null) this.setter = parentMember.setter; | 9657 if (this.setter == null) this.setter = parentMember.setter; |
| 9639 } | 9658 } |
| 9640 PropertyMember.prototype.resolve = function(inType) { | 9659 PropertyMember.prototype.resolve = function(inType) { |
| 9641 if (this.getter != null) this.getter.resolve(inType); | 9660 if (this.getter != null) this.getter.resolve(inType); |
| 9642 if (this.setter != null) this.setter.resolve(inType); | 9661 if (this.setter != null) this.setter.resolve(inType); |
| 9643 world._addMember(this); | 9662 world._addMember(this); |
| 9644 } | 9663 } |
| 9645 // ********** Code for ConcreteMember ************** | 9664 // ********** Code for ConcreteMember ************** |
| 9646 function ConcreteMember(name, declaringType, baseMember) { | 9665 function ConcreteMember(name0, declaringType0, baseMember) { |
| 9647 this.baseMember = baseMember; | 9666 this.baseMember = baseMember; |
| 9648 Member.call(this, name, declaringType); | 9667 Member.call(this, name0, declaringType0); |
| 9649 // Initializers done | 9668 // Initializers done |
| 9650 this.parameters = []; | 9669 this.parameters = []; |
| 9651 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring
Type); | 9670 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring
Type0); |
| 9652 var $list = this.baseMember.get$parameters(); | 9671 var $list = this.baseMember.get$parameters(); |
| 9653 for (var $i = 0;$i < $list.length; $i++) { | 9672 for (var $i = 0;$i < $list.length; $i++) { |
| 9654 var p = $list.$index($i); | 9673 var p = $list.$index($i); |
| 9655 var newType = p.type.resolveTypeParams(declaringType); | 9674 var newType = p.type.resolveTypeParams(declaringType0); |
| 9656 if ($ne(newType, p.type)) { | 9675 if ($ne(newType, p.type)) { |
| 9657 this.parameters.add(p.copyWithNewType(newType)); | 9676 this.parameters.add(p.copyWithNewType(newType)); |
| 9658 } | 9677 } |
| 9659 else { | 9678 else { |
| 9660 this.parameters.add(p); | 9679 this.parameters.add(p); |
| 9661 } | 9680 } |
| 9662 } | 9681 } |
| 9663 } | 9682 } |
| 9664 $inherits(ConcreteMember, Member); | 9683 $inherits(ConcreteMember, Member); |
| 9665 ConcreteMember.prototype.get$returnType = function() { return this.returnType; }
; | 9684 ConcreteMember.prototype.get$returnType = function() { return this.returnType; }
; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9744 ConcreteMember.prototype.invoke = function(gen, node, target, args) { | 9763 ConcreteMember.prototype.invoke = function(gen, node, target, args) { |
| 9745 var ret = this.baseMember.invoke(gen, node, target, args); | 9764 var ret = this.baseMember.invoke(gen, node, target, args); |
| 9746 var code = ret.code; | 9765 var code = ret.code; |
| 9747 if (this.get$isConstructor()) { | 9766 if (this.get$isConstructor()) { |
| 9748 code = code.replaceFirst(this.declaringType.genericType.get$jsname(), this.d
eclaringType.get$jsname()); | 9767 code = code.replaceFirst(this.declaringType.genericType.get$jsname(), this.d
eclaringType.get$jsname()); |
| 9749 } | 9768 } |
| 9750 gen.genMethod(this); | 9769 gen.genMethod(this); |
| 9751 return new Value(this.returnType, code, false, true, false); | 9770 return new Value(this.returnType, code, false, true, false); |
| 9752 } | 9771 } |
| 9753 // ********** Code for MethodMember ************** | 9772 // ********** Code for MethodMember ************** |
| 9754 function MethodMember(name, declaringType, definition) { | 9773 function MethodMember(name0, declaringType0, definition) { |
| 9755 this.isStatic = false | 9774 this.isStatic = false |
| 9756 this.isAbstract = false | 9775 this.isAbstract = false |
| 9757 this.isConst = false | 9776 this.isConst = false |
| 9758 this.isFactory = false | 9777 this.isFactory = false |
| 9759 this.isLambda = false | 9778 this.isLambda = false |
| 9760 this._providePropertySyntax = false | 9779 this._providePropertySyntax = false |
| 9761 this._provideFieldSyntax = false | 9780 this._provideFieldSyntax = false |
| 9762 this._provideOptionalParamInfo = false | 9781 this._provideOptionalParamInfo = false |
| 9763 this.definition = definition; | 9782 this.definition = definition; |
| 9764 Member.call(this, name, declaringType); | 9783 Member.call(this, name0, declaringType0); |
| 9765 // Initializers done | 9784 // Initializers done |
| 9766 } | 9785 } |
| 9767 $inherits(MethodMember, Member); | 9786 $inherits(MethodMember, Member); |
| 9768 MethodMember.prototype.get$definition = function() { return this.definition; }; | 9787 MethodMember.prototype.get$definition = function() { return this.definition; }; |
| 9769 MethodMember.prototype.set$definition = function(value) { return this.definition
= value; }; | 9788 MethodMember.prototype.set$definition = function(value) { return this.definition
= value; }; |
| 9770 MethodMember.prototype.get$returnType = function() { return this.returnType; }; | 9789 MethodMember.prototype.get$returnType = function() { return this.returnType; }; |
| 9771 MethodMember.prototype.set$returnType = function(value) { return this.returnType
= value; }; | 9790 MethodMember.prototype.set$returnType = function(value) { return this.returnType
= value; }; |
| 9772 MethodMember.prototype.get$parameters = function() { return this.parameters; }; | 9791 MethodMember.prototype.get$parameters = function() { return this.parameters; }; |
| 9773 MethodMember.prototype.set$parameters = function(value) { return this.parameters
= value; }; | 9792 MethodMember.prototype.set$parameters = function(value) { return this.parameters
= value; }; |
| 9774 MethodMember.prototype.get$isStatic = function() { return this.isStatic; }; | 9793 MethodMember.prototype.get$isStatic = function() { return this.isStatic; }; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9838 if (!this.parameters.$index(bareCount).get$isOptional()) return false; | 9857 if (!this.parameters.$index(bareCount).get$isOptional()) return false; |
| 9839 for (var i = bareCount; | 9858 for (var i = bareCount; |
| 9840 i < args.get$length(); i++) { | 9859 i < args.get$length(); i++) { |
| 9841 if (this.indexOfParameter(args.getName(i)) < 0) { | 9860 if (this.indexOfParameter(args.getName(i)) < 0) { |
| 9842 return false; | 9861 return false; |
| 9843 } | 9862 } |
| 9844 } | 9863 } |
| 9845 } | 9864 } |
| 9846 return true; | 9865 return true; |
| 9847 } | 9866 } |
| 9848 MethodMember.prototype.indexOfParameter = function(name) { | 9867 MethodMember.prototype.indexOfParameter = function(name0) { |
| 9849 for (var i = 0; | 9868 for (var i = 0; |
| 9850 i < this.parameters.length; i++) { | 9869 i < this.parameters.length; i++) { |
| 9851 var p = this.parameters.$index(i); | 9870 var p = this.parameters.$index(i); |
| 9852 if (p.get$isOptional() && $eq(p.get$name(), name)) { | 9871 if (p.get$isOptional() && $eq(p.get$name(), name0)) { |
| 9853 return i; | 9872 return i; |
| 9854 } | 9873 } |
| 9855 } | 9874 } |
| 9856 return -1; | 9875 return -1; |
| 9857 } | 9876 } |
| 9858 MethodMember.prototype.resolveType = function(node, isRequired) { | 9877 MethodMember.prototype.resolveType = function(node, isRequired) { |
| 9859 var type = this.declaringType.resolveType(node, isRequired); | 9878 var type = this.declaringType.resolveType(node, isRequired); |
| 9860 if (this.isStatic && type.get$hasTypeParams()) { | 9879 if (this.isStatic && type.get$hasTypeParams()) { |
| 9861 world.error('using type parameter in static context', node.span); | 9880 world.error('using type parameter in static context', node.span); |
| 9862 } | 9881 } |
| 9863 return type; | 9882 return type; |
| 9864 } | 9883 } |
| 9865 MethodMember.prototype.get$prefersPropertySyntax = function() { | 9884 MethodMember.prototype.get$prefersPropertySyntax = function() { |
| 9866 return true; | 9885 return true; |
| 9867 } | 9886 } |
| 9868 MethodMember.prototype.get$requiresFieldSyntax = function() { | 9887 MethodMember.prototype.get$requiresFieldSyntax = function() { |
| 9869 return false; | 9888 return false; |
| 9870 } | 9889 } |
| 9871 MethodMember.prototype.provideFieldSyntax = function() { | 9890 MethodMember.prototype.provideFieldSyntax = function() { |
| 9872 return this._provideFieldSyntax = true; | 9891 return this._provideFieldSyntax = true; |
| 9873 } | 9892 } |
| 9874 MethodMember.prototype.providePropertySyntax = function() { | 9893 MethodMember.prototype.providePropertySyntax = function() { |
| 9875 return this._providePropertySyntax = true; | 9894 return this._providePropertySyntax = true; |
| 9876 } | 9895 } |
| 9877 MethodMember.prototype.set_ = function(gen, Node, target, value) { | 9896 MethodMember.prototype.set_ = function(gen, Node0, target, value) { |
| 9878 world.error('can not set method', this.definition); | 9897 world.error('can not set method', this.definition); |
| 9879 } | 9898 } |
| 9880 MethodMember.prototype.get_ = function(gen, node, target) { | 9899 MethodMember.prototype.get_ = function(gen, node, target) { |
| 9881 gen.genMethod(this); | 9900 gen.genMethod(this); |
| 9882 this._provideOptionalParamInfo = true; | 9901 this._provideOptionalParamInfo = true; |
| 9883 if (this.isStatic) { | 9902 if (this.isStatic) { |
| 9884 var type = this.declaringType.get$isTop() ? '' : ('' + this.declaringType.ge
t$jsname() + '.'); | 9903 var type = this.declaringType.get$isTop() ? '' : ('' + this.declaringType.ge
t$jsname() + '.'); |
| 9885 return new Value(this.get$functionType(), ('' + type + '' + this.get$jsname(
) + ''), false, true, false); | 9904 return new Value(this.get$functionType(), ('' + type + '' + this.get$jsname(
) + ''), false, true, false); |
| 9886 } | 9905 } |
| 9887 this._providePropertySyntax = true; | 9906 this._providePropertySyntax = true; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9972 return this._argError(node, target, args, msg); | 9991 return this._argError(node, target, args, msg); |
| 9973 } | 9992 } |
| 9974 else { | 9993 else { |
| 9975 argsCode.add(this.isConst && value.get$isConst() ? value.canonicalCode :
value.code); | 9994 argsCode.add(this.isConst && value.get$isConst() ? value.canonicalCode :
value.code); |
| 9976 } | 9995 } |
| 9977 } | 9996 } |
| 9978 if (namedArgsUsed < args.get$nameCount()) { | 9997 if (namedArgsUsed < args.get$nameCount()) { |
| 9979 var seen = new HashSetImplementation$String(); | 9998 var seen = new HashSetImplementation$String(); |
| 9980 for (var i = bareCount; | 9999 for (var i = bareCount; |
| 9981 i < args.get$length(); i++) { | 10000 i < args.get$length(); i++) { |
| 9982 var name = args.getName(i); | 10001 var name0 = args.getName(i); |
| 9983 if (seen.contains(name)) { | 10002 if (seen.contains(name0)) { |
| 9984 return this._argError(node, target, args, ('duplicate argument "' + na
me + '"')); | 10003 return this._argError(node, target, args, ('duplicate argument "' + na
me0 + '"')); |
| 9985 } | 10004 } |
| 9986 seen.add(name); | 10005 seen.add(name0); |
| 9987 var p = this.indexOfParameter(name); | 10006 var p = this.indexOfParameter(name0); |
| 9988 if (p < 0) { | 10007 if (p < 0) { |
| 9989 return this._argError(node, target, args, ('method does not have optio
nal parameter "' + name + '"')); | 10008 return this._argError(node, target, args, ('method does not have optio
nal parameter "' + name0 + '"')); |
| 9990 } | 10009 } |
| 9991 else if (p < bareCount) { | 10010 else if (p < bareCount) { |
| 9992 return this._argError(node, target, args, ('argument "' + name + '" pa
ssed as positional and named')); | 10011 return this._argError(node, target, args, ('argument "' + name0 + '" p
assed as positional and named')); |
| 9993 } | 10012 } |
| 9994 } | 10013 } |
| 9995 world.internalError(('wrong named arguments calling ' + this.name + ''), n
ode.span); | 10014 world.internalError(('wrong named arguments calling ' + this.name + ''), n
ode.span); |
| 9996 } | 10015 } |
| 9997 Arguments.removeTrailingNulls(argsCode); | 10016 Arguments.removeTrailingNulls(argsCode); |
| 9998 } | 10017 } |
| 9999 var argsString = Strings.join(argsCode, ', '); | 10018 var argsString = Strings.join(argsCode, ', '); |
| 10000 if (this.get$isConstructor()) { | 10019 if (this.get$isConstructor()) { |
| 10001 return this._invokeConstructor(gen, node, target, args, argsString); | 10020 return this._invokeConstructor(gen, node, target, args, argsString); |
| 10002 } | 10021 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10066 value = this.parameters.$index(i).get$value(); | 10085 value = this.parameters.$index(i).get$value(); |
| 10067 } | 10086 } |
| 10068 } | 10087 } |
| 10069 fields.$setindex(fname, value); | 10088 fields.$setindex(fname, value); |
| 10070 } | 10089 } |
| 10071 } | 10090 } |
| 10072 if (this.definition.initializers != null) { | 10091 if (this.definition.initializers != null) { |
| 10073 this.generator._pushBlock(false); | 10092 this.generator._pushBlock(false); |
| 10074 for (var j = 0; | 10093 for (var j = 0; |
| 10075 j < this.definition.formals.length; j++) { | 10094 j < this.definition.formals.length; j++) { |
| 10076 var name = this.definition.formals.$index(j).get$name().get$name(); | 10095 var name0 = this.definition.formals.$index(j).get$name().get$name(); |
| 10077 var value = null; | 10096 var value = null; |
| 10078 if (j < args.get$length()) { | 10097 if (j < args.get$length()) { |
| 10079 value = args.values.$index(j); | 10098 value = args.values.$index(j); |
| 10080 } | 10099 } |
| 10081 else { | 10100 else { |
| 10082 value = args.getValue(this.parameters.$index(j).get$name()); | 10101 value = args.getValue(this.parameters.$index(j).get$name()); |
| 10083 if (value == null) { | 10102 if (value == null) { |
| 10084 value = this.parameters.$index(j).get$value(); | 10103 value = this.parameters.$index(j).get$value(); |
| 10085 } | 10104 } |
| 10086 } | 10105 } |
| 10087 this.generator._scope._vars.$setindex(name, value); | 10106 this.generator._scope._vars.$setindex(name0, value); |
| 10088 } | 10107 } |
| 10089 var $list = this.definition.initializers; | 10108 var $list = this.definition.initializers; |
| 10090 for (var $i = 0;$i < $list.length; $i++) { | 10109 for (var $i = 0;$i < $list.length; $i++) { |
| 10091 var init = $list.$index($i); | 10110 var init = $list.$index($i); |
| 10092 if ((init instanceof CallExpression)) { | 10111 if ((init instanceof CallExpression)) { |
| 10093 var delegateArgs = this.generator._makeArgs(init.get$arguments()); | 10112 var delegateArgs = this.generator._makeArgs(init.get$arguments()); |
| 10094 var value = this.initDelegate.invoke(world.gen, node, target, delegateAr
gs); | 10113 var value = this.initDelegate.invoke(world.gen, node, target, delegateAr
gs); |
| 10095 if ((init.target instanceof ThisExpression)) { | 10114 if ((init.target instanceof ThisExpression)) { |
| 10096 return value; | 10115 return value; |
| 10097 } | 10116 } |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10721 function InterpStack(previous, quote, isMultiline) { | 10740 function InterpStack(previous, quote, isMultiline) { |
| 10722 this.previous = previous; | 10741 this.previous = previous; |
| 10723 this.quote = quote; | 10742 this.quote = quote; |
| 10724 this.isMultiline = isMultiline; | 10743 this.isMultiline = isMultiline; |
| 10725 this.depth = -1; | 10744 this.depth = -1; |
| 10726 // Initializers done | 10745 // Initializers done |
| 10727 } | 10746 } |
| 10728 InterpStack.prototype.pop = function() { | 10747 InterpStack.prototype.pop = function() { |
| 10729 return this.previous; | 10748 return this.previous; |
| 10730 } | 10749 } |
| 10731 InterpStack.push = function(stack, quote, isMultiline) { | 10750 InterpStack.push = function(stack, quote0, isMultiline0) { |
| 10732 var newStack = new InterpStack(stack, quote, isMultiline); | 10751 var newStack = new InterpStack(stack, quote0, isMultiline0); |
| 10733 if (stack != null) newStack.previous = stack; | 10752 if (stack != null) newStack.previous = stack; |
| 10734 return newStack; | 10753 return newStack; |
| 10735 } | 10754 } |
| 10736 // ********** Code for TokenizerBase ************** | 10755 // ********** Code for TokenizerBase ************** |
| 10737 function TokenizerBase(_source, _skipWhitespace, _index) { | 10756 function TokenizerBase(_source, _skipWhitespace, _index) { |
| 10738 this._source = _source; | 10757 this._source = _source; |
| 10739 this._skipWhitespace = _skipWhitespace; | 10758 this._skipWhitespace = _skipWhitespace; |
| 10740 this._lang_index = _index; | 10759 this._lang_index = _index; |
| 10741 // Initializers done | 10760 // Initializers done |
| 10742 this._text = this._source.get$text(); | 10761 this._text = this._source.get$text(); |
| (...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12608 this._eatSemicolon(); | 12627 this._eatSemicolon(); |
| 12609 return new NativeStatement(nativeBody, this._makeSpan(start)); | 12628 return new NativeStatement(nativeBody, this._makeSpan(start)); |
| 12610 } | 12629 } |
| 12611 else { | 12630 else { |
| 12612 return this.functionBody(inExpression); | 12631 return this.functionBody(inExpression); |
| 12613 } | 12632 } |
| 12614 } | 12633 } |
| 12615 } | 12634 } |
| 12616 this._lang_error('Expected function body (neither { nor => found)'); | 12635 this._lang_error('Expected function body (neither { nor => found)'); |
| 12617 } | 12636 } |
| 12618 lang_Parser.prototype.finishField = function(start, modifiers, type, name, value
) { | 12637 lang_Parser.prototype.finishField = function(start, modifiers, type0, name, valu
e) { |
| 12619 var names = [name]; | 12638 var names = [name]; |
| 12620 var values = [value]; | 12639 var values = [value]; |
| 12621 while (this._maybeEat(11/*TokenKind.COMMA*/)) { | 12640 while (this._maybeEat(11/*TokenKind.COMMA*/)) { |
| 12622 names.add(this.identifier()); | 12641 names.add(this.identifier()); |
| 12623 if (this._maybeEat(20/*TokenKind.ASSIGN*/)) { | 12642 if (this._maybeEat(20/*TokenKind.ASSIGN*/)) { |
| 12624 values.add(this.expression()); | 12643 values.add(this.expression()); |
| 12625 } | 12644 } |
| 12626 else { | 12645 else { |
| 12627 values.add(null); | 12646 values.add(null); |
| 12628 } | 12647 } |
| 12629 } | 12648 } |
| 12630 this._eatSemicolon(); | 12649 this._eatSemicolon(); |
| 12631 return new VariableDefinition(modifiers, type, names, values, this._makeSpan(s
tart)); | 12650 return new VariableDefinition(modifiers, type0, names, values, this._makeSpan(
start)); |
| 12632 } | 12651 } |
| 12633 lang_Parser.prototype.finishDefinition = function(start, modifiers, di) { | 12652 lang_Parser.prototype.finishDefinition = function(start, modifiers, di) { |
| 12634 switch (this._peek()) { | 12653 switch (this._peek()) { |
| 12635 case 2/*TokenKind.LPAREN*/: | 12654 case 2/*TokenKind.LPAREN*/: |
| 12636 | 12655 |
| 12637 var formals = this.formalParameterList(); | 12656 var formals = this.formalParameterList(); |
| 12638 var inits = null; | 12657 var inits = null; |
| 12639 if (this._maybeEat(8/*TokenKind.COLON*/)) { | 12658 if (this._maybeEat(8/*TokenKind.COLON*/)) { |
| 12640 inits = this.initializers(); | 12659 inits = this.initializers(); |
| 12641 } | 12660 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12676 var factoryToken = this._lang_next(); | 12695 var factoryToken = this._lang_next(); |
| 12677 var names = [this.identifier()]; | 12696 var names = [this.identifier()]; |
| 12678 while (this._maybeEat(14/*TokenKind.DOT*/)) { | 12697 while (this._maybeEat(14/*TokenKind.DOT*/)) { |
| 12679 names.add(this.identifier()); | 12698 names.add(this.identifier()); |
| 12680 } | 12699 } |
| 12681 var typeParams = null; | 12700 var typeParams = null; |
| 12682 if (this._peekKind(52/*TokenKind.LT*/)) { | 12701 if (this._peekKind(52/*TokenKind.LT*/)) { |
| 12683 typeParams = this.typeParameters(); | 12702 typeParams = this.typeParameters(); |
| 12684 } | 12703 } |
| 12685 var name = null; | 12704 var name = null; |
| 12686 var type = null; | 12705 var type0 = null; |
| 12687 if (this._maybeEat(14/*TokenKind.DOT*/)) { | 12706 if (this._maybeEat(14/*TokenKind.DOT*/)) { |
| 12688 name = this.identifier(); | 12707 name = this.identifier(); |
| 12689 } | 12708 } |
| 12690 else if (typeParams == null) { | 12709 else if (typeParams == null) { |
| 12691 if (names.length > 1) { | 12710 if (names.length > 1) { |
| 12692 name = names.removeLast(); | 12711 name = names.removeLast(); |
| 12693 } | 12712 } |
| 12694 else { | 12713 else { |
| 12695 name = new lang_Identifier('', names.$index(0).get$span()); | 12714 name = new lang_Identifier('', names.$index(0).get$span()); |
| 12696 } | 12715 } |
| 12697 } | 12716 } |
| 12698 else { | 12717 else { |
| 12699 name = new lang_Identifier('', names.$index(0).get$span()); | 12718 name = new lang_Identifier('', names.$index(0).get$span()); |
| 12700 } | 12719 } |
| 12701 if (names.length > 1) { | 12720 if (names.length > 1) { |
| 12702 this._lang_error('unsupported qualified name for factory', names.$index(0).g
et$span()); | 12721 this._lang_error('unsupported qualified name for factory', names.$index(0).g
et$span()); |
| 12703 } | 12722 } |
| 12704 type = new NameTypeReference(false, names.$index(0), null, names.$index(0).get
$span()); | 12723 type0 = new NameTypeReference(false, names.$index(0), null, names.$index(0).ge
t$span()); |
| 12705 var di = new DeclaredIdentifier(type, name, this._makeSpan(start)); | 12724 var di = new DeclaredIdentifier(type0, name, this._makeSpan(start)); |
| 12706 return this.finishDefinition(start, [factoryToken], di); | 12725 return this.finishDefinition(start, [factoryToken], di); |
| 12707 } | 12726 } |
| 12708 lang_Parser.prototype.statement = function() { | 12727 lang_Parser.prototype.statement = function() { |
| 12709 switch (this._peek()) { | 12728 switch (this._peek()) { |
| 12710 case 87/*TokenKind.BREAK*/: | 12729 case 87/*TokenKind.BREAK*/: |
| 12711 | 12730 |
| 12712 return this.breakStatement(); | 12731 return this.breakStatement(); |
| 12713 | 12732 |
| 12714 case 91/*TokenKind.CONTINUE*/: | 12733 case 91/*TokenKind.CONTINUE*/: |
| 12715 | 12734 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13042 return new ContinueStatement(name, this._makeSpan(start)); | 13061 return new ContinueStatement(name, this._makeSpan(start)); |
| 13043 } | 13062 } |
| 13044 lang_Parser.prototype.expression = function() { | 13063 lang_Parser.prototype.expression = function() { |
| 13045 return this.infixExpression(0); | 13064 return this.infixExpression(0); |
| 13046 } | 13065 } |
| 13047 lang_Parser.prototype._makeType = function(expr) { | 13066 lang_Parser.prototype._makeType = function(expr) { |
| 13048 if ((expr instanceof VarExpression)) { | 13067 if ((expr instanceof VarExpression)) { |
| 13049 return new NameTypeReference(false, expr.get$name(), null, expr.get$span()); | 13068 return new NameTypeReference(false, expr.get$name(), null, expr.get$span()); |
| 13050 } | 13069 } |
| 13051 else if ((expr instanceof DotExpression)) { | 13070 else if ((expr instanceof DotExpression)) { |
| 13052 var type = this._makeType(expr.self); | 13071 var type0 = this._makeType(expr.self); |
| 13053 if (type.names == null) { | 13072 if (type0.names == null) { |
| 13054 type.names = [expr.get$name()]; | 13073 type0.names = [expr.get$name()]; |
| 13055 } | 13074 } |
| 13056 else { | 13075 else { |
| 13057 type.names.add(expr.get$name()); | 13076 type0.names.add(expr.get$name()); |
| 13058 } | 13077 } |
| 13059 type.span = expr.get$span(); | 13078 type0.span = expr.get$span(); |
| 13060 return type; | 13079 return type0; |
| 13061 } | 13080 } |
| 13062 else { | 13081 else { |
| 13063 this._lang_error('expected type reference'); | 13082 this._lang_error('expected type reference'); |
| 13064 return null; | 13083 return null; |
| 13065 } | 13084 } |
| 13066 } | 13085 } |
| 13067 lang_Parser.prototype.infixExpression = function(precedence) { | 13086 lang_Parser.prototype.infixExpression = function(precedence) { |
| 13068 return this.finishInfixExpression(this.unaryExpression(), precedence); | 13087 return this.finishInfixExpression(this.unaryExpression(), precedence); |
| 13069 } | 13088 } |
| 13070 lang_Parser.prototype._finishDeclaredId = function(type) { | 13089 lang_Parser.prototype._finishDeclaredId = function(type0) { |
| 13071 var name = this.identifier(); | 13090 var name = this.identifier(); |
| 13072 return this.finishPostfixExpression(new DeclaredIdentifier(type, name, this._m
akeSpan(type.get$span().start))); | 13091 return this.finishPostfixExpression(new DeclaredIdentifier(type0, name, this._
makeSpan(type0.get$span().start))); |
| 13073 } | 13092 } |
| 13074 lang_Parser.prototype._fixAsType = function(x) { | 13093 lang_Parser.prototype._fixAsType = function(x) { |
| 13075 if (this._maybeEat(53/*TokenKind.GT*/)) { | 13094 if (this._maybeEat(53/*TokenKind.GT*/)) { |
| 13076 var base = this._makeType(x.x); | 13095 var base = this._makeType(x.x); |
| 13077 var typeParam = this._makeType(x.y); | 13096 var typeParam = this._makeType(x.y); |
| 13078 var type = new GenericTypeReference(base, [typeParam], 0, this._makeSpan(x.s
pan.start)); | 13097 var type0 = new GenericTypeReference(base, [typeParam], 0, this._makeSpan(x.
span.start)); |
| 13079 return this._finishDeclaredId(type); | 13098 return this._finishDeclaredId(type0); |
| 13080 } | 13099 } |
| 13081 else { | 13100 else { |
| 13082 var base = this._makeType(x.x); | 13101 var base = this._makeType(x.x); |
| 13083 var paramBase = this._makeType(x.y); | 13102 var paramBase = this._makeType(x.y); |
| 13084 var firstParam = this.addTypeArguments(paramBase, 1); | 13103 var firstParam = this.addTypeArguments(paramBase, 1); |
| 13085 var type; | 13104 var type0; |
| 13086 if (firstParam.depth <= 0) { | 13105 if (firstParam.depth <= 0) { |
| 13087 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp
an.start)); | 13106 type0 = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.s
pan.start)); |
| 13088 } | 13107 } |
| 13089 else if (this._maybeEat(11/*TokenKind.COMMA*/)) { | 13108 else if (this._maybeEat(11/*TokenKind.COMMA*/)) { |
| 13090 type = this._finishTypeArguments(base, 0, [firstParam]); | 13109 type0 = this._finishTypeArguments(base, 0, [firstParam]); |
| 13091 } | 13110 } |
| 13092 else { | 13111 else { |
| 13093 this._eat(53/*TokenKind.GT*/); | 13112 this._eat(53/*TokenKind.GT*/); |
| 13094 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp
an.start)); | 13113 type0 = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.s
pan.start)); |
| 13095 } | 13114 } |
| 13096 return this._finishDeclaredId(type); | 13115 return this._finishDeclaredId(type0); |
| 13097 } | 13116 } |
| 13098 } | 13117 } |
| 13099 lang_Parser.prototype.finishInfixExpression = function(x, precedence) { | 13118 lang_Parser.prototype.finishInfixExpression = function(x, precedence) { |
| 13100 while (true) { | 13119 while (true) { |
| 13101 var kind = this._peek(); | 13120 var kind = this._peek(); |
| 13102 var prec = TokenKind.infixPrecedence(this._peek()); | 13121 var prec = TokenKind.infixPrecedence(this._peek()); |
| 13103 if (prec >= precedence) { | 13122 if (prec >= precedence) { |
| 13104 if (kind == 52/*TokenKind.LT*/ || kind == 53/*TokenKind.GT*/) { | 13123 if (kind == 52/*TokenKind.LT*/ || kind == 53/*TokenKind.GT*/) { |
| 13105 if (this._isBin(x, 52/*TokenKind.LT*/)) { | 13124 if (this._isBin(x, 52/*TokenKind.LT*/)) { |
| 13106 return this._fixAsType(x); | 13125 return this._fixAsType(x); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13412 else { | 13431 else { |
| 13413 if (args.length == 1) { | 13432 if (args.length == 1) { |
| 13414 return new ParenExpression(args.$index(0).get$value(), this._makeSpan(star
t)); | 13433 return new ParenExpression(args.$index(0).get$value(), this._makeSpan(star
t)); |
| 13415 } | 13434 } |
| 13416 else { | 13435 else { |
| 13417 this._lang_error('unexpected comma expression'); | 13436 this._lang_error('unexpected comma expression'); |
| 13418 return args.$index(0).get$value(); | 13437 return args.$index(0).get$value(); |
| 13419 } | 13438 } |
| 13420 } | 13439 } |
| 13421 } | 13440 } |
| 13422 lang_Parser.prototype._typeAsIdentifier = function(type) { | 13441 lang_Parser.prototype._typeAsIdentifier = function(type0) { |
| 13423 return type.get$name(); | 13442 return type0.get$name(); |
| 13424 } | 13443 } |
| 13425 lang_Parser.prototype._specialIdentifier = function(includeOperators) { | 13444 lang_Parser.prototype._specialIdentifier = function(includeOperators) { |
| 13426 var start = this._peekToken.start; | 13445 var start = this._peekToken.start; |
| 13427 var name; | 13446 var name; |
| 13428 switch (this._peek()) { | 13447 switch (this._peek()) { |
| 13429 case 15/*TokenKind.ELLIPSIS*/: | 13448 case 15/*TokenKind.ELLIPSIS*/: |
| 13430 | 13449 |
| 13431 this._eat(15/*TokenKind.ELLIPSIS*/); | 13450 this._eat(15/*TokenKind.ELLIPSIS*/); |
| 13432 this._lang_error('rest no longer supported', this._previousToken); | 13451 this._lang_error('rest no longer supported', this._previousToken); |
| 13433 name = this.identifier().get$name(); | 13452 name = this.identifier().get$name(); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13529 lang_Parser.parseHex = function(hex) { | 13548 lang_Parser.parseHex = function(hex) { |
| 13530 var result = 0; | 13549 var result = 0; |
| 13531 for (var i = 0; | 13550 for (var i = 0; |
| 13532 i < hex.length; i++) { | 13551 i < hex.length; i++) { |
| 13533 var digit = lang_Parser._hexDigit(hex.charCodeAt(i)); | 13552 var digit = lang_Parser._hexDigit(hex.charCodeAt(i)); |
| 13534 result = (result << 4) + digit; | 13553 result = (result << 4) + digit; |
| 13535 } | 13554 } |
| 13536 return result; | 13555 return result; |
| 13537 } | 13556 } |
| 13538 lang_Parser.prototype.finishNewExpression = function(start, isConst) { | 13557 lang_Parser.prototype.finishNewExpression = function(start, isConst) { |
| 13539 var type = this.type(0); | 13558 var type0 = this.type(0); |
| 13540 var name = null; | 13559 var name = null; |
| 13541 if (this._maybeEat(14/*TokenKind.DOT*/)) { | 13560 if (this._maybeEat(14/*TokenKind.DOT*/)) { |
| 13542 name = this.identifier(); | 13561 name = this.identifier(); |
| 13543 } | 13562 } |
| 13544 var args = this.arguments(); | 13563 var args = this.arguments(); |
| 13545 return new lang_NewExpression(isConst, type, name, args, this._makeSpan(start)
); | 13564 return new lang_NewExpression(isConst, type0, name, args, this._makeSpan(start
)); |
| 13546 } | 13565 } |
| 13547 lang_Parser.prototype.finishListLiteral = function(start, isConst, type) { | 13566 lang_Parser.prototype.finishListLiteral = function(start, isConst, type0) { |
| 13548 if (this._maybeEat(56/*TokenKind.INDEX*/)) { | 13567 if (this._maybeEat(56/*TokenKind.INDEX*/)) { |
| 13549 return new ListExpression(isConst, type, [], this._makeSpan(start)); | 13568 return new ListExpression(isConst, type0, [], this._makeSpan(start)); |
| 13550 } | 13569 } |
| 13551 var values = []; | 13570 var values = []; |
| 13552 this._eat(4/*TokenKind.LBRACK*/); | 13571 this._eat(4/*TokenKind.LBRACK*/); |
| 13553 while (!this._maybeEat(5/*TokenKind.RBRACK*/)) { | 13572 while (!this._maybeEat(5/*TokenKind.RBRACK*/)) { |
| 13554 if (this.isPrematureEndOfFile()) break; | 13573 if (this.isPrematureEndOfFile()) break; |
| 13555 values.add(this.expression()); | 13574 values.add(this.expression()); |
| 13556 if (!this._maybeEat(11/*TokenKind.COMMA*/)) { | 13575 if (!this._maybeEat(11/*TokenKind.COMMA*/)) { |
| 13557 this._eat(5/*TokenKind.RBRACK*/); | 13576 this._eat(5/*TokenKind.RBRACK*/); |
| 13558 break; | 13577 break; |
| 13559 } | 13578 } |
| 13560 } | 13579 } |
| 13561 return new ListExpression(isConst, type, values, this._makeSpan(start)); | 13580 return new ListExpression(isConst, type0, values, this._makeSpan(start)); |
| 13562 } | 13581 } |
| 13563 lang_Parser.prototype.finishMapLiteral = function(start, isConst, type) { | 13582 lang_Parser.prototype.finishMapLiteral = function(start, isConst, type0) { |
| 13564 var items = []; | 13583 var items = []; |
| 13565 this._eat(6/*TokenKind.LBRACE*/); | 13584 this._eat(6/*TokenKind.LBRACE*/); |
| 13566 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) { | 13585 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) { |
| 13567 if (this.isPrematureEndOfFile()) break; | 13586 if (this.isPrematureEndOfFile()) break; |
| 13568 items.add(this.expression()); | 13587 items.add(this.expression()); |
| 13569 this._eat(8/*TokenKind.COLON*/); | 13588 this._eat(8/*TokenKind.COLON*/); |
| 13570 items.add(this.expression()); | 13589 items.add(this.expression()); |
| 13571 if (!this._maybeEat(11/*TokenKind.COMMA*/)) { | 13590 if (!this._maybeEat(11/*TokenKind.COMMA*/)) { |
| 13572 this._eat(7/*TokenKind.RBRACE*/); | 13591 this._eat(7/*TokenKind.RBRACE*/); |
| 13573 break; | 13592 break; |
| 13574 } | 13593 } |
| 13575 } | 13594 } |
| 13576 return new MapExpression(isConst, type, items, this._makeSpan(start)); | 13595 return new MapExpression(isConst, type0, items, this._makeSpan(start)); |
| 13577 } | 13596 } |
| 13578 lang_Parser.prototype.finishTypedLiteral = function(start, isConst) { | 13597 lang_Parser.prototype.finishTypedLiteral = function(start, isConst) { |
| 13579 var span = this._makeSpan(start); | 13598 var span = this._makeSpan(start); |
| 13580 var typeToBeNamedLater = new NameTypeReference(false, null, null, span); | 13599 var typeToBeNamedLater = new NameTypeReference(false, null, null, span); |
| 13581 var genericType = this.addTypeArguments(typeToBeNamedLater, 0); | 13600 var genericType = this.addTypeArguments(typeToBeNamedLater, 0); |
| 13582 if (this._peekKind(4/*TokenKind.LBRACK*/) || this._peekKind(56/*TokenKind.INDE
X*/)) { | 13601 if (this._peekKind(4/*TokenKind.LBRACK*/) || this._peekKind(56/*TokenKind.INDE
X*/)) { |
| 13583 return this.finishListLiteral(start, isConst, genericType); | 13602 return this.finishListLiteral(start, isConst, genericType); |
| 13584 } | 13603 } |
| 13585 else if (this._peekKind(6/*TokenKind.LBRACE*/)) { | 13604 else if (this._peekKind(6/*TokenKind.LBRACE*/)) { |
| 13586 return this.finishMapLiteral(start, isConst, genericType); | 13605 return this.finishMapLiteral(start, isConst, genericType); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13726 } | 13745 } |
| 13727 else { | 13746 else { |
| 13728 return typeRef; | 13747 return typeRef; |
| 13729 } | 13748 } |
| 13730 } | 13749 } |
| 13731 lang_Parser.prototype.formalParameter = function(inOptionalBlock) { | 13750 lang_Parser.prototype.formalParameter = function(inOptionalBlock) { |
| 13732 var start = this._peekToken.start; | 13751 var start = this._peekToken.start; |
| 13733 var isThis = false; | 13752 var isThis = false; |
| 13734 var isRest = false; | 13753 var isRest = false; |
| 13735 var di = this.declaredIdentifier(false); | 13754 var di = this.declaredIdentifier(false); |
| 13736 var type = di.type; | 13755 var type0 = di.type; |
| 13737 var name = di.get$name(); | 13756 var name = di.get$name(); |
| 13738 var value = null; | 13757 var value = null; |
| 13739 if (this._maybeEat(20/*TokenKind.ASSIGN*/)) { | 13758 if (this._maybeEat(20/*TokenKind.ASSIGN*/)) { |
| 13740 if (!inOptionalBlock) { | 13759 if (!inOptionalBlock) { |
| 13741 this._lang_error('default values only allowed inside [optional] section'); | 13760 this._lang_error('default values only allowed inside [optional] section'); |
| 13742 } | 13761 } |
| 13743 value = this.expression(); | 13762 value = this.expression(); |
| 13744 } | 13763 } |
| 13745 else if (this._peekKind(2/*TokenKind.LPAREN*/)) { | 13764 else if (this._peekKind(2/*TokenKind.LPAREN*/)) { |
| 13746 var formals = this.formalParameterList(); | 13765 var formals = this.formalParameterList(); |
| 13747 var func = new FunctionDefinition(null, type, name, formals, null, null, thi
s._makeSpan(start)); | 13766 var func = new FunctionDefinition(null, type0, name, formals, null, null, th
is._makeSpan(start)); |
| 13748 type = new FunctionTypeReference(false, func, func.get$span()); | 13767 type0 = new FunctionTypeReference(false, func, func.get$span()); |
| 13749 } | 13768 } |
| 13750 if (inOptionalBlock && value == null) { | 13769 if (inOptionalBlock && value == null) { |
| 13751 value = new NullExpression(this._makeSpan(start)); | 13770 value = new NullExpression(this._makeSpan(start)); |
| 13752 } | 13771 } |
| 13753 return new FormalNode(isThis, isRest, type, name, value, this._makeSpan(start)
); | 13772 return new FormalNode(isThis, isRest, type0, name, value, this._makeSpan(start
)); |
| 13754 } | 13773 } |
| 13755 lang_Parser.prototype.formalParameterList = function() { | 13774 lang_Parser.prototype.formalParameterList = function() { |
| 13756 this._eat(2/*TokenKind.LPAREN*/); | 13775 this._eat(2/*TokenKind.LPAREN*/); |
| 13757 var formals = []; | 13776 var formals = []; |
| 13758 var inOptionalBlock = false; | 13777 var inOptionalBlock = false; |
| 13759 if (!this._maybeEat(3/*TokenKind.RPAREN*/)) { | 13778 if (!this._maybeEat(3/*TokenKind.RPAREN*/)) { |
| 13760 if (this._maybeEat(4/*TokenKind.LBRACK*/)) { | 13779 if (this._maybeEat(4/*TokenKind.LBRACK*/)) { |
| 13761 inOptionalBlock = true; | 13780 inOptionalBlock = true; |
| 13762 } | 13781 } |
| 13763 formals.add(this.formalParameter(inOptionalBlock)); | 13782 formals.add(this.formalParameter(inOptionalBlock)); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 13778 return formals; | 13797 return formals; |
| 13779 } | 13798 } |
| 13780 lang_Parser.prototype.identifier = function() { | 13799 lang_Parser.prototype.identifier = function() { |
| 13781 var tok = this._lang_next(); | 13800 var tok = this._lang_next(); |
| 13782 if (!TokenKind.isIdentifier(tok.kind)) { | 13801 if (!TokenKind.isIdentifier(tok.kind)) { |
| 13783 this._lang_error(('expected identifier, but found ' + tok + ''), tok.get$spa
n()); | 13802 this._lang_error(('expected identifier, but found ' + tok + ''), tok.get$spa
n()); |
| 13784 } | 13803 } |
| 13785 return new lang_Identifier(tok.get$text(), this._makeSpan(tok.start)); | 13804 return new lang_Identifier(tok.get$text(), this._makeSpan(tok.start)); |
| 13786 } | 13805 } |
| 13787 lang_Parser.prototype._makeFunction = function(expr, body) { | 13806 lang_Parser.prototype._makeFunction = function(expr, body) { |
| 13788 var name, type; | 13807 var name, type0; |
| 13789 if ((expr instanceof CallExpression)) { | 13808 if ((expr instanceof CallExpression)) { |
| 13790 if ((expr.target instanceof VarExpression)) { | 13809 if ((expr.target instanceof VarExpression)) { |
| 13791 name = expr.target.get$name(); | 13810 name = expr.target.get$name(); |
| 13792 type = null; | 13811 type0 = null; |
| 13793 } | 13812 } |
| 13794 else if ((expr.target instanceof DeclaredIdentifier)) { | 13813 else if ((expr.target instanceof DeclaredIdentifier)) { |
| 13795 name = expr.target.get$name(); | 13814 name = expr.target.get$name(); |
| 13796 type = expr.target.type; | 13815 type0 = expr.target.type; |
| 13797 } | 13816 } |
| 13798 else { | 13817 else { |
| 13799 this._lang_error('bad function'); | 13818 this._lang_error('bad function'); |
| 13800 } | 13819 } |
| 13801 var formals = this._makeFormals(expr.get$arguments()); | 13820 var formals = this._makeFormals(expr.get$arguments()); |
| 13802 var span = new SourceSpan(expr.get$span().file, expr.get$span().start, body.
get$span().end); | 13821 var span = new SourceSpan(expr.get$span().file, expr.get$span().start, body.
get$span().end); |
| 13803 var func = new FunctionDefinition(null, type, name, formals, null, body, spa
n); | 13822 var func = new FunctionDefinition(null, type0, name, formals, null, body, sp
an); |
| 13804 return new LambdaExpression(func, func.get$span()); | 13823 return new LambdaExpression(func, func.get$span()); |
| 13805 } | 13824 } |
| 13806 else { | 13825 else { |
| 13807 this._lang_error('expected function'); | 13826 this._lang_error('expected function'); |
| 13808 } | 13827 } |
| 13809 } | 13828 } |
| 13810 lang_Parser.prototype._makeFormal = function(expr) { | 13829 lang_Parser.prototype._makeFormal = function(expr) { |
| 13811 if ((expr instanceof VarExpression)) { | 13830 if ((expr instanceof VarExpression)) { |
| 13812 return new FormalNode(false, false, null, expr.get$name(), null, expr.get$sp
an()); | 13831 return new FormalNode(false, false, null, expr.get$name(), null, expr.get$sp
an()); |
| 13813 } | 13832 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 13830 } | 13849 } |
| 13831 lang_Parser.prototype._makeFormalsFromList = function(expr) { | 13850 lang_Parser.prototype._makeFormalsFromList = function(expr) { |
| 13832 if (expr.get$isConst()) { | 13851 if (expr.get$isConst()) { |
| 13833 this._lang_error('expected formal, but found "const"', expr.get$span()); | 13852 this._lang_error('expected formal, but found "const"', expr.get$span()); |
| 13834 } | 13853 } |
| 13835 else if ($ne(expr.type, null)) { | 13854 else if ($ne(expr.type, null)) { |
| 13836 this._lang_error('expected formal, but found generic type arguments', expr.t
ype.get$span()); | 13855 this._lang_error('expected formal, but found generic type arguments', expr.t
ype.get$span()); |
| 13837 } | 13856 } |
| 13838 return this._makeFormalsFromExpressions(expr.values, false); | 13857 return this._makeFormalsFromExpressions(expr.values, false); |
| 13839 } | 13858 } |
| 13840 lang_Parser.prototype._makeFormals = function(arguments) { | 13859 lang_Parser.prototype._makeFormals = function(arguments0) { |
| 13841 var expressions = []; | 13860 var expressions = []; |
| 13842 for (var i = 0; | 13861 for (var i = 0; |
| 13843 i < arguments.length; i++) { | 13862 i < arguments0.length; i++) { |
| 13844 var arg = arguments.$index(i); | 13863 var arg = arguments0.$index(i); |
| 13845 if (arg.label != null) { | 13864 if (arg.label != null) { |
| 13846 this._lang_error('expected formal, but found ":"'); | 13865 this._lang_error('expected formal, but found ":"'); |
| 13847 } | 13866 } |
| 13848 expressions.add(arg.get$value()); | 13867 expressions.add(arg.get$value()); |
| 13849 } | 13868 } |
| 13850 return this._makeFormalsFromExpressions(expressions, true); | 13869 return this._makeFormalsFromExpressions(expressions, true); |
| 13851 } | 13870 } |
| 13852 lang_Parser.prototype._makeFormalsFromExpressions = function(expressions, allowO
ptional) { | 13871 lang_Parser.prototype._makeFormalsFromExpressions = function(expressions, allowO
ptional) { |
| 13853 var formals = []; | 13872 var formals = []; |
| 13854 for (var i = 0; | 13873 for (var i = 0; |
| 13855 i < expressions.length; i++) { | 13874 i < expressions.length; i++) { |
| 13856 var formal = this._makeFormal(expressions.$index(i)); | 13875 var formal = this._makeFormal(expressions.$index(i)); |
| 13857 if (formal == null) { | 13876 if (formal == null) { |
| 13858 var baseType = this._makeType(expressions.$index(i).x); | 13877 var baseType = this._makeType(expressions.$index(i).x); |
| 13859 var typeParams = [this._makeType(expressions.$index(i).y)]; | 13878 var typeParams = [this._makeType(expressions.$index(i).y)]; |
| 13860 i++; | 13879 i++; |
| 13861 while (i < expressions.length) { | 13880 while (i < expressions.length) { |
| 13862 var expr = expressions.$index(i++); | 13881 var expr = expressions.$index(i++); |
| 13863 if (this._isBin(expr, 53/*TokenKind.GT*/)) { | 13882 if (this._isBin(expr, 53/*TokenKind.GT*/)) { |
| 13864 typeParams.add(this._makeType(expr.x)); | 13883 typeParams.add(this._makeType(expr.x)); |
| 13865 var type = new GenericTypeReference(baseType, typeParams, 0, this._mak
eSpan(baseType.get$span().start)); | 13884 var type0 = new GenericTypeReference(baseType, typeParams, 0, this._ma
keSpan(baseType.get$span().start)); |
| 13866 var name = null; | 13885 var name = null; |
| 13867 if ((expr.y instanceof VarExpression)) { | 13886 if ((expr.y instanceof VarExpression)) { |
| 13868 var ve = expr.y; | 13887 var ve = expr.y; |
| 13869 name = ve.name; | 13888 name = ve.name; |
| 13870 } | 13889 } |
| 13871 else { | 13890 else { |
| 13872 this._lang_error('expected formal', expr.get$span()); | 13891 this._lang_error('expected formal', expr.get$span()); |
| 13873 } | 13892 } |
| 13874 formal = new FormalNode(false, false, type, name, null, this._makeSpan
(expressions.$index(0).get$span().start)); | 13893 formal = new FormalNode(false, false, type0, name, null, this._makeSpa
n(expressions.$index(0).get$span().start)); |
| 13875 break; | 13894 break; |
| 13876 } | 13895 } |
| 13877 else { | 13896 else { |
| 13878 typeParams.add(this._makeType(expr)); | 13897 typeParams.add(this._makeType(expr)); |
| 13879 } | 13898 } |
| 13880 } | 13899 } |
| 13881 formals.add(formal); | 13900 formals.add(formal); |
| 13882 } | 13901 } |
| 13883 else if (!!(formal && formal.is$List)) { | 13902 else if (!!(formal && formal.is$List)) { |
| 13884 formals.addAll(formal); | 13903 formals.addAll(formal); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 13914 } | 13933 } |
| 13915 } | 13934 } |
| 13916 // ********** Code for lang_Node ************** | 13935 // ********** Code for lang_Node ************** |
| 13917 function lang_Node(span) { | 13936 function lang_Node(span) { |
| 13918 this.span = span; | 13937 this.span = span; |
| 13919 // Initializers done | 13938 // Initializers done |
| 13920 } | 13939 } |
| 13921 lang_Node.prototype.get$span = function() { return this.span; }; | 13940 lang_Node.prototype.get$span = function() { return this.span; }; |
| 13922 lang_Node.prototype.set$span = function(value) { return this.span = value; }; | 13941 lang_Node.prototype.set$span = function(value) { return this.span = value; }; |
| 13923 // ********** Code for Definition ************** | 13942 // ********** Code for Definition ************** |
| 13924 function Definition(span) { | 13943 function Definition(span0) { |
| 13925 lang_Statement.call(this, span); | 13944 lang_Statement.call(this, span0); |
| 13926 // Initializers done | 13945 // Initializers done |
| 13927 } | 13946 } |
| 13928 $inherits(Definition, lang_Statement); | 13947 $inherits(Definition, lang_Statement); |
| 13929 Definition.prototype.get$typeParameters = function() { | 13948 Definition.prototype.get$typeParameters = function() { |
| 13930 return null; | 13949 return null; |
| 13931 } | 13950 } |
| 13932 // ********** Code for lang_Statement ************** | 13951 // ********** Code for lang_Statement ************** |
| 13933 function lang_Statement(span) { | 13952 function lang_Statement(span0) { |
| 13934 lang_Node.call(this, span); | 13953 lang_Node.call(this, span0); |
| 13935 // Initializers done | 13954 // Initializers done |
| 13936 } | 13955 } |
| 13937 $inherits(lang_Statement, lang_Node); | 13956 $inherits(lang_Statement, lang_Node); |
| 13938 // ********** Code for lang_Expression ************** | 13957 // ********** Code for lang_Expression ************** |
| 13939 function lang_Expression(span) { | 13958 function lang_Expression(span0) { |
| 13940 lang_Node.call(this, span); | 13959 lang_Node.call(this, span0); |
| 13941 // Initializers done | 13960 // Initializers done |
| 13942 } | 13961 } |
| 13943 $inherits(lang_Expression, lang_Node); | 13962 $inherits(lang_Expression, lang_Node); |
| 13944 // ********** Code for TypeReference ************** | 13963 // ********** Code for TypeReference ************** |
| 13945 function TypeReference(span, type) { | 13964 function TypeReference(span0, type) { |
| 13946 this.type = type; | 13965 this.type = type; |
| 13947 lang_Node.call(this, span); | 13966 lang_Node.call(this, span0); |
| 13948 // Initializers done | 13967 // Initializers done |
| 13949 } | 13968 } |
| 13950 $inherits(TypeReference, lang_Node); | 13969 $inherits(TypeReference, lang_Node); |
| 13951 TypeReference.prototype.visit = function(visitor) { | 13970 TypeReference.prototype.visit = function(visitor) { |
| 13952 return visitor.visitTypeReference(this); | 13971 return visitor.visitTypeReference(this); |
| 13953 } | 13972 } |
| 13954 // ********** Code for TreeOutput ************** | 13973 // ********** Code for TreeOutput ************** |
| 13955 function TreeOutput() {} | 13974 function TreeOutput() {} |
| 13956 TreeOutput.prototype.write = function(s) { | 13975 TreeOutput.prototype.write = function(s) { |
| 13957 for (var i = 0; | 13976 for (var i = 0; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14009 node.visit(this.printer); | 14028 node.visit(this.printer); |
| 14010 } | 14029 } |
| 14011 else { | 14030 else { |
| 14012 this.writeln('null'); | 14031 this.writeln('null'); |
| 14013 } | 14032 } |
| 14014 } | 14033 } |
| 14015 this.depth -= 1; | 14034 this.depth -= 1; |
| 14016 } | 14035 } |
| 14017 } | 14036 } |
| 14018 // ********** Code for DirectiveDefinition ************** | 14037 // ********** Code for DirectiveDefinition ************** |
| 14019 function DirectiveDefinition(name, arguments, span) { | 14038 function DirectiveDefinition(name, arguments, span0) { |
| 14020 this.name = name; | 14039 this.name = name; |
| 14021 this.arguments = arguments; | 14040 this.arguments = arguments; |
| 14022 Definition.call(this, span); | 14041 Definition.call(this, span0); |
| 14023 // Initializers done | 14042 // Initializers done |
| 14024 } | 14043 } |
| 14025 $inherits(DirectiveDefinition, Definition); | 14044 $inherits(DirectiveDefinition, Definition); |
| 14026 DirectiveDefinition.prototype.get$name = function() { return this.name; }; | 14045 DirectiveDefinition.prototype.get$name = function() { return this.name; }; |
| 14027 DirectiveDefinition.prototype.set$name = function(value) { return this.name = va
lue; }; | 14046 DirectiveDefinition.prototype.set$name = function(value) { return this.name = va
lue; }; |
| 14028 DirectiveDefinition.prototype.get$arguments = function() { return this.arguments
; }; | 14047 DirectiveDefinition.prototype.get$arguments = function() { return this.arguments
; }; |
| 14029 DirectiveDefinition.prototype.set$arguments = function(value) { return this.argu
ments = value; }; | 14048 DirectiveDefinition.prototype.set$arguments = function(value) { return this.argu
ments = value; }; |
| 14030 DirectiveDefinition.prototype.visit = function(visitor) { | 14049 DirectiveDefinition.prototype.visit = function(visitor) { |
| 14031 return visitor.visitDirectiveDefinition(this); | 14050 return visitor.visitDirectiveDefinition(this); |
| 14032 } | 14051 } |
| 14033 // ********** Code for TypeDefinition ************** | 14052 // ********** Code for TypeDefinition ************** |
| 14034 function TypeDefinition(isClass, name, typeParameters, extendsTypes, implementsT
ypes, nativeType, factoryType, body, span) { | 14053 function TypeDefinition(isClass, name, typeParameters, extendsTypes, implementsT
ypes, nativeType, factoryType, body, span0) { |
| 14035 this.isClass = isClass; | 14054 this.isClass = isClass; |
| 14036 this.name = name; | 14055 this.name = name; |
| 14037 this.typeParameters = typeParameters; | 14056 this.typeParameters = typeParameters; |
| 14038 this.extendsTypes = extendsTypes; | 14057 this.extendsTypes = extendsTypes; |
| 14039 this.implementsTypes = implementsTypes; | 14058 this.implementsTypes = implementsTypes; |
| 14040 this.nativeType = nativeType; | 14059 this.nativeType = nativeType; |
| 14041 this.factoryType = factoryType; | 14060 this.factoryType = factoryType; |
| 14042 this.body = body; | 14061 this.body = body; |
| 14043 Definition.call(this, span); | 14062 Definition.call(this, span0); |
| 14044 // Initializers done | 14063 // Initializers done |
| 14045 } | 14064 } |
| 14046 $inherits(TypeDefinition, Definition); | 14065 $inherits(TypeDefinition, Definition); |
| 14047 TypeDefinition.prototype.get$isClass = function() { return this.isClass; }; | 14066 TypeDefinition.prototype.get$isClass = function() { return this.isClass; }; |
| 14048 TypeDefinition.prototype.set$isClass = function(value) { return this.isClass = v
alue; }; | 14067 TypeDefinition.prototype.set$isClass = function(value) { return this.isClass = v
alue; }; |
| 14049 TypeDefinition.prototype.get$name = function() { return this.name; }; | 14068 TypeDefinition.prototype.get$name = function() { return this.name; }; |
| 14050 TypeDefinition.prototype.set$name = function(value) { return this.name = value;
}; | 14069 TypeDefinition.prototype.set$name = function(value) { return this.name = value;
}; |
| 14051 TypeDefinition.prototype.get$typeParameters = function() { return this.typeParam
eters; }; | 14070 TypeDefinition.prototype.get$typeParameters = function() { return this.typeParam
eters; }; |
| 14052 TypeDefinition.prototype.set$typeParameters = function(value) { return this.type
Parameters = value; }; | 14071 TypeDefinition.prototype.set$typeParameters = function(value) { return this.type
Parameters = value; }; |
| 14053 TypeDefinition.prototype.visit = function(visitor) { | 14072 TypeDefinition.prototype.visit = function(visitor) { |
| 14054 return visitor.visitTypeDefinition(this); | 14073 return visitor.visitTypeDefinition(this); |
| 14055 } | 14074 } |
| 14056 // ********** Code for FunctionTypeDefinition ************** | 14075 // ********** Code for FunctionTypeDefinition ************** |
| 14057 function FunctionTypeDefinition(func, typeParameters, span) { | 14076 function FunctionTypeDefinition(func, typeParameters, span0) { |
| 14058 this.func = func; | 14077 this.func = func; |
| 14059 this.typeParameters = typeParameters; | 14078 this.typeParameters = typeParameters; |
| 14060 Definition.call(this, span); | 14079 Definition.call(this, span0); |
| 14061 // Initializers done | 14080 // Initializers done |
| 14062 } | 14081 } |
| 14063 $inherits(FunctionTypeDefinition, Definition); | 14082 $inherits(FunctionTypeDefinition, Definition); |
| 14064 FunctionTypeDefinition.prototype.get$typeParameters = function() { return this.t
ypeParameters; }; | 14083 FunctionTypeDefinition.prototype.get$typeParameters = function() { return this.t
ypeParameters; }; |
| 14065 FunctionTypeDefinition.prototype.set$typeParameters = function(value) { return t
his.typeParameters = value; }; | 14084 FunctionTypeDefinition.prototype.set$typeParameters = function(value) { return t
his.typeParameters = value; }; |
| 14066 FunctionTypeDefinition.prototype.visit = function(visitor) { | 14085 FunctionTypeDefinition.prototype.visit = function(visitor) { |
| 14067 return visitor.visitFunctionTypeDefinition(this); | 14086 return visitor.visitFunctionTypeDefinition(this); |
| 14068 } | 14087 } |
| 14069 // ********** Code for VariableDefinition ************** | 14088 // ********** Code for VariableDefinition ************** |
| 14070 function VariableDefinition(modifiers, type, names, values, span) { | 14089 function VariableDefinition(modifiers, type, names, values, span0) { |
| 14071 this.modifiers = modifiers; | 14090 this.modifiers = modifiers; |
| 14072 this.type = type; | 14091 this.type = type; |
| 14073 this.names = names; | 14092 this.names = names; |
| 14074 this.values = values; | 14093 this.values = values; |
| 14075 Definition.call(this, span); | 14094 Definition.call(this, span0); |
| 14076 // Initializers done | 14095 // Initializers done |
| 14077 } | 14096 } |
| 14078 $inherits(VariableDefinition, Definition); | 14097 $inherits(VariableDefinition, Definition); |
| 14079 VariableDefinition.prototype.visit = function(visitor) { | 14098 VariableDefinition.prototype.visit = function(visitor) { |
| 14080 return visitor.visitVariableDefinition(this); | 14099 return visitor.visitVariableDefinition(this); |
| 14081 } | 14100 } |
| 14082 // ********** Code for FunctionDefinition ************** | 14101 // ********** Code for FunctionDefinition ************** |
| 14083 function FunctionDefinition(modifiers, returnType, name, formals, initializers,
body, span) { | 14102 function FunctionDefinition(modifiers, returnType, name, formals, initializers,
body, span0) { |
| 14084 this.modifiers = modifiers; | 14103 this.modifiers = modifiers; |
| 14085 this.returnType = returnType; | 14104 this.returnType = returnType; |
| 14086 this.name = name; | 14105 this.name = name; |
| 14087 this.formals = formals; | 14106 this.formals = formals; |
| 14088 this.initializers = initializers; | 14107 this.initializers = initializers; |
| 14089 this.body = body; | 14108 this.body = body; |
| 14090 Definition.call(this, span); | 14109 Definition.call(this, span0); |
| 14091 // Initializers done | 14110 // Initializers done |
| 14092 } | 14111 } |
| 14093 $inherits(FunctionDefinition, Definition); | 14112 $inherits(FunctionDefinition, Definition); |
| 14094 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp
e; }; | 14113 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp
e; }; |
| 14095 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu
rnType = value; }; | 14114 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu
rnType = value; }; |
| 14096 FunctionDefinition.prototype.get$name = function() { return this.name; }; | 14115 FunctionDefinition.prototype.get$name = function() { return this.name; }; |
| 14097 FunctionDefinition.prototype.set$name = function(value) { return this.name = val
ue; }; | 14116 FunctionDefinition.prototype.set$name = function(value) { return this.name = val
ue; }; |
| 14098 FunctionDefinition.prototype.visit = function(visitor) { | 14117 FunctionDefinition.prototype.visit = function(visitor) { |
| 14099 return visitor.visitFunctionDefinition(this); | 14118 return visitor.visitFunctionDefinition(this); |
| 14100 } | 14119 } |
| 14101 // ********** Code for ReturnStatement ************** | 14120 // ********** Code for ReturnStatement ************** |
| 14102 function ReturnStatement(value, span) { | 14121 function ReturnStatement(value, span0) { |
| 14103 this.value = value; | 14122 this.value = value; |
| 14104 lang_Statement.call(this, span); | 14123 lang_Statement.call(this, span0); |
| 14105 // Initializers done | 14124 // Initializers done |
| 14106 } | 14125 } |
| 14107 $inherits(ReturnStatement, lang_Statement); | 14126 $inherits(ReturnStatement, lang_Statement); |
| 14108 ReturnStatement.prototype.get$value = function() { return this.value; }; | 14127 ReturnStatement.prototype.get$value = function() { return this.value; }; |
| 14109 ReturnStatement.prototype.set$value = function(value) { return this.value = valu
e; }; | 14128 ReturnStatement.prototype.set$value = function(value) { return this.value = valu
e; }; |
| 14110 ReturnStatement.prototype.visit = function(visitor) { | 14129 ReturnStatement.prototype.visit = function(visitor) { |
| 14111 return visitor.visitReturnStatement(this); | 14130 return visitor.visitReturnStatement(this); |
| 14112 } | 14131 } |
| 14113 // ********** Code for ThrowStatement ************** | 14132 // ********** Code for ThrowStatement ************** |
| 14114 function ThrowStatement(value, span) { | 14133 function ThrowStatement(value, span0) { |
| 14115 this.value = value; | 14134 this.value = value; |
| 14116 lang_Statement.call(this, span); | 14135 lang_Statement.call(this, span0); |
| 14117 // Initializers done | 14136 // Initializers done |
| 14118 } | 14137 } |
| 14119 $inherits(ThrowStatement, lang_Statement); | 14138 $inherits(ThrowStatement, lang_Statement); |
| 14120 ThrowStatement.prototype.get$value = function() { return this.value; }; | 14139 ThrowStatement.prototype.get$value = function() { return this.value; }; |
| 14121 ThrowStatement.prototype.set$value = function(value) { return this.value = value
; }; | 14140 ThrowStatement.prototype.set$value = function(value) { return this.value = value
; }; |
| 14122 ThrowStatement.prototype.visit = function(visitor) { | 14141 ThrowStatement.prototype.visit = function(visitor) { |
| 14123 return visitor.visitThrowStatement(this); | 14142 return visitor.visitThrowStatement(this); |
| 14124 } | 14143 } |
| 14125 // ********** Code for AssertStatement ************** | 14144 // ********** Code for AssertStatement ************** |
| 14126 function AssertStatement(test, span) { | 14145 function AssertStatement(test, span0) { |
| 14127 this.test = test; | 14146 this.test = test; |
| 14128 lang_Statement.call(this, span); | 14147 lang_Statement.call(this, span0); |
| 14129 // Initializers done | 14148 // Initializers done |
| 14130 } | 14149 } |
| 14131 $inherits(AssertStatement, lang_Statement); | 14150 $inherits(AssertStatement, lang_Statement); |
| 14132 AssertStatement.prototype.visit = function(visitor) { | 14151 AssertStatement.prototype.visit = function(visitor) { |
| 14133 return visitor.visitAssertStatement(this); | 14152 return visitor.visitAssertStatement(this); |
| 14134 } | 14153 } |
| 14135 // ********** Code for BreakStatement ************** | 14154 // ********** Code for BreakStatement ************** |
| 14136 function BreakStatement(label, span) { | 14155 function BreakStatement(label, span0) { |
| 14137 this.label = label; | 14156 this.label = label; |
| 14138 lang_Statement.call(this, span); | 14157 lang_Statement.call(this, span0); |
| 14139 // Initializers done | 14158 // Initializers done |
| 14140 } | 14159 } |
| 14141 $inherits(BreakStatement, lang_Statement); | 14160 $inherits(BreakStatement, lang_Statement); |
| 14142 BreakStatement.prototype.visit = function(visitor) { | 14161 BreakStatement.prototype.visit = function(visitor) { |
| 14143 return visitor.visitBreakStatement(this); | 14162 return visitor.visitBreakStatement(this); |
| 14144 } | 14163 } |
| 14145 // ********** Code for ContinueStatement ************** | 14164 // ********** Code for ContinueStatement ************** |
| 14146 function ContinueStatement(label, span) { | 14165 function ContinueStatement(label, span0) { |
| 14147 this.label = label; | 14166 this.label = label; |
| 14148 lang_Statement.call(this, span); | 14167 lang_Statement.call(this, span0); |
| 14149 // Initializers done | 14168 // Initializers done |
| 14150 } | 14169 } |
| 14151 $inherits(ContinueStatement, lang_Statement); | 14170 $inherits(ContinueStatement, lang_Statement); |
| 14152 ContinueStatement.prototype.visit = function(visitor) { | 14171 ContinueStatement.prototype.visit = function(visitor) { |
| 14153 return visitor.visitContinueStatement(this); | 14172 return visitor.visitContinueStatement(this); |
| 14154 } | 14173 } |
| 14155 // ********** Code for IfStatement ************** | 14174 // ********** Code for IfStatement ************** |
| 14156 function IfStatement(test, trueBranch, falseBranch, span) { | 14175 function IfStatement(test, trueBranch, falseBranch, span0) { |
| 14157 this.test = test; | 14176 this.test = test; |
| 14158 this.trueBranch = trueBranch; | 14177 this.trueBranch = trueBranch; |
| 14159 this.falseBranch = falseBranch; | 14178 this.falseBranch = falseBranch; |
| 14160 lang_Statement.call(this, span); | 14179 lang_Statement.call(this, span0); |
| 14161 // Initializers done | 14180 // Initializers done |
| 14162 } | 14181 } |
| 14163 $inherits(IfStatement, lang_Statement); | 14182 $inherits(IfStatement, lang_Statement); |
| 14164 IfStatement.prototype.visit = function(visitor) { | 14183 IfStatement.prototype.visit = function(visitor) { |
| 14165 return visitor.visitIfStatement(this); | 14184 return visitor.visitIfStatement(this); |
| 14166 } | 14185 } |
| 14167 // ********** Code for WhileStatement ************** | 14186 // ********** Code for WhileStatement ************** |
| 14168 function WhileStatement(test, body, span) { | 14187 function WhileStatement(test, body, span0) { |
| 14169 this.test = test; | 14188 this.test = test; |
| 14170 this.body = body; | 14189 this.body = body; |
| 14171 lang_Statement.call(this, span); | 14190 lang_Statement.call(this, span0); |
| 14172 // Initializers done | 14191 // Initializers done |
| 14173 } | 14192 } |
| 14174 $inherits(WhileStatement, lang_Statement); | 14193 $inherits(WhileStatement, lang_Statement); |
| 14175 WhileStatement.prototype.visit = function(visitor) { | 14194 WhileStatement.prototype.visit = function(visitor) { |
| 14176 return visitor.visitWhileStatement(this); | 14195 return visitor.visitWhileStatement(this); |
| 14177 } | 14196 } |
| 14178 // ********** Code for DoStatement ************** | 14197 // ********** Code for DoStatement ************** |
| 14179 function DoStatement(body, test, span) { | 14198 function DoStatement(body, test, span0) { |
| 14180 this.body = body; | 14199 this.body = body; |
| 14181 this.test = test; | 14200 this.test = test; |
| 14182 lang_Statement.call(this, span); | 14201 lang_Statement.call(this, span0); |
| 14183 // Initializers done | 14202 // Initializers done |
| 14184 } | 14203 } |
| 14185 $inherits(DoStatement, lang_Statement); | 14204 $inherits(DoStatement, lang_Statement); |
| 14186 DoStatement.prototype.visit = function(visitor) { | 14205 DoStatement.prototype.visit = function(visitor) { |
| 14187 return visitor.visitDoStatement(this); | 14206 return visitor.visitDoStatement(this); |
| 14188 } | 14207 } |
| 14189 // ********** Code for ForStatement ************** | 14208 // ********** Code for ForStatement ************** |
| 14190 function ForStatement(init, test, step, body, span) { | 14209 function ForStatement(init, test, step, body, span0) { |
| 14191 this.init = init; | 14210 this.init = init; |
| 14192 this.test = test; | 14211 this.test = test; |
| 14193 this.step = step; | 14212 this.step = step; |
| 14194 this.body = body; | 14213 this.body = body; |
| 14195 lang_Statement.call(this, span); | 14214 lang_Statement.call(this, span0); |
| 14196 // Initializers done | 14215 // Initializers done |
| 14197 } | 14216 } |
| 14198 $inherits(ForStatement, lang_Statement); | 14217 $inherits(ForStatement, lang_Statement); |
| 14199 ForStatement.prototype.visit = function(visitor) { | 14218 ForStatement.prototype.visit = function(visitor) { |
| 14200 return visitor.visitForStatement(this); | 14219 return visitor.visitForStatement(this); |
| 14201 } | 14220 } |
| 14202 // ********** Code for ForInStatement ************** | 14221 // ********** Code for ForInStatement ************** |
| 14203 function ForInStatement(item, list, body, span) { | 14222 function ForInStatement(item, list, body, span0) { |
| 14204 this.item = item; | 14223 this.item = item; |
| 14205 this.list = list; | 14224 this.list = list; |
| 14206 this.body = body; | 14225 this.body = body; |
| 14207 lang_Statement.call(this, span); | 14226 lang_Statement.call(this, span0); |
| 14208 // Initializers done | 14227 // Initializers done |
| 14209 } | 14228 } |
| 14210 $inherits(ForInStatement, lang_Statement); | 14229 $inherits(ForInStatement, lang_Statement); |
| 14211 ForInStatement.prototype.visit = function(visitor) { | 14230 ForInStatement.prototype.visit = function(visitor) { |
| 14212 return visitor.visitForInStatement(this); | 14231 return visitor.visitForInStatement(this); |
| 14213 } | 14232 } |
| 14214 // ********** Code for TryStatement ************** | 14233 // ********** Code for TryStatement ************** |
| 14215 function TryStatement(body, catches, finallyBlock, span) { | 14234 function TryStatement(body, catches, finallyBlock, span0) { |
| 14216 this.body = body; | 14235 this.body = body; |
| 14217 this.catches = catches; | 14236 this.catches = catches; |
| 14218 this.finallyBlock = finallyBlock; | 14237 this.finallyBlock = finallyBlock; |
| 14219 lang_Statement.call(this, span); | 14238 lang_Statement.call(this, span0); |
| 14220 // Initializers done | 14239 // Initializers done |
| 14221 } | 14240 } |
| 14222 $inherits(TryStatement, lang_Statement); | 14241 $inherits(TryStatement, lang_Statement); |
| 14223 TryStatement.prototype.visit = function(visitor) { | 14242 TryStatement.prototype.visit = function(visitor) { |
| 14224 return visitor.visitTryStatement(this); | 14243 return visitor.visitTryStatement(this); |
| 14225 } | 14244 } |
| 14226 // ********** Code for SwitchStatement ************** | 14245 // ********** Code for SwitchStatement ************** |
| 14227 function SwitchStatement(test, cases, span) { | 14246 function SwitchStatement(test, cases, span0) { |
| 14228 this.test = test; | 14247 this.test = test; |
| 14229 this.cases = cases; | 14248 this.cases = cases; |
| 14230 lang_Statement.call(this, span); | 14249 lang_Statement.call(this, span0); |
| 14231 // Initializers done | 14250 // Initializers done |
| 14232 } | 14251 } |
| 14233 $inherits(SwitchStatement, lang_Statement); | 14252 $inherits(SwitchStatement, lang_Statement); |
| 14234 SwitchStatement.prototype.visit = function(visitor) { | 14253 SwitchStatement.prototype.visit = function(visitor) { |
| 14235 return visitor.visitSwitchStatement(this); | 14254 return visitor.visitSwitchStatement(this); |
| 14236 } | 14255 } |
| 14237 // ********** Code for BlockStatement ************** | 14256 // ********** Code for BlockStatement ************** |
| 14238 function BlockStatement(body, span) { | 14257 function BlockStatement(body, span0) { |
| 14239 this.body = body; | 14258 this.body = body; |
| 14240 lang_Statement.call(this, span); | 14259 lang_Statement.call(this, span0); |
| 14241 // Initializers done | 14260 // Initializers done |
| 14242 } | 14261 } |
| 14243 $inherits(BlockStatement, lang_Statement); | 14262 $inherits(BlockStatement, lang_Statement); |
| 14244 BlockStatement.prototype.visit = function(visitor) { | 14263 BlockStatement.prototype.visit = function(visitor) { |
| 14245 return visitor.visitBlockStatement(this); | 14264 return visitor.visitBlockStatement(this); |
| 14246 } | 14265 } |
| 14247 // ********** Code for LabeledStatement ************** | 14266 // ********** Code for LabeledStatement ************** |
| 14248 function LabeledStatement(name, body, span) { | 14267 function LabeledStatement(name, body, span0) { |
| 14249 this.name = name; | 14268 this.name = name; |
| 14250 this.body = body; | 14269 this.body = body; |
| 14251 lang_Statement.call(this, span); | 14270 lang_Statement.call(this, span0); |
| 14252 // Initializers done | 14271 // Initializers done |
| 14253 } | 14272 } |
| 14254 $inherits(LabeledStatement, lang_Statement); | 14273 $inherits(LabeledStatement, lang_Statement); |
| 14255 LabeledStatement.prototype.get$name = function() { return this.name; }; | 14274 LabeledStatement.prototype.get$name = function() { return this.name; }; |
| 14256 LabeledStatement.prototype.set$name = function(value) { return this.name = value
; }; | 14275 LabeledStatement.prototype.set$name = function(value) { return this.name = value
; }; |
| 14257 LabeledStatement.prototype.visit = function(visitor) { | 14276 LabeledStatement.prototype.visit = function(visitor) { |
| 14258 return visitor.visitLabeledStatement(this); | 14277 return visitor.visitLabeledStatement(this); |
| 14259 } | 14278 } |
| 14260 // ********** Code for lang_ExpressionStatement ************** | 14279 // ********** Code for lang_ExpressionStatement ************** |
| 14261 function lang_ExpressionStatement(body, span) { | 14280 function lang_ExpressionStatement(body, span0) { |
| 14262 this.body = body; | 14281 this.body = body; |
| 14263 lang_Statement.call(this, span); | 14282 lang_Statement.call(this, span0); |
| 14264 // Initializers done | 14283 // Initializers done |
| 14265 } | 14284 } |
| 14266 $inherits(lang_ExpressionStatement, lang_Statement); | 14285 $inherits(lang_ExpressionStatement, lang_Statement); |
| 14267 lang_ExpressionStatement.prototype.visit = function(visitor) { | 14286 lang_ExpressionStatement.prototype.visit = function(visitor) { |
| 14268 return visitor.visitExpressionStatement(this); | 14287 return visitor.visitExpressionStatement(this); |
| 14269 } | 14288 } |
| 14270 // ********** Code for EmptyStatement ************** | 14289 // ********** Code for EmptyStatement ************** |
| 14271 function EmptyStatement(span) { | 14290 function EmptyStatement(span0) { |
| 14272 lang_Statement.call(this, span); | 14291 lang_Statement.call(this, span0); |
| 14273 // Initializers done | 14292 // Initializers done |
| 14274 } | 14293 } |
| 14275 $inherits(EmptyStatement, lang_Statement); | 14294 $inherits(EmptyStatement, lang_Statement); |
| 14276 EmptyStatement.prototype.visit = function(visitor) { | 14295 EmptyStatement.prototype.visit = function(visitor) { |
| 14277 return visitor.visitEmptyStatement(this); | 14296 return visitor.visitEmptyStatement(this); |
| 14278 } | 14297 } |
| 14279 // ********** Code for DietStatement ************** | 14298 // ********** Code for DietStatement ************** |
| 14280 function DietStatement(span) { | 14299 function DietStatement(span0) { |
| 14281 lang_Statement.call(this, span); | 14300 lang_Statement.call(this, span0); |
| 14282 // Initializers done | 14301 // Initializers done |
| 14283 } | 14302 } |
| 14284 $inherits(DietStatement, lang_Statement); | 14303 $inherits(DietStatement, lang_Statement); |
| 14285 DietStatement.prototype.visit = function(visitor) { | 14304 DietStatement.prototype.visit = function(visitor) { |
| 14286 return visitor.visitDietStatement(this); | 14305 return visitor.visitDietStatement(this); |
| 14287 } | 14306 } |
| 14288 // ********** Code for NativeStatement ************** | 14307 // ********** Code for NativeStatement ************** |
| 14289 function NativeStatement(body, span) { | 14308 function NativeStatement(body, span0) { |
| 14290 this.body = body; | 14309 this.body = body; |
| 14291 lang_Statement.call(this, span); | 14310 lang_Statement.call(this, span0); |
| 14292 // Initializers done | 14311 // Initializers done |
| 14293 } | 14312 } |
| 14294 $inherits(NativeStatement, lang_Statement); | 14313 $inherits(NativeStatement, lang_Statement); |
| 14295 NativeStatement.prototype.visit = function(visitor) { | 14314 NativeStatement.prototype.visit = function(visitor) { |
| 14296 return visitor.visitNativeStatement(this); | 14315 return visitor.visitNativeStatement(this); |
| 14297 } | 14316 } |
| 14298 // ********** Code for LambdaExpression ************** | 14317 // ********** Code for LambdaExpression ************** |
| 14299 function LambdaExpression(func, span) { | 14318 function LambdaExpression(func, span0) { |
| 14300 this.func = func; | 14319 this.func = func; |
| 14301 lang_Expression.call(this, span); | 14320 lang_Expression.call(this, span0); |
| 14302 // Initializers done | 14321 // Initializers done |
| 14303 } | 14322 } |
| 14304 $inherits(LambdaExpression, lang_Expression); | 14323 $inherits(LambdaExpression, lang_Expression); |
| 14305 LambdaExpression.prototype.visit = function(visitor) { | 14324 LambdaExpression.prototype.visit = function(visitor) { |
| 14306 return visitor.visitLambdaExpression(this); | 14325 return visitor.visitLambdaExpression(this); |
| 14307 } | 14326 } |
| 14308 // ********** Code for CallExpression ************** | 14327 // ********** Code for CallExpression ************** |
| 14309 function CallExpression(target, arguments, span) { | 14328 function CallExpression(target, arguments, span0) { |
| 14310 this.target = target; | 14329 this.target = target; |
| 14311 this.arguments = arguments; | 14330 this.arguments = arguments; |
| 14312 lang_Expression.call(this, span); | 14331 lang_Expression.call(this, span0); |
| 14313 // Initializers done | 14332 // Initializers done |
| 14314 } | 14333 } |
| 14315 $inherits(CallExpression, lang_Expression); | 14334 $inherits(CallExpression, lang_Expression); |
| 14316 CallExpression.prototype.get$arguments = function() { return this.arguments; }; | 14335 CallExpression.prototype.get$arguments = function() { return this.arguments; }; |
| 14317 CallExpression.prototype.set$arguments = function(value) { return this.arguments
= value; }; | 14336 CallExpression.prototype.set$arguments = function(value) { return this.arguments
= value; }; |
| 14318 CallExpression.prototype.visit = function(visitor) { | 14337 CallExpression.prototype.visit = function(visitor) { |
| 14319 return visitor.visitCallExpression(this); | 14338 return visitor.visitCallExpression(this); |
| 14320 } | 14339 } |
| 14321 // ********** Code for IndexExpression ************** | 14340 // ********** Code for IndexExpression ************** |
| 14322 function IndexExpression(target, index, span) { | 14341 function IndexExpression(target, index, span0) { |
| 14323 this.target = target; | 14342 this.target = target; |
| 14324 this.index = index; | 14343 this.index = index; |
| 14325 lang_Expression.call(this, span); | 14344 lang_Expression.call(this, span0); |
| 14326 // Initializers done | 14345 // Initializers done |
| 14327 } | 14346 } |
| 14328 $inherits(IndexExpression, lang_Expression); | 14347 $inherits(IndexExpression, lang_Expression); |
| 14329 IndexExpression.prototype.visit = function(visitor) { | 14348 IndexExpression.prototype.visit = function(visitor) { |
| 14330 return visitor.visitIndexExpression(this); | 14349 return visitor.visitIndexExpression(this); |
| 14331 } | 14350 } |
| 14332 // ********** Code for BinaryExpression ************** | 14351 // ********** Code for BinaryExpression ************** |
| 14333 function BinaryExpression(op, x, y, span) { | 14352 function BinaryExpression(op, x, y, span0) { |
| 14334 this.op = op; | 14353 this.op = op; |
| 14335 this.x = x; | 14354 this.x = x; |
| 14336 this.y = y; | 14355 this.y = y; |
| 14337 lang_Expression.call(this, span); | 14356 lang_Expression.call(this, span0); |
| 14338 // Initializers done | 14357 // Initializers done |
| 14339 } | 14358 } |
| 14340 $inherits(BinaryExpression, lang_Expression); | 14359 $inherits(BinaryExpression, lang_Expression); |
| 14341 BinaryExpression.prototype.visit = function(visitor) { | 14360 BinaryExpression.prototype.visit = function(visitor) { |
| 14342 return visitor.visitBinaryExpression(this); | 14361 return visitor.visitBinaryExpression(this); |
| 14343 } | 14362 } |
| 14344 // ********** Code for UnaryExpression ************** | 14363 // ********** Code for UnaryExpression ************** |
| 14345 function UnaryExpression(op, self, span) { | 14364 function UnaryExpression(op, self, span0) { |
| 14346 this.op = op; | 14365 this.op = op; |
| 14347 this.self = self; | 14366 this.self = self; |
| 14348 lang_Expression.call(this, span); | 14367 lang_Expression.call(this, span0); |
| 14349 // Initializers done | 14368 // Initializers done |
| 14350 } | 14369 } |
| 14351 $inherits(UnaryExpression, lang_Expression); | 14370 $inherits(UnaryExpression, lang_Expression); |
| 14352 UnaryExpression.prototype.visit = function(visitor) { | 14371 UnaryExpression.prototype.visit = function(visitor) { |
| 14353 return visitor.visitUnaryExpression(this); | 14372 return visitor.visitUnaryExpression(this); |
| 14354 } | 14373 } |
| 14355 // ********** Code for PostfixExpression ************** | 14374 // ********** Code for PostfixExpression ************** |
| 14356 function PostfixExpression(body, op, span) { | 14375 function PostfixExpression(body, op, span0) { |
| 14357 this.body = body; | 14376 this.body = body; |
| 14358 this.op = op; | 14377 this.op = op; |
| 14359 lang_Expression.call(this, span); | 14378 lang_Expression.call(this, span0); |
| 14360 // Initializers done | 14379 // Initializers done |
| 14361 } | 14380 } |
| 14362 $inherits(PostfixExpression, lang_Expression); | 14381 $inherits(PostfixExpression, lang_Expression); |
| 14363 PostfixExpression.prototype.visit = function(visitor) { | 14382 PostfixExpression.prototype.visit = function(visitor) { |
| 14364 return visitor.visitPostfixExpression$1(this); | 14383 return visitor.visitPostfixExpression$1(this); |
| 14365 } | 14384 } |
| 14366 // ********** Code for lang_NewExpression ************** | 14385 // ********** Code for lang_NewExpression ************** |
| 14367 function lang_NewExpression(isConst, type, name, arguments, span) { | 14386 function lang_NewExpression(isConst, type, name, arguments, span0) { |
| 14368 this.isConst = isConst; | 14387 this.isConst = isConst; |
| 14369 this.type = type; | 14388 this.type = type; |
| 14370 this.name = name; | 14389 this.name = name; |
| 14371 this.arguments = arguments; | 14390 this.arguments = arguments; |
| 14372 lang_Expression.call(this, span); | 14391 lang_Expression.call(this, span0); |
| 14373 // Initializers done | 14392 // Initializers done |
| 14374 } | 14393 } |
| 14375 $inherits(lang_NewExpression, lang_Expression); | 14394 $inherits(lang_NewExpression, lang_Expression); |
| 14376 lang_NewExpression.prototype.get$isConst = function() { return this.isConst; }; | 14395 lang_NewExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 14377 lang_NewExpression.prototype.set$isConst = function(value) { return this.isConst
= value; }; | 14396 lang_NewExpression.prototype.set$isConst = function(value) { return this.isConst
= value; }; |
| 14378 lang_NewExpression.prototype.get$name = function() { return this.name; }; | 14397 lang_NewExpression.prototype.get$name = function() { return this.name; }; |
| 14379 lang_NewExpression.prototype.set$name = function(value) { return this.name = val
ue; }; | 14398 lang_NewExpression.prototype.set$name = function(value) { return this.name = val
ue; }; |
| 14380 lang_NewExpression.prototype.get$arguments = function() { return this.arguments;
}; | 14399 lang_NewExpression.prototype.get$arguments = function() { return this.arguments;
}; |
| 14381 lang_NewExpression.prototype.set$arguments = function(value) { return this.argum
ents = value; }; | 14400 lang_NewExpression.prototype.set$arguments = function(value) { return this.argum
ents = value; }; |
| 14382 lang_NewExpression.prototype.visit = function(visitor) { | 14401 lang_NewExpression.prototype.visit = function(visitor) { |
| 14383 return visitor.visitNewExpression(this); | 14402 return visitor.visitNewExpression(this); |
| 14384 } | 14403 } |
| 14385 // ********** Code for ListExpression ************** | 14404 // ********** Code for ListExpression ************** |
| 14386 function ListExpression(isConst, type, values, span) { | 14405 function ListExpression(isConst, type, values, span0) { |
| 14387 this.isConst = isConst; | 14406 this.isConst = isConst; |
| 14388 this.type = type; | 14407 this.type = type; |
| 14389 this.values = values; | 14408 this.values = values; |
| 14390 lang_Expression.call(this, span); | 14409 lang_Expression.call(this, span0); |
| 14391 // Initializers done | 14410 // Initializers done |
| 14392 } | 14411 } |
| 14393 $inherits(ListExpression, lang_Expression); | 14412 $inherits(ListExpression, lang_Expression); |
| 14394 ListExpression.prototype.get$isConst = function() { return this.isConst; }; | 14413 ListExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 14395 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v
alue; }; | 14414 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v
alue; }; |
| 14396 ListExpression.prototype.visit = function(visitor) { | 14415 ListExpression.prototype.visit = function(visitor) { |
| 14397 return visitor.visitListExpression(this); | 14416 return visitor.visitListExpression(this); |
| 14398 } | 14417 } |
| 14399 // ********** Code for MapExpression ************** | 14418 // ********** Code for MapExpression ************** |
| 14400 function MapExpression(isConst, type, items, span) { | 14419 function MapExpression(isConst, type, items, span0) { |
| 14401 this.isConst = isConst; | 14420 this.isConst = isConst; |
| 14402 this.type = type; | 14421 this.type = type; |
| 14403 this.items = items; | 14422 this.items = items; |
| 14404 lang_Expression.call(this, span); | 14423 lang_Expression.call(this, span0); |
| 14405 // Initializers done | 14424 // Initializers done |
| 14406 } | 14425 } |
| 14407 $inherits(MapExpression, lang_Expression); | 14426 $inherits(MapExpression, lang_Expression); |
| 14408 MapExpression.prototype.get$isConst = function() { return this.isConst; }; | 14427 MapExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 14409 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; | 14428 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; |
| 14410 MapExpression.prototype.visit = function(visitor) { | 14429 MapExpression.prototype.visit = function(visitor) { |
| 14411 return visitor.visitMapExpression(this); | 14430 return visitor.visitMapExpression(this); |
| 14412 } | 14431 } |
| 14413 // ********** Code for ConditionalExpression ************** | 14432 // ********** Code for ConditionalExpression ************** |
| 14414 function ConditionalExpression(test, trueBranch, falseBranch, span) { | 14433 function ConditionalExpression(test, trueBranch, falseBranch, span0) { |
| 14415 this.test = test; | 14434 this.test = test; |
| 14416 this.trueBranch = trueBranch; | 14435 this.trueBranch = trueBranch; |
| 14417 this.falseBranch = falseBranch; | 14436 this.falseBranch = falseBranch; |
| 14418 lang_Expression.call(this, span); | 14437 lang_Expression.call(this, span0); |
| 14419 // Initializers done | 14438 // Initializers done |
| 14420 } | 14439 } |
| 14421 $inherits(ConditionalExpression, lang_Expression); | 14440 $inherits(ConditionalExpression, lang_Expression); |
| 14422 ConditionalExpression.prototype.visit = function(visitor) { | 14441 ConditionalExpression.prototype.visit = function(visitor) { |
| 14423 return visitor.visitConditionalExpression(this); | 14442 return visitor.visitConditionalExpression(this); |
| 14424 } | 14443 } |
| 14425 // ********** Code for IsExpression ************** | 14444 // ********** Code for IsExpression ************** |
| 14426 function IsExpression(isTrue, x, type, span) { | 14445 function IsExpression(isTrue, x, type, span0) { |
| 14427 this.isTrue = isTrue; | 14446 this.isTrue = isTrue; |
| 14428 this.x = x; | 14447 this.x = x; |
| 14429 this.type = type; | 14448 this.type = type; |
| 14430 lang_Expression.call(this, span); | 14449 lang_Expression.call(this, span0); |
| 14431 // Initializers done | 14450 // Initializers done |
| 14432 } | 14451 } |
| 14433 $inherits(IsExpression, lang_Expression); | 14452 $inherits(IsExpression, lang_Expression); |
| 14434 IsExpression.prototype.visit = function(visitor) { | 14453 IsExpression.prototype.visit = function(visitor) { |
| 14435 return visitor.visitIsExpression(this); | 14454 return visitor.visitIsExpression(this); |
| 14436 } | 14455 } |
| 14437 // ********** Code for ParenExpression ************** | 14456 // ********** Code for ParenExpression ************** |
| 14438 function ParenExpression(body, span) { | 14457 function ParenExpression(body, span0) { |
| 14439 this.body = body; | 14458 this.body = body; |
| 14440 lang_Expression.call(this, span); | 14459 lang_Expression.call(this, span0); |
| 14441 // Initializers done | 14460 // Initializers done |
| 14442 } | 14461 } |
| 14443 $inherits(ParenExpression, lang_Expression); | 14462 $inherits(ParenExpression, lang_Expression); |
| 14444 ParenExpression.prototype.visit = function(visitor) { | 14463 ParenExpression.prototype.visit = function(visitor) { |
| 14445 return visitor.visitParenExpression(this); | 14464 return visitor.visitParenExpression(this); |
| 14446 } | 14465 } |
| 14447 // ********** Code for DotExpression ************** | 14466 // ********** Code for DotExpression ************** |
| 14448 function DotExpression(self, name, span) { | 14467 function DotExpression(self, name, span0) { |
| 14449 this.self = self; | 14468 this.self = self; |
| 14450 this.name = name; | 14469 this.name = name; |
| 14451 lang_Expression.call(this, span); | 14470 lang_Expression.call(this, span0); |
| 14452 // Initializers done | 14471 // Initializers done |
| 14453 } | 14472 } |
| 14454 $inherits(DotExpression, lang_Expression); | 14473 $inherits(DotExpression, lang_Expression); |
| 14455 DotExpression.prototype.get$name = function() { return this.name; }; | 14474 DotExpression.prototype.get$name = function() { return this.name; }; |
| 14456 DotExpression.prototype.set$name = function(value) { return this.name = value; }
; | 14475 DotExpression.prototype.set$name = function(value) { return this.name = value; }
; |
| 14457 DotExpression.prototype.visit = function(visitor) { | 14476 DotExpression.prototype.visit = function(visitor) { |
| 14458 return visitor.visitDotExpression(this); | 14477 return visitor.visitDotExpression(this); |
| 14459 } | 14478 } |
| 14460 // ********** Code for VarExpression ************** | 14479 // ********** Code for VarExpression ************** |
| 14461 function VarExpression(name, span) { | 14480 function VarExpression(name, span0) { |
| 14462 this.name = name; | 14481 this.name = name; |
| 14463 lang_Expression.call(this, span); | 14482 lang_Expression.call(this, span0); |
| 14464 // Initializers done | 14483 // Initializers done |
| 14465 } | 14484 } |
| 14466 $inherits(VarExpression, lang_Expression); | 14485 $inherits(VarExpression, lang_Expression); |
| 14467 VarExpression.prototype.get$name = function() { return this.name; }; | 14486 VarExpression.prototype.get$name = function() { return this.name; }; |
| 14468 VarExpression.prototype.set$name = function(value) { return this.name = value; }
; | 14487 VarExpression.prototype.set$name = function(value) { return this.name = value; }
; |
| 14469 VarExpression.prototype.visit = function(visitor) { | 14488 VarExpression.prototype.visit = function(visitor) { |
| 14470 return visitor.visitVarExpression(this); | 14489 return visitor.visitVarExpression(this); |
| 14471 } | 14490 } |
| 14472 // ********** Code for ThisExpression ************** | 14491 // ********** Code for ThisExpression ************** |
| 14473 function ThisExpression(span) { | 14492 function ThisExpression(span0) { |
| 14474 lang_Expression.call(this, span); | 14493 lang_Expression.call(this, span0); |
| 14475 // Initializers done | 14494 // Initializers done |
| 14476 } | 14495 } |
| 14477 $inherits(ThisExpression, lang_Expression); | 14496 $inherits(ThisExpression, lang_Expression); |
| 14478 ThisExpression.prototype.visit = function(visitor) { | 14497 ThisExpression.prototype.visit = function(visitor) { |
| 14479 return visitor.visitThisExpression(this); | 14498 return visitor.visitThisExpression(this); |
| 14480 } | 14499 } |
| 14481 // ********** Code for SuperExpression ************** | 14500 // ********** Code for SuperExpression ************** |
| 14482 function SuperExpression(span) { | 14501 function SuperExpression(span0) { |
| 14483 lang_Expression.call(this, span); | 14502 lang_Expression.call(this, span0); |
| 14484 // Initializers done | 14503 // Initializers done |
| 14485 } | 14504 } |
| 14486 $inherits(SuperExpression, lang_Expression); | 14505 $inherits(SuperExpression, lang_Expression); |
| 14487 SuperExpression.prototype.visit = function(visitor) { | 14506 SuperExpression.prototype.visit = function(visitor) { |
| 14488 return visitor.visitSuperExpression(this); | 14507 return visitor.visitSuperExpression(this); |
| 14489 } | 14508 } |
| 14490 // ********** Code for NullExpression ************** | 14509 // ********** Code for NullExpression ************** |
| 14491 function NullExpression(span) { | 14510 function NullExpression(span0) { |
| 14492 lang_Expression.call(this, span); | 14511 lang_Expression.call(this, span0); |
| 14493 // Initializers done | 14512 // Initializers done |
| 14494 } | 14513 } |
| 14495 $inherits(NullExpression, lang_Expression); | 14514 $inherits(NullExpression, lang_Expression); |
| 14496 NullExpression.prototype.visit = function(visitor) { | 14515 NullExpression.prototype.visit = function(visitor) { |
| 14497 return visitor.visitNullExpression(this); | 14516 return visitor.visitNullExpression(this); |
| 14498 } | 14517 } |
| 14499 // ********** Code for LiteralExpression ************** | 14518 // ********** Code for LiteralExpression ************** |
| 14500 function LiteralExpression(value, type, text, span) { | 14519 function LiteralExpression(value, type, text, span0) { |
| 14501 this.value = value; | 14520 this.value = value; |
| 14502 this.type = type; | 14521 this.type = type; |
| 14503 this.text = text; | 14522 this.text = text; |
| 14504 lang_Expression.call(this, span); | 14523 lang_Expression.call(this, span0); |
| 14505 // Initializers done | 14524 // Initializers done |
| 14506 } | 14525 } |
| 14507 $inherits(LiteralExpression, lang_Expression); | 14526 $inherits(LiteralExpression, lang_Expression); |
| 14508 LiteralExpression.prototype.get$value = function() { return this.value; }; | 14527 LiteralExpression.prototype.get$value = function() { return this.value; }; |
| 14509 LiteralExpression.prototype.set$value = function(value) { return this.value = va
lue; }; | 14528 LiteralExpression.prototype.set$value = function(value) { return this.value = va
lue; }; |
| 14510 LiteralExpression.prototype.get$text = function() { return this.text; }; | 14529 LiteralExpression.prototype.get$text = function() { return this.text; }; |
| 14511 LiteralExpression.prototype.set$text = function(value) { return this.text = valu
e; }; | 14530 LiteralExpression.prototype.set$text = function(value) { return this.text = valu
e; }; |
| 14512 LiteralExpression.prototype.visit = function(visitor) { | 14531 LiteralExpression.prototype.visit = function(visitor) { |
| 14513 return visitor.visitLiteralExpression(this); | 14532 return visitor.visitLiteralExpression(this); |
| 14514 } | 14533 } |
| 14515 // ********** Code for NameTypeReference ************** | 14534 // ********** Code for NameTypeReference ************** |
| 14516 function NameTypeReference(isFinal, name, names, span) { | 14535 function NameTypeReference(isFinal, name, names, span0) { |
| 14517 this.isFinal = isFinal; | 14536 this.isFinal = isFinal; |
| 14518 this.name = name; | 14537 this.name = name; |
| 14519 this.names = names; | 14538 this.names = names; |
| 14520 TypeReference.call(this, span); | 14539 TypeReference.call(this, span0); |
| 14521 // Initializers done | 14540 // Initializers done |
| 14522 } | 14541 } |
| 14523 $inherits(NameTypeReference, TypeReference); | 14542 $inherits(NameTypeReference, TypeReference); |
| 14524 NameTypeReference.prototype.get$name = function() { return this.name; }; | 14543 NameTypeReference.prototype.get$name = function() { return this.name; }; |
| 14525 NameTypeReference.prototype.set$name = function(value) { return this.name = valu
e; }; | 14544 NameTypeReference.prototype.set$name = function(value) { return this.name = valu
e; }; |
| 14526 NameTypeReference.prototype.visit = function(visitor) { | 14545 NameTypeReference.prototype.visit = function(visitor) { |
| 14527 return visitor.visitNameTypeReference(this); | 14546 return visitor.visitNameTypeReference(this); |
| 14528 } | 14547 } |
| 14529 // ********** Code for GenericTypeReference ************** | 14548 // ********** Code for GenericTypeReference ************** |
| 14530 function GenericTypeReference(baseType, typeArguments, depth, span) { | 14549 function GenericTypeReference(baseType, typeArguments, depth, span0) { |
| 14531 this.baseType = baseType; | 14550 this.baseType = baseType; |
| 14532 this.typeArguments = typeArguments; | 14551 this.typeArguments = typeArguments; |
| 14533 this.depth = depth; | 14552 this.depth = depth; |
| 14534 TypeReference.call(this, span); | 14553 TypeReference.call(this, span0); |
| 14535 // Initializers done | 14554 // Initializers done |
| 14536 } | 14555 } |
| 14537 $inherits(GenericTypeReference, TypeReference); | 14556 $inherits(GenericTypeReference, TypeReference); |
| 14538 GenericTypeReference.prototype.visit = function(visitor) { | 14557 GenericTypeReference.prototype.visit = function(visitor) { |
| 14539 return visitor.visitGenericTypeReference(this); | 14558 return visitor.visitGenericTypeReference(this); |
| 14540 } | 14559 } |
| 14541 // ********** Code for FunctionTypeReference ************** | 14560 // ********** Code for FunctionTypeReference ************** |
| 14542 function FunctionTypeReference(isFinal, func, span) { | 14561 function FunctionTypeReference(isFinal, func, span0) { |
| 14543 this.isFinal = isFinal; | 14562 this.isFinal = isFinal; |
| 14544 this.func = func; | 14563 this.func = func; |
| 14545 TypeReference.call(this, span); | 14564 TypeReference.call(this, span0); |
| 14546 // Initializers done | 14565 // Initializers done |
| 14547 } | 14566 } |
| 14548 $inherits(FunctionTypeReference, TypeReference); | 14567 $inherits(FunctionTypeReference, TypeReference); |
| 14549 FunctionTypeReference.prototype.visit = function(visitor) { | 14568 FunctionTypeReference.prototype.visit = function(visitor) { |
| 14550 return visitor.visitFunctionTypeReference(this); | 14569 return visitor.visitFunctionTypeReference(this); |
| 14551 } | 14570 } |
| 14552 // ********** Code for ArgumentNode ************** | 14571 // ********** Code for ArgumentNode ************** |
| 14553 function ArgumentNode(label, value, span) { | 14572 function ArgumentNode(label, value, span0) { |
| 14554 this.label = label; | 14573 this.label = label; |
| 14555 this.value = value; | 14574 this.value = value; |
| 14556 lang_Node.call(this, span); | 14575 lang_Node.call(this, span0); |
| 14557 // Initializers done | 14576 // Initializers done |
| 14558 } | 14577 } |
| 14559 $inherits(ArgumentNode, lang_Node); | 14578 $inherits(ArgumentNode, lang_Node); |
| 14560 ArgumentNode.prototype.get$value = function() { return this.value; }; | 14579 ArgumentNode.prototype.get$value = function() { return this.value; }; |
| 14561 ArgumentNode.prototype.set$value = function(value) { return this.value = value;
}; | 14580 ArgumentNode.prototype.set$value = function(value) { return this.value = value;
}; |
| 14562 ArgumentNode.prototype.visit = function(visitor) { | 14581 ArgumentNode.prototype.visit = function(visitor) { |
| 14563 return visitor.visitArgumentNode(this); | 14582 return visitor.visitArgumentNode(this); |
| 14564 } | 14583 } |
| 14565 // ********** Code for FormalNode ************** | 14584 // ********** Code for FormalNode ************** |
| 14566 function FormalNode(isThis, isRest, type, name, value, span) { | 14585 function FormalNode(isThis, isRest, type, name, value, span0) { |
| 14567 this.isThis = isThis; | 14586 this.isThis = isThis; |
| 14568 this.isRest = isRest; | 14587 this.isRest = isRest; |
| 14569 this.type = type; | 14588 this.type = type; |
| 14570 this.name = name; | 14589 this.name = name; |
| 14571 this.value = value; | 14590 this.value = value; |
| 14572 lang_Node.call(this, span); | 14591 lang_Node.call(this, span0); |
| 14573 // Initializers done | 14592 // Initializers done |
| 14574 } | 14593 } |
| 14575 $inherits(FormalNode, lang_Node); | 14594 $inherits(FormalNode, lang_Node); |
| 14576 FormalNode.prototype.get$name = function() { return this.name; }; | 14595 FormalNode.prototype.get$name = function() { return this.name; }; |
| 14577 FormalNode.prototype.set$name = function(value) { return this.name = value; }; | 14596 FormalNode.prototype.set$name = function(value) { return this.name = value; }; |
| 14578 FormalNode.prototype.get$value = function() { return this.value; }; | 14597 FormalNode.prototype.get$value = function() { return this.value; }; |
| 14579 FormalNode.prototype.set$value = function(value) { return this.value = value; }; | 14598 FormalNode.prototype.set$value = function(value) { return this.value = value; }; |
| 14580 FormalNode.prototype.visit = function(visitor) { | 14599 FormalNode.prototype.visit = function(visitor) { |
| 14581 return visitor.visitFormalNode(this); | 14600 return visitor.visitFormalNode(this); |
| 14582 } | 14601 } |
| 14583 // ********** Code for CatchNode ************** | 14602 // ********** Code for CatchNode ************** |
| 14584 function CatchNode(exception, trace, body, span) { | 14603 function CatchNode(exception, trace, body, span0) { |
| 14585 this.exception = exception; | 14604 this.exception = exception; |
| 14586 this.trace = trace; | 14605 this.trace = trace; |
| 14587 this.body = body; | 14606 this.body = body; |
| 14588 lang_Node.call(this, span); | 14607 lang_Node.call(this, span0); |
| 14589 // Initializers done | 14608 // Initializers done |
| 14590 } | 14609 } |
| 14591 $inherits(CatchNode, lang_Node); | 14610 $inherits(CatchNode, lang_Node); |
| 14592 CatchNode.prototype.get$exception = function() { return this.exception; }; | 14611 CatchNode.prototype.get$exception = function() { return this.exception; }; |
| 14593 CatchNode.prototype.set$exception = function(value) { return this.exception = va
lue; }; | 14612 CatchNode.prototype.set$exception = function(value) { return this.exception = va
lue; }; |
| 14594 CatchNode.prototype.visit = function(visitor) { | 14613 CatchNode.prototype.visit = function(visitor) { |
| 14595 return visitor.visitCatchNode(this); | 14614 return visitor.visitCatchNode(this); |
| 14596 } | 14615 } |
| 14597 // ********** Code for CaseNode ************** | 14616 // ********** Code for CaseNode ************** |
| 14598 function CaseNode(label, cases, statements, span) { | 14617 function CaseNode(label, cases, statements, span0) { |
| 14599 this.label = label; | 14618 this.label = label; |
| 14600 this.cases = cases; | 14619 this.cases = cases; |
| 14601 this.statements = statements; | 14620 this.statements = statements; |
| 14602 lang_Node.call(this, span); | 14621 lang_Node.call(this, span0); |
| 14603 // Initializers done | 14622 // Initializers done |
| 14604 } | 14623 } |
| 14605 $inherits(CaseNode, lang_Node); | 14624 $inherits(CaseNode, lang_Node); |
| 14606 CaseNode.prototype.visit = function(visitor) { | 14625 CaseNode.prototype.visit = function(visitor) { |
| 14607 return visitor.visitCaseNode(this); | 14626 return visitor.visitCaseNode(this); |
| 14608 } | 14627 } |
| 14609 // ********** Code for TypeParameter ************** | 14628 // ********** Code for TypeParameter ************** |
| 14610 function TypeParameter(name, extendsType, span) { | 14629 function TypeParameter(name, extendsType, span0) { |
| 14611 this.name = name; | 14630 this.name = name; |
| 14612 this.extendsType = extendsType; | 14631 this.extendsType = extendsType; |
| 14613 lang_Node.call(this, span); | 14632 lang_Node.call(this, span0); |
| 14614 // Initializers done | 14633 // Initializers done |
| 14615 } | 14634 } |
| 14616 $inherits(TypeParameter, lang_Node); | 14635 $inherits(TypeParameter, lang_Node); |
| 14617 TypeParameter.prototype.get$name = function() { return this.name; }; | 14636 TypeParameter.prototype.get$name = function() { return this.name; }; |
| 14618 TypeParameter.prototype.set$name = function(value) { return this.name = value; }
; | 14637 TypeParameter.prototype.set$name = function(value) { return this.name = value; }
; |
| 14619 TypeParameter.prototype.visit = function(visitor) { | 14638 TypeParameter.prototype.visit = function(visitor) { |
| 14620 return visitor.visitTypeParameter(this); | 14639 return visitor.visitTypeParameter(this); |
| 14621 } | 14640 } |
| 14622 // ********** Code for lang_Identifier ************** | 14641 // ********** Code for lang_Identifier ************** |
| 14623 function lang_Identifier(name, span) { | 14642 function lang_Identifier(name, span0) { |
| 14624 this.name = name; | 14643 this.name = name; |
| 14625 lang_Node.call(this, span); | 14644 lang_Node.call(this, span0); |
| 14626 // Initializers done | 14645 // Initializers done |
| 14627 } | 14646 } |
| 14628 $inherits(lang_Identifier, lang_Node); | 14647 $inherits(lang_Identifier, lang_Node); |
| 14629 lang_Identifier.prototype.get$name = function() { return this.name; }; | 14648 lang_Identifier.prototype.get$name = function() { return this.name; }; |
| 14630 lang_Identifier.prototype.set$name = function(value) { return this.name = value;
}; | 14649 lang_Identifier.prototype.set$name = function(value) { return this.name = value;
}; |
| 14631 lang_Identifier.prototype.visit = function(visitor) { | 14650 lang_Identifier.prototype.visit = function(visitor) { |
| 14632 return visitor.visitIdentifier(this); | 14651 return visitor.visitIdentifier(this); |
| 14633 } | 14652 } |
| 14634 // ********** Code for DeclaredIdentifier ************** | 14653 // ********** Code for DeclaredIdentifier ************** |
| 14635 function DeclaredIdentifier(type, name, span) { | 14654 function DeclaredIdentifier(type, name, span0) { |
| 14636 this.type = type; | 14655 this.type = type; |
| 14637 this.name = name; | 14656 this.name = name; |
| 14638 lang_Expression.call(this, span); | 14657 lang_Expression.call(this, span0); |
| 14639 // Initializers done | 14658 // Initializers done |
| 14640 } | 14659 } |
| 14641 $inherits(DeclaredIdentifier, lang_Expression); | 14660 $inherits(DeclaredIdentifier, lang_Expression); |
| 14642 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; | 14661 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; |
| 14643 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val
ue; }; | 14662 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val
ue; }; |
| 14644 DeclaredIdentifier.prototype.visit = function(visitor) { | 14663 DeclaredIdentifier.prototype.visit = function(visitor) { |
| 14645 return visitor.visitDeclaredIdentifier(this); | 14664 return visitor.visitDeclaredIdentifier(this); |
| 14646 } | 14665 } |
| 14647 // ********** Code for TreePrinter ************** | 14666 // ********** Code for TreePrinter ************** |
| 14648 function TreePrinter() {} | 14667 function TreePrinter() {} |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14919 lang_Type.prototype.get$name = function() { return this.name; }; | 14938 lang_Type.prototype.get$name = function() { return this.name; }; |
| 14920 lang_Type.prototype.markUsed = function() { | 14939 lang_Type.prototype.markUsed = function() { |
| 14921 | 14940 |
| 14922 } | 14941 } |
| 14923 lang_Type.prototype.get$typeMember = function() { | 14942 lang_Type.prototype.get$typeMember = function() { |
| 14924 if (this._typeMember == null) { | 14943 if (this._typeMember == null) { |
| 14925 this._typeMember = new TypeMember(this); | 14944 this._typeMember = new TypeMember(this); |
| 14926 } | 14945 } |
| 14927 return this._typeMember; | 14946 return this._typeMember; |
| 14928 } | 14947 } |
| 14929 lang_Type.prototype.getMember = function(name) { | 14948 lang_Type.prototype.getMember = function(name0) { |
| 14930 return null; | 14949 return null; |
| 14931 } | 14950 } |
| 14932 lang_Type.prototype.get$isVar = function() { | 14951 lang_Type.prototype.get$isVar = function() { |
| 14933 return false; | 14952 return false; |
| 14934 } | 14953 } |
| 14935 lang_Type.prototype.get$isTop = function() { | 14954 lang_Type.prototype.get$isTop = function() { |
| 14936 return false; | 14955 return false; |
| 14937 } | 14956 } |
| 14938 lang_Type.prototype.get$isObject = function() { | 14957 lang_Type.prototype.get$isObject = function() { |
| 14939 return false; | 14958 return false; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14979 } | 14998 } |
| 14980 lang_Type.prototype.get$hasTypeParams = function() { | 14999 lang_Type.prototype.get$hasTypeParams = function() { |
| 14981 return false; | 15000 return false; |
| 14982 } | 15001 } |
| 14983 lang_Type.prototype.get$typeofName = function() { | 15002 lang_Type.prototype.get$typeofName = function() { |
| 14984 return null; | 15003 return null; |
| 14985 } | 15004 } |
| 14986 lang_Type.prototype.get$jsname = function() { | 15005 lang_Type.prototype.get$jsname = function() { |
| 14987 return this._jsname == null ? this.name : this._jsname; | 15006 return this._jsname == null ? this.name : this._jsname; |
| 14988 } | 15007 } |
| 14989 lang_Type.prototype.set$jsname = function(name) { | 15008 lang_Type.prototype.set$jsname = function(name0) { |
| 14990 return this._jsname = name; | 15009 return this._jsname = name0; |
| 14991 } | 15010 } |
| 14992 lang_Type.prototype.getAllMembers = function() { | 15011 lang_Type.prototype.getAllMembers = function() { |
| 14993 return $map([]); | 15012 return $map([]); |
| 14994 } | 15013 } |
| 14995 lang_Type.prototype.ensureAssignableFrom = function(other, node, isRequired) { | 15014 lang_Type.prototype.ensureAssignableFrom = function(other, node, isRequired) { |
| 14996 if (isRequired && !this.isAssignableFrom(other)) { | 15015 if (isRequired && !this.isAssignableFrom(other)) { |
| 14997 var msg = isRequired ? world.get$error() : world.get$warning(); | 15016 var msg = isRequired ? world.get$error() : world.get$warning(); |
| 14998 msg.call$2(('type ' + this.name + ' is not assignable from ' + other.name +
''), node.span); | 15017 msg.call$2(('type ' + this.name + ' is not assignable from ' + other.name +
''), node.span); |
| 14999 } | 15018 } |
| 15000 } | 15019 } |
| 15001 lang_Type.prototype.needsVarCall = function(args) { | 15020 lang_Type.prototype.needsVarCall = function(args) { |
| 15002 if (this.get$isVarOrFunction()) { | 15021 if (this.get$isVarOrFunction()) { |
| 15003 return true; | 15022 return true; |
| 15004 } | 15023 } |
| 15005 var call = this.getCallMethod(); | 15024 var call = this.getCallMethod(); |
| 15006 if ($ne(call, null)) { | 15025 if ($ne(call, null)) { |
| 15007 if (args.get$length() != call.get$parameters().length || !call.namesInOrder(
args)) { | 15026 if (args.get$length() != call.get$parameters().length || !call.namesInOrder(
args)) { |
| 15008 return true; | 15027 return true; |
| 15009 } | 15028 } |
| 15010 } | 15029 } |
| 15011 return false; | 15030 return false; |
| 15012 } | 15031 } |
| 15013 lang_Type.union = function(x, y) { | 15032 lang_Type.union = function(x, y) { |
| 15014 if ($eq(x, y)) return x; | 15033 if ($eq(x, y)) return x; |
| 15015 if (x.get$isNum() && y.get$isNum()) return world.numType; | 15034 if (x.get$isNum() && y.get$isNum()) return world.numType; |
| 15016 if (x.get$isString() && y.get$isString()) return world.stringType; | 15035 if (x.get$isString() && y.get$isString()) return world.stringType; |
| 15017 return world.varType; | 15036 return world.varType; |
| 15018 } | 15037 } |
| 15019 // ********** Code for ParameterType ************** | 15038 // ********** Code for ParameterType ************** |
| 15020 function ParameterType(name, typeParameter) { | 15039 function ParameterType(name0, typeParameter) { |
| 15021 this.typeParameter = typeParameter; | 15040 this.typeParameter = typeParameter; |
| 15022 lang_Type.call(this, name); | 15041 lang_Type.call(this, name0); |
| 15023 // Initializers done | 15042 // Initializers done |
| 15024 } | 15043 } |
| 15025 $inherits(ParameterType, lang_Type); | 15044 $inherits(ParameterType, lang_Type); |
| 15026 ParameterType.prototype.get$isClass = function() { | 15045 ParameterType.prototype.get$isClass = function() { |
| 15027 return false; | 15046 return false; |
| 15028 } | 15047 } |
| 15029 ParameterType.prototype.get$library = function() { | 15048 ParameterType.prototype.get$library = function() { |
| 15030 return null; | 15049 return null; |
| 15031 } | 15050 } |
| 15032 ParameterType.prototype.get$span = function() { | 15051 ParameterType.prototype.get$span = function() { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 15052 } | 15071 } |
| 15053 ParameterType.prototype.resolve = function(inType) { | 15072 ParameterType.prototype.resolve = function(inType) { |
| 15054 if (this.typeParameter.extendsType != null) { | 15073 if (this.typeParameter.extendsType != null) { |
| 15055 this.extendsType = inType.resolveType(this.typeParameter.extendsType, true); | 15074 this.extendsType = inType.resolveType(this.typeParameter.extendsType, true); |
| 15056 } | 15075 } |
| 15057 else { | 15076 else { |
| 15058 this.extendsType = world.objectType; | 15077 this.extendsType = world.objectType; |
| 15059 } | 15078 } |
| 15060 } | 15079 } |
| 15061 // ********** Code for ConcreteType ************** | 15080 // ********** Code for ConcreteType ************** |
| 15062 function ConcreteType(name, genericType, typeArguments, typeArgsInOrder) { | 15081 function ConcreteType(name0, genericType, typeArguments, typeArgsInOrder) { |
| 15063 this.genericType = genericType; | 15082 this.genericType = genericType; |
| 15064 this.typeArguments = typeArguments; | 15083 this.typeArguments = typeArguments; |
| 15065 this.typeArgsInOrder = typeArgsInOrder; | 15084 this.typeArgsInOrder = typeArgsInOrder; |
| 15066 this.constructors = $map([]); | 15085 this.constructors = $map([]); |
| 15067 this.members = $map([]); | 15086 this.members = $map([]); |
| 15068 this.factories = new FactoryMap(); | 15087 this.factories = new FactoryMap(); |
| 15069 lang_Type.call(this, name); | 15088 lang_Type.call(this, name0); |
| 15070 // Initializers done | 15089 // Initializers done |
| 15071 } | 15090 } |
| 15072 $inherits(ConcreteType, lang_Type); | 15091 $inherits(ConcreteType, lang_Type); |
| 15073 ConcreteType.prototype.get$isList = function() { | 15092 ConcreteType.prototype.get$isList = function() { |
| 15074 return this.genericType.get$isList(); | 15093 return this.genericType.get$isList(); |
| 15075 } | 15094 } |
| 15076 ConcreteType.prototype.get$isClass = function() { | 15095 ConcreteType.prototype.get$isClass = function() { |
| 15077 return this.genericType.get$isClass(); | 15096 return this.genericType.get$isClass(); |
| 15078 } | 15097 } |
| 15079 ConcreteType.prototype.get$library = function() { | 15098 ConcreteType.prototype.get$library = function() { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15135 } | 15154 } |
| 15136 ConcreteType.prototype.markUsed = function() { | 15155 ConcreteType.prototype.markUsed = function() { |
| 15137 this.genericType.markUsed(); | 15156 this.genericType.markUsed(); |
| 15138 } | 15157 } |
| 15139 ConcreteType.prototype.isParentOf = function(child) { | 15158 ConcreteType.prototype.isParentOf = function(child) { |
| 15140 if (this.genericType.isParentOf(child)) return true; | 15159 if (this.genericType.isParentOf(child)) return true; |
| 15141 if ((child instanceof ConcreteType)) { | 15160 if ((child instanceof ConcreteType)) { |
| 15142 if ($eq(child.genericType, this.genericType)) { | 15161 if ($eq(child.genericType, this.genericType)) { |
| 15143 var $list = this.typeArguments.getKeys(); | 15162 var $list = this.typeArguments.getKeys(); |
| 15144 for (var $i = this.typeArguments.getKeys().iterator(); $i.hasNext(); ) { | 15163 for (var $i = this.typeArguments.getKeys().iterator(); $i.hasNext(); ) { |
| 15145 var name = $i.next(); | 15164 var name0 = $i.next(); |
| 15146 var myType = this.typeArguments.$index(name); | 15165 var myType = this.typeArguments.$index(name0); |
| 15147 var childType = child.typeArguments.$index(name); | 15166 var childType = child.typeArguments.$index(name0); |
| 15148 if (!myType.isParentOf(childType)) return false; | 15167 if (!myType.isParentOf(childType)) return false; |
| 15149 } | 15168 } |
| 15150 return true; | 15169 return true; |
| 15151 } | 15170 } |
| 15152 if (this.genericType.isParentOf(child.genericType)) { | 15171 if (this.genericType.isParentOf(child.genericType)) { |
| 15153 return true; | 15172 return true; |
| 15154 } | 15173 } |
| 15155 } | 15174 } |
| 15156 return false; | 15175 return false; |
| 15157 } | 15176 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15206 return ret; | 15225 return ret; |
| 15207 } | 15226 } |
| 15208 ConcreteType.prototype.resolveType = function(node, isRequired) { | 15227 ConcreteType.prototype.resolveType = function(node, isRequired) { |
| 15209 var ret = this.genericType.resolveType(node, isRequired); | 15228 var ret = this.genericType.resolveType(node, isRequired); |
| 15210 return ret; | 15229 return ret; |
| 15211 } | 15230 } |
| 15212 ConcreteType.prototype.addDirectSubtype = function(type) { | 15231 ConcreteType.prototype.addDirectSubtype = function(type) { |
| 15213 this.genericType.addDirectSubtype(type); | 15232 this.genericType.addDirectSubtype(type); |
| 15214 } | 15233 } |
| 15215 // ********** Code for DefinedType ************** | 15234 // ********** Code for DefinedType ************** |
| 15216 function DefinedType(name, library, definition, isClass) { | 15235 function DefinedType(name0, library, definition0, isClass) { |
| 15217 this.isUsed = false | 15236 this.isUsed = false |
| 15218 this.isNativeType = false | 15237 this.isNativeType = false |
| 15219 this.library = library; | 15238 this.library = library; |
| 15220 this.isClass = isClass; | 15239 this.isClass = isClass; |
| 15221 this.directSubtypes = []; | 15240 this.directSubtypes = []; |
| 15222 this.constructors = $map([]); | 15241 this.constructors = $map([]); |
| 15223 this.members = $map([]); | 15242 this.members = $map([]); |
| 15224 this.factories = new FactoryMap(); | 15243 this.factories = new FactoryMap(); |
| 15225 this._resolvedMembers = $map([]); | 15244 this._resolvedMembers = $map([]); |
| 15226 lang_Type.call(this, name); | 15245 lang_Type.call(this, name0); |
| 15227 // Initializers done | 15246 // Initializers done |
| 15228 this.setDefinition(definition); | 15247 this.setDefinition(definition0); |
| 15229 } | 15248 } |
| 15230 $inherits(DefinedType, lang_Type); | 15249 $inherits(DefinedType, lang_Type); |
| 15231 DefinedType.prototype.get$definition = function() { return this.definition; }; | 15250 DefinedType.prototype.get$definition = function() { return this.definition; }; |
| 15232 DefinedType.prototype.set$definition = function(value) { return this.definition
= value; }; | 15251 DefinedType.prototype.set$definition = function(value) { return this.definition
= value; }; |
| 15233 DefinedType.prototype.get$library = function() { return this.library; }; | 15252 DefinedType.prototype.get$library = function() { return this.library; }; |
| 15234 DefinedType.prototype.get$isClass = function() { return this.isClass; }; | 15253 DefinedType.prototype.get$isClass = function() { return this.isClass; }; |
| 15235 DefinedType.prototype.get$parent = function() { return this.parent; }; | 15254 DefinedType.prototype.get$parent = function() { return this.parent; }; |
| 15236 DefinedType.prototype.set$parent = function(value) { return this.parent = value;
}; | 15255 DefinedType.prototype.set$parent = function(value) { return this.parent = value;
}; |
| 15237 DefinedType.prototype.get$interfaces = function() { return this.interfaces; }; | 15256 DefinedType.prototype.get$interfaces = function() { return this.interfaces; }; |
| 15238 DefinedType.prototype.set$interfaces = function(value) { return this.interfaces
= value; }; | 15257 DefinedType.prototype.set$interfaces = function(value) { return this.interfaces
= value; }; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15303 DefinedType.prototype.getAllMembers = function() { | 15322 DefinedType.prototype.getAllMembers = function() { |
| 15304 return HashMapImplementation.HashMapImplementation$from$factory(this.members); | 15323 return HashMapImplementation.HashMapImplementation$from$factory(this.members); |
| 15305 } | 15324 } |
| 15306 DefinedType.prototype.markUsed = function() { | 15325 DefinedType.prototype.markUsed = function() { |
| 15307 if (this.isUsed) return; | 15326 if (this.isUsed) return; |
| 15308 this.isUsed = true; | 15327 this.isUsed = true; |
| 15309 if (this.parent != null) this.parent.markUsed(); | 15328 if (this.parent != null) this.parent.markUsed(); |
| 15310 } | 15329 } |
| 15311 DefinedType.prototype._resolveInterfaces = function(types) { | 15330 DefinedType.prototype._resolveInterfaces = function(types) { |
| 15312 if (types == null) return []; | 15331 if (types == null) return []; |
| 15313 var interfaces = []; | 15332 var interfaces0 = []; |
| 15314 for (var $i = 0;$i < types.length; $i++) { | 15333 for (var $i = 0;$i < types.length; $i++) { |
| 15315 var type = types.$index($i); | 15334 var type = types.$index($i); |
| 15316 var resolvedInterface = this.resolveType(type, true); | 15335 var resolvedInterface = this.resolveType(type, true); |
| 15317 if (resolvedInterface.get$isClosed() && !(this.library.get$isCore() || this.
library.get$isCoreImpl())) { | 15336 if (resolvedInterface.get$isClosed() && !(this.library.get$isCore() || this.
library.get$isCoreImpl())) { |
| 15318 world.error(('can not implement "' + resolvedInterface.get$name() + '": ')
+ 'only native implementation allowed', type.get$span()); | 15337 world.error(('can not implement "' + resolvedInterface.get$name() + '": ')
+ 'only native implementation allowed', type.get$span()); |
| 15319 } | 15338 } |
| 15320 resolvedInterface.addDirectSubtype(this); | 15339 resolvedInterface.addDirectSubtype(this); |
| 15321 interfaces.add(resolvedInterface); | 15340 interfaces0.add(resolvedInterface); |
| 15322 } | 15341 } |
| 15323 return interfaces; | 15342 return interfaces0; |
| 15324 } | 15343 } |
| 15325 DefinedType.prototype.isParentOf = function(child) { | 15344 DefinedType.prototype.isParentOf = function(child) { |
| 15326 return this.get$isVar() || this.get$isObject() || $eq(child, this) || this.get
$subtypes().some((function (s) { | 15345 return this.get$isVar() || this.get$isObject() || $eq(child, this) || this.get
$subtypes().some((function (s) { |
| 15327 return $eq(s, child); | 15346 return $eq(s, child); |
| 15328 }) | 15347 }) |
| 15329 ); | 15348 ); |
| 15330 } | 15349 } |
| 15331 DefinedType.prototype.addDirectSubtype = function(type) { | 15350 DefinedType.prototype.addDirectSubtype = function(type) { |
| 15332 var present = this.directSubtypes.some((function (t) { | 15351 var present = this.directSubtypes.some((function (t) { |
| 15333 return $eq(t, type); | 15352 return $eq(t, type); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15420 var $list0 = this.members.getValues(); | 15439 var $list0 = this.members.getValues(); |
| 15421 for (var $i = this.members.getValues().iterator(); $i.hasNext(); ) { | 15440 for (var $i = this.members.getValues().iterator(); $i.hasNext(); ) { |
| 15422 var m = $i.next(); | 15441 var m = $i.next(); |
| 15423 m.resolve(this); | 15442 m.resolve(this); |
| 15424 } | 15443 } |
| 15425 this.factories.forEach((function (f) { | 15444 this.factories.forEach((function (f) { |
| 15426 return f.resolve($this); | 15445 return f.resolve($this); |
| 15427 }) | 15446 }) |
| 15428 ); | 15447 ); |
| 15429 } | 15448 } |
| 15430 DefinedType.prototype.addMethod = function(methodName, definition) { | 15449 DefinedType.prototype.addMethod = function(methodName, definition0) { |
| 15431 if (methodName == null) methodName = definition.name.name; | 15450 if (methodName == null) methodName = definition0.name.name; |
| 15432 var method = new MethodMember(methodName, this, definition); | 15451 var method = new MethodMember(methodName, this, definition0); |
| 15433 if (method.get$isConstructor()) { | 15452 if (method.get$isConstructor()) { |
| 15434 if (this.constructors.containsKey(method.get$constructorName())) { | 15453 if (this.constructors.containsKey(method.get$constructorName())) { |
| 15435 world.error(('duplicate constructor definition of ' + method.get$name() +
''), definition.span); | 15454 world.error(('duplicate constructor definition of ' + method.get$name() +
''), definition0.span); |
| 15436 return; | 15455 return; |
| 15437 } | 15456 } |
| 15438 this.constructors.$setindex(method.get$constructorName(), method); | 15457 this.constructors.$setindex(method.get$constructorName(), method); |
| 15439 return; | 15458 return; |
| 15440 } | 15459 } |
| 15441 if (definition.modifiers != null && definition.modifiers.length == 1 && defini
tion.modifiers.$index(0).kind == 74/*TokenKind.FACTORY*/) { | 15460 if (definition0.modifiers != null && definition0.modifiers.length == 1 && defi
nition0.modifiers.$index(0).kind == 74/*TokenKind.FACTORY*/) { |
| 15442 if (this.factories.getFactory(method.get$constructorName(), method.get$name(
)) != null) { | 15461 if (this.factories.getFactory(method.get$constructorName(), method.get$name(
)) != null) { |
| 15443 world.error(('duplicate factory definition of ' + method.get$name() + ''),
definition.span); | 15462 world.error(('duplicate factory definition of ' + method.get$name() + ''),
definition0.span); |
| 15444 return; | 15463 return; |
| 15445 } | 15464 } |
| 15446 this.factories.addFactory(method.get$constructorName(), method.get$name(), m
ethod); | 15465 this.factories.addFactory(method.get$constructorName(), method.get$name(), m
ethod); |
| 15447 return; | 15466 return; |
| 15448 } | 15467 } |
| 15449 if (methodName.startsWith('get\$') || methodName.startsWith('set\$')) { | 15468 if (methodName.startsWith('get\$') || methodName.startsWith('set\$')) { |
| 15450 var propName = methodName.substring(4); | 15469 var propName = methodName.substring(4); |
| 15451 var prop = this.members.$index(propName); | 15470 var prop = this.members.$index(propName); |
| 15452 if (prop == null) { | 15471 if (prop == null) { |
| 15453 prop = new PropertyMember(propName, this); | 15472 prop = new PropertyMember(propName, this); |
| 15454 this.members.$setindex(propName, prop); | 15473 this.members.$setindex(propName, prop); |
| 15455 } | 15474 } |
| 15456 if (!(prop instanceof PropertyMember)) { | 15475 if (!(prop instanceof PropertyMember)) { |
| 15457 world.error(('property conflicts with field name: ' + propName + ''), defi
nition.span); | 15476 world.error(('property conflicts with field name: ' + propName + ''), defi
nition0.span); |
| 15458 return; | 15477 return; |
| 15459 } | 15478 } |
| 15460 if (methodName[0] == 'g') { | 15479 if (methodName[0] == 'g') { |
| 15461 if (prop.getter != null) { | 15480 if (prop.getter != null) { |
| 15462 world.error(('duplicate getter definition for ' + propName + ''), defini
tion.span); | 15481 world.error(('duplicate getter definition for ' + propName + ''), defini
tion0.span); |
| 15463 } | 15482 } |
| 15464 prop.getter = method; | 15483 prop.getter = method; |
| 15465 } | 15484 } |
| 15466 else { | 15485 else { |
| 15467 if (prop.setter != null) { | 15486 if (prop.setter != null) { |
| 15468 world.error(('duplicate setter definition for ' + propName + ''), defini
tion.span); | 15487 world.error(('duplicate setter definition for ' + propName + ''), defini
tion0.span); |
| 15469 } | 15488 } |
| 15470 prop.setter = method; | 15489 prop.setter = method; |
| 15471 } | 15490 } |
| 15472 return; | 15491 return; |
| 15473 } | 15492 } |
| 15474 if (this.members.containsKey(methodName)) { | 15493 if (this.members.containsKey(methodName)) { |
| 15475 world.error(('duplicate method definition of ' + method.get$name() + ''), de
finition.span); | 15494 world.error(('duplicate method definition of ' + method.get$name() + ''), de
finition0.span); |
| 15476 return; | 15495 return; |
| 15477 } | 15496 } |
| 15478 this.members.$setindex(methodName, method); | 15497 this.members.$setindex(methodName, method); |
| 15479 } | 15498 } |
| 15480 DefinedType.prototype.addField = function(definition) { | 15499 DefinedType.prototype.addField = function(definition0) { |
| 15481 for (var i = 0; | 15500 for (var i = 0; |
| 15482 i < definition.names.length; i++) { | 15501 i < definition0.names.length; i++) { |
| 15483 var name = definition.names.$index(i).get$name(); | 15502 var name0 = definition0.names.$index(i).get$name(); |
| 15484 if (this.members.containsKey(name)) { | 15503 if (this.members.containsKey(name0)) { |
| 15485 world.error(('duplicate field definition of ' + name + ''), definition.spa
n); | 15504 world.error(('duplicate field definition of ' + name0 + ''), definition0.s
pan); |
| 15486 return; | 15505 return; |
| 15487 } | 15506 } |
| 15488 var value = null; | 15507 var value = null; |
| 15489 if (definition.values != null) { | 15508 if (definition0.values != null) { |
| 15490 value = definition.values.$index(i); | 15509 value = definition0.values.$index(i); |
| 15491 } | 15510 } |
| 15492 var field = new FieldMember(name, this, definition, value); | 15511 var field = new FieldMember(name0, this, definition0, value); |
| 15493 this.members.$setindex(name, field); | 15512 this.members.$setindex(name0, field); |
| 15494 if (this.isNativeType) { | 15513 if (this.isNativeType) { |
| 15495 field.isNative = true; | 15514 field.isNative = true; |
| 15496 } | 15515 } |
| 15497 } | 15516 } |
| 15498 } | 15517 } |
| 15499 DefinedType.prototype.getFactory = function(type, constructorName) { | 15518 DefinedType.prototype.getFactory = function(type, constructorName) { |
| 15500 var ret = this.factories.getFactory(type.name, constructorName); | 15519 var ret = this.factories.getFactory(type.name, constructorName); |
| 15501 if ($ne(ret, null)) return ret; | 15520 if ($ne(ret, null)) return ret; |
| 15502 ret = this.factories.getFactory(this.name, constructorName); | 15521 ret = this.factories.getFactory(this.name, constructorName); |
| 15503 if ($ne(ret, null)) return ret; | 15522 if ($ne(ret, null)) return ret; |
| 15504 ret = this.constructors.$index(constructorName); | 15523 ret = this.constructors.$index(constructorName); |
| 15505 if ($ne(ret, null)) return ret; | 15524 if ($ne(ret, null)) return ret; |
| 15506 return this._tryCreateDefaultConstructor(constructorName); | 15525 return this._tryCreateDefaultConstructor(constructorName); |
| 15507 } | 15526 } |
| 15508 DefinedType.prototype.getConstructor = function(constructorName) { | 15527 DefinedType.prototype.getConstructor = function(constructorName) { |
| 15509 var ret = this.constructors.$index(constructorName); | 15528 var ret = this.constructors.$index(constructorName); |
| 15510 if ($ne(ret, null)) { | 15529 if ($ne(ret, null)) { |
| 15511 if (this.factory_ != null) { | 15530 if (this.factory_ != null) { |
| 15512 return this.factory_.getFactory(this, constructorName); | 15531 return this.factory_.getFactory(this, constructorName); |
| 15513 } | 15532 } |
| 15514 return ret; | 15533 return ret; |
| 15515 } | 15534 } |
| 15516 ret = this.factories.getFactory(this.name, constructorName); | 15535 ret = this.factories.getFactory(this.name, constructorName); |
| 15517 if ($ne(ret, null)) return ret; | 15536 if ($ne(ret, null)) return ret; |
| 15518 return this._tryCreateDefaultConstructor(constructorName); | 15537 return this._tryCreateDefaultConstructor(constructorName); |
| 15519 } | 15538 } |
| 15520 DefinedType.prototype._tryCreateDefaultConstructor = function(name) { | 15539 DefinedType.prototype._tryCreateDefaultConstructor = function(name0) { |
| 15521 if (name == '' && this.definition != null && this.isClass && this.constructors
.get$length() == 0) { | 15540 if (name0 == '' && this.definition != null && this.isClass && this.constructor
s.get$length() == 0) { |
| 15522 var span = this.definition.span; | 15541 var span0 = this.definition.span; |
| 15523 var inits = null, body = null; | 15542 var inits = null, body = null; |
| 15524 if (this.isNativeType) { | 15543 if (this.isNativeType) { |
| 15525 body = new NativeStatement(null, span); | 15544 body = new NativeStatement(null, span0); |
| 15526 inits = null; | 15545 inits = null; |
| 15527 } | 15546 } |
| 15528 else { | 15547 else { |
| 15529 body = null; | 15548 body = null; |
| 15530 inits = [new CallExpression(new SuperExpression(span), [], span)]; | 15549 inits = [new CallExpression(new SuperExpression(span0), [], span0)]; |
| 15531 } | 15550 } |
| 15532 var c = new FunctionDefinition(null, null, this.definition.get$name(), [], i
nits, body, span); | 15551 var c = new FunctionDefinition(null, null, this.definition.get$name(), [], i
nits, body, span0); |
| 15533 this.addMethod(null, c); | 15552 this.addMethod(null, c); |
| 15534 this.constructors.$index('').resolve(this); | 15553 this.constructors.$index('').resolve(this); |
| 15535 return this.constructors.$index(''); | 15554 return this.constructors.$index(''); |
| 15536 } | 15555 } |
| 15537 return null; | 15556 return null; |
| 15538 } | 15557 } |
| 15539 DefinedType.prototype.getMember = function(memberName) { | 15558 DefinedType.prototype.getMember = function(memberName) { |
| 15540 var member = this.members.$index(memberName); | 15559 var member = this.members.$index(memberName); |
| 15541 if (member != null) { | 15560 if (member != null) { |
| 15542 var parentMember = this.getMemberInParents(memberName); | 15561 var parentMember = this.getMemberInParents(memberName); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15636 return type.name.name + '.' + Strings.join(names, '.'); | 15655 return type.name.name + '.' + Strings.join(names, '.'); |
| 15637 } | 15656 } |
| 15638 else { | 15657 else { |
| 15639 return type.name.name; | 15658 return type.name.name; |
| 15640 } | 15659 } |
| 15641 } | 15660 } |
| 15642 DefinedType.prototype.resolveType = function(node, isRequired) { | 15661 DefinedType.prototype.resolveType = function(node, isRequired) { |
| 15643 if (node == null) return world.varType; | 15662 if (node == null) return world.varType; |
| 15644 if (node.type != null) return node.type; | 15663 if (node.type != null) return node.type; |
| 15645 if ((node instanceof NameTypeReference)) { | 15664 if ((node instanceof NameTypeReference)) { |
| 15646 var name; | 15665 var name0; |
| 15647 if (node.names != null) { | 15666 if (node.names != null) { |
| 15648 name = node.names.last().get$name(); | 15667 name0 = node.names.last().get$name(); |
| 15649 } | 15668 } |
| 15650 else { | 15669 else { |
| 15651 name = node.get$name().get$name(); | 15670 name0 = node.get$name().get$name(); |
| 15652 } | 15671 } |
| 15653 if (this.typeParameters != null) { | 15672 if (this.typeParameters != null) { |
| 15654 var $list = this.typeParameters; | 15673 var $list = this.typeParameters; |
| 15655 for (var $i = 0;$i < $list.length; $i++) { | 15674 for (var $i = 0;$i < $list.length; $i++) { |
| 15656 var tp = $list.$index($i); | 15675 var tp = $list.$index($i); |
| 15657 if ($eq(tp.get$name(), name)) { | 15676 if ($eq(tp.get$name(), name0)) { |
| 15658 node.type = tp; | 15677 node.type = tp; |
| 15659 } | 15678 } |
| 15660 } | 15679 } |
| 15661 } | 15680 } |
| 15662 if (node.type == null) { | 15681 if (node.type == null) { |
| 15663 node.type = this.library.findType(node); | 15682 node.type = this.library.findType(node); |
| 15664 } | 15683 } |
| 15665 if (node.type == null) { | 15684 if (node.type == null) { |
| 15666 var message = ('can not find type ' + DefinedType._getDottedName(node) + '
'); | 15685 var message = ('can not find type ' + DefinedType._getDottedName(node) + '
'); |
| 15667 if (isRequired) { | 15686 if (isRequired) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 15690 var extendsType = baseType.get$typeParameters().$index(i).extendsType; | 15709 var extendsType = baseType.get$typeParameters().$index(i).extendsType; |
| 15691 var typeArg = this.resolveType(node.typeArguments.$index(i), isRequired); | 15710 var typeArg = this.resolveType(node.typeArguments.$index(i), isRequired); |
| 15692 typeArgs.add(typeArg); | 15711 typeArgs.add(typeArg); |
| 15693 if ($ne(extendsType, null) && !(typeArg instanceof ParameterType)) { | 15712 if ($ne(extendsType, null) && !(typeArg instanceof ParameterType)) { |
| 15694 extendsType.ensureAssignableFrom(typeArg, node.typeArguments.$index(i),
isRequired); | 15713 extendsType.ensureAssignableFrom(typeArg, node.typeArguments.$index(i),
isRequired); |
| 15695 } | 15714 } |
| 15696 } | 15715 } |
| 15697 node.type = baseType.getOrMakeConcreteType(typeArgs); | 15716 node.type = baseType.getOrMakeConcreteType(typeArgs); |
| 15698 } | 15717 } |
| 15699 else if ((node instanceof FunctionTypeReference)) { | 15718 else if ((node instanceof FunctionTypeReference)) { |
| 15700 var name = ''; | 15719 var name0 = ''; |
| 15701 if (node.func.name != null) name = node.func.name.name; | 15720 if (node.func.name != null) name0 = node.func.name.name; |
| 15702 node.type = this.library.getOrAddFunctionType(name, node.func, this); | 15721 node.type = this.library.getOrAddFunctionType(name0, node.func, this); |
| 15703 } | 15722 } |
| 15704 else { | 15723 else { |
| 15705 world.internalError('unknown type reference', node.span); | 15724 world.internalError('unknown type reference', node.span); |
| 15706 } | 15725 } |
| 15707 return node.type; | 15726 return node.type; |
| 15708 } | 15727 } |
| 15709 DefinedType.prototype.resolveTypeParams = function(inType) { | 15728 DefinedType.prototype.resolveTypeParams = function(inType) { |
| 15710 return this; | 15729 return this; |
| 15711 } | 15730 } |
| 15712 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { | 15731 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15758 if (other.get$interfaces() != null) { | 15777 if (other.get$interfaces() != null) { |
| 15759 var $list = other.get$interfaces(); | 15778 var $list = other.get$interfaces(); |
| 15760 for (var $i = 0;$i < $list.length; $i++) { | 15779 for (var $i = 0;$i < $list.length; $i++) { |
| 15761 var i = $list.$index($i); | 15780 var i = $list.$index($i); |
| 15762 if (this._interfaceIsAssignableFrom(i)) return true; | 15781 if (this._interfaceIsAssignableFrom(i)) return true; |
| 15763 } | 15782 } |
| 15764 } | 15783 } |
| 15765 return false; | 15784 return false; |
| 15766 } | 15785 } |
| 15767 DefinedType.prototype.getCallStub = function(args) { | 15786 DefinedType.prototype.getCallStub = function(args) { |
| 15768 var name = _getCallStubName('call', args); | 15787 var name0 = _getCallStubName('call', args); |
| 15769 if (this.varStubs == null) this.varStubs = $map([]); | 15788 if (this.varStubs == null) this.varStubs = $map([]); |
| 15770 var stub = this.varStubs.$index(name); | 15789 var stub = this.varStubs.$index(name0); |
| 15771 if (stub == null) { | 15790 if (stub == null) { |
| 15772 stub = new VarFunctionStub(name, args); | 15791 stub = new VarFunctionStub(name0, args); |
| 15773 this.varStubs.$setindex(name, stub); | 15792 this.varStubs.$setindex(name0, stub); |
| 15774 } | 15793 } |
| 15775 return stub; | 15794 return stub; |
| 15776 } | 15795 } |
| 15777 // ********** Code for Value ************** | 15796 // ********** Code for Value ************** |
| 15778 function Value(type, code, isSuper, needsTemp, isType) { | 15797 function Value(type, code, isSuper, needsTemp, isType) { |
| 15779 this.type = type; | 15798 this.type = type; |
| 15780 this.code = code; | 15799 this.code = code; |
| 15781 this.isSuper = isSuper; | 15800 this.isSuper = isSuper; |
| 15782 this.needsTemp = needsTemp; | 15801 this.needsTemp = needsTemp; |
| 15783 this.isType = isType; | 15802 this.isType = isType; |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15917 if (name == '\$index' || name == '\$setindex') { | 15936 if (name == '\$index' || name == '\$setindex') { |
| 15918 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString
+ ')'), false, true, false); | 15937 return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString
+ ')'), false, true, false); |
| 15919 } | 15938 } |
| 15920 else { | 15939 else { |
| 15921 if (argsString.length > 0) argsString = (', ' + argsString + ''); | 15940 if (argsString.length > 0) argsString = (', ' + argsString + ''); |
| 15922 return new Value(returnType, ('' + name + '(' + this.code + '' + argsString
+ ')'), false, true, false); | 15941 return new Value(returnType, ('' + name + '(' + this.code + '' + argsString
+ ')'), false, true, false); |
| 15923 } | 15942 } |
| 15924 } | 15943 } |
| 15925 // ********** Code for EvaluatedValue ************** | 15944 // ********** Code for EvaluatedValue ************** |
| 15926 function EvaluatedValue() {} | 15945 function EvaluatedValue() {} |
| 15927 EvaluatedValue._internal$ctor = function(type, actualValue, canonicalCode, origi
nal, code) { | 15946 EvaluatedValue._internal$ctor = function(type0, actualValue, canonicalCode, orig
inal, code0) { |
| 15928 this.actualValue = actualValue; | 15947 this.actualValue = actualValue; |
| 15929 this.canonicalCode = canonicalCode; | 15948 this.canonicalCode = canonicalCode; |
| 15930 this.original = original; | 15949 this.original = original; |
| 15931 Value.call(this, type, code, false, false, false); | 15950 Value.call(this, type0, code0, false, false, false); |
| 15932 // Initializers done | 15951 // Initializers done |
| 15933 } | 15952 } |
| 15934 EvaluatedValue._internal$ctor.prototype = EvaluatedValue.prototype; | 15953 EvaluatedValue._internal$ctor.prototype = EvaluatedValue.prototype; |
| 15935 $inherits(EvaluatedValue, Value); | 15954 $inherits(EvaluatedValue, Value); |
| 15936 EvaluatedValue.EvaluatedValue$factory = function(type, actualValue, canonicalCod
e, original) { | 15955 EvaluatedValue.EvaluatedValue$factory = function(type0, actualValue0, canonicalC
ode0, original0) { |
| 15937 return new EvaluatedValue._internal$ctor(type, actualValue, canonicalCode, ori
ginal, EvaluatedValue.codeWithComments(canonicalCode, original)); | 15956 return new EvaluatedValue._internal$ctor(type0, actualValue0, canonicalCode0,
original0, EvaluatedValue.codeWithComments(canonicalCode0, original0)); |
| 15938 } | 15957 } |
| 15939 EvaluatedValue.prototype.get$actualValue = function() { return this.actualValue;
}; | 15958 EvaluatedValue.prototype.get$actualValue = function() { return this.actualValue;
}; |
| 15940 EvaluatedValue.prototype.set$actualValue = function(value) { return this.actualV
alue = value; }; | 15959 EvaluatedValue.prototype.set$actualValue = function(value) { return this.actualV
alue = value; }; |
| 15941 EvaluatedValue.prototype.get$isConst = function() { | 15960 EvaluatedValue.prototype.get$isConst = function() { |
| 15942 return true; | 15961 return true; |
| 15943 } | 15962 } |
| 15944 EvaluatedValue.codeWithComments = function(canonicalCode, original) { | 15963 EvaluatedValue.codeWithComments = function(canonicalCode0, original0) { |
| 15945 return (original != null && original.get$text() != canonicalCode) ? ('' + cano
nicalCode + '/*' + original.get$text() + '*/') : canonicalCode; | 15964 return (original0 != null && original0.get$text() != canonicalCode0) ? ('' + c
anonicalCode0 + '/*' + original0.get$text() + '*/') : canonicalCode0; |
| 15946 } | 15965 } |
| 15947 // ********** Code for ConstListValue ************** | 15966 // ********** Code for ConstListValue ************** |
| 15948 function ConstListValue() {} | 15967 function ConstListValue() {} |
| 15949 ConstListValue._internal$ctor = function(type, values, actualValue, canonicalCod
e, original, code) { | 15968 ConstListValue._internal$ctor = function(type0, values, actualValue0, canonicalC
ode0, original0, code0) { |
| 15950 this.values = values; | 15969 this.values = values; |
| 15951 EvaluatedValue._internal$ctor.call(this, type, actualValue, canonicalCode, ori
ginal, code); | 15970 EvaluatedValue._internal$ctor.call(this, type0, actualValue0, canonicalCode0,
original0, code0); |
| 15952 // Initializers done | 15971 // Initializers done |
| 15953 } | 15972 } |
| 15954 ConstListValue._internal$ctor.prototype = ConstListValue.prototype; | 15973 ConstListValue._internal$ctor.prototype = ConstListValue.prototype; |
| 15955 $inherits(ConstListValue, EvaluatedValue); | 15974 $inherits(ConstListValue, EvaluatedValue); |
| 15956 ConstListValue.ConstListValue$factory = function(type, values, actualValue, cano
nicalCode, original) { | 15975 ConstListValue.ConstListValue$factory = function(type0, values0, actualValue0, c
anonicalCode0, original0) { |
| 15957 return new ConstListValue._internal$ctor(type, values, actualValue, canonicalC
ode, original, EvaluatedValue.codeWithComments(canonicalCode, original)); | 15976 return new ConstListValue._internal$ctor(type0, values0, actualValue0, canonic
alCode0, original0, EvaluatedValue.codeWithComments(canonicalCode0, original0)); |
| 15958 } | 15977 } |
| 15959 // ********** Code for ConstMapValue ************** | 15978 // ********** Code for ConstMapValue ************** |
| 15960 function ConstMapValue() {} | 15979 function ConstMapValue() {} |
| 15961 ConstMapValue._internal$ctor = function(type, values, actualValue, canonicalCode
, original, code) { | 15980 ConstMapValue._internal$ctor = function(type0, values, actualValue0, canonicalCo
de0, original0, code0) { |
| 15962 this.values = values; | 15981 this.values = values; |
| 15963 EvaluatedValue._internal$ctor.call(this, type, actualValue, canonicalCode, ori
ginal, code); | 15982 EvaluatedValue._internal$ctor.call(this, type0, actualValue0, canonicalCode0,
original0, code0); |
| 15964 // Initializers done | 15983 // Initializers done |
| 15965 } | 15984 } |
| 15966 ConstMapValue._internal$ctor.prototype = ConstMapValue.prototype; | 15985 ConstMapValue._internal$ctor.prototype = ConstMapValue.prototype; |
| 15967 $inherits(ConstMapValue, EvaluatedValue); | 15986 $inherits(ConstMapValue, EvaluatedValue); |
| 15968 ConstMapValue.ConstMapValue$factory = function(type, keyValuePairs, actualValue,
canonicalCode, original) { | 15987 ConstMapValue.ConstMapValue$factory = function(type0, keyValuePairs, actualValue
0, canonicalCode0, original0) { |
| 15969 var values = new HashMapImplementation$String$EvaluatedValue(); | 15988 var values0 = new HashMapImplementation$String$EvaluatedValue(); |
| 15970 for (var i = 0; | 15989 for (var i = 0; |
| 15971 i < keyValuePairs.length; i += 2) { | 15990 i < keyValuePairs.length; i += 2) { |
| 15972 values.$setindex(keyValuePairs.$index(i).get$actualValue(), keyValuePairs.$i
ndex(i + 1)); | 15991 values0.$setindex(keyValuePairs.$index(i).get$actualValue(), keyValuePairs.$
index(i + 1)); |
| 15973 } | 15992 } |
| 15974 return new ConstMapValue._internal$ctor(type, values, actualValue, canonicalCo
de, original, EvaluatedValue.codeWithComments(canonicalCode, original)); | 15993 return new ConstMapValue._internal$ctor(type0, values0, actualValue0, canonica
lCode0, original0, EvaluatedValue.codeWithComments(canonicalCode0, original0)); |
| 15975 } | 15994 } |
| 15976 // ********** Code for ConstObjectValue ************** | 15995 // ********** Code for ConstObjectValue ************** |
| 15977 function ConstObjectValue() {} | 15996 function ConstObjectValue() {} |
| 15978 ConstObjectValue._internal$ctor = function(type, fields, actualValue, canonicalC
ode, original, code) { | 15997 ConstObjectValue._internal$ctor = function(type0, fields, actualValue0, canonica
lCode0, original0, code0) { |
| 15979 this.fields = fields; | 15998 this.fields = fields; |
| 15980 EvaluatedValue._internal$ctor.call(this, type, actualValue, canonicalCode, ori
ginal, code); | 15999 EvaluatedValue._internal$ctor.call(this, type0, actualValue0, canonicalCode0,
original0, code0); |
| 15981 // Initializers done | 16000 // Initializers done |
| 15982 } | 16001 } |
| 15983 ConstObjectValue._internal$ctor.prototype = ConstObjectValue.prototype; | 16002 ConstObjectValue._internal$ctor.prototype = ConstObjectValue.prototype; |
| 15984 $inherits(ConstObjectValue, EvaluatedValue); | 16003 $inherits(ConstObjectValue, EvaluatedValue); |
| 15985 ConstObjectValue.ConstObjectValue$factory = function(type, fields, canonicalCode
, original) { | 16004 ConstObjectValue.ConstObjectValue$factory = function(type0, fields0, canonicalCo
de0, original0) { |
| 15986 var fieldValues = []; | 16005 var fieldValues = []; |
| 15987 var $list = fields.getKeys(); | 16006 var $list = fields0.getKeys(); |
| 15988 for (var $i = fields.getKeys().iterator(); $i.hasNext(); ) { | 16007 for (var $i = fields0.getKeys().iterator(); $i.hasNext(); ) { |
| 15989 var f = $i.next(); | 16008 var f = $i.next(); |
| 15990 fieldValues.add(('' + f + ' = ' + fields.$index(f).get$actualValue() + '')); | 16009 fieldValues.add(('' + f + ' = ' + fields0.$index(f).get$actualValue() + ''))
; |
| 15991 } | 16010 } |
| 15992 fieldValues.sort((function (a, b) { | 16011 fieldValues.sort((function (a, b) { |
| 15993 return a.compareTo(b); | 16012 return a.compareTo(b); |
| 15994 }) | 16013 }) |
| 15995 ); | 16014 ); |
| 15996 var actualValue = ('const ' + type.get$jsname() + ' [') + Strings.join(fieldVa
lues, ',') + ']'; | 16015 var actualValue0 = ('const ' + type0.get$jsname() + ' [') + Strings.join(field
Values, ',') + ']'; |
| 15997 return new ConstObjectValue._internal$ctor(type, fields, actualValue, canonica
lCode, original, EvaluatedValue.codeWithComments(canonicalCode, original)); | 16016 return new ConstObjectValue._internal$ctor(type0, fields0, actualValue0, canon
icalCode0, original0, EvaluatedValue.codeWithComments(canonicalCode0, original0)
); |
| 15998 } | 16017 } |
| 15999 // ********** Code for GlobalValue ************** | 16018 // ********** Code for GlobalValue ************** |
| 16000 function GlobalValue(type, code, isConst, field, name, exp, canonicalCode, origi
nal, dependencies) { | 16019 function GlobalValue(type0, code0, isConst0, field, name, exp, canonicalCode, or
iginal, dependencies) { |
| 16001 this.field = field; | 16020 this.field = field; |
| 16002 this.name = name; | 16021 this.name = name; |
| 16003 this.exp = exp; | 16022 this.exp = exp; |
| 16004 this.canonicalCode = canonicalCode; | 16023 this.canonicalCode = canonicalCode; |
| 16005 this.original = original; | 16024 this.original = original; |
| 16006 this.dependencies = dependencies; | 16025 this.dependencies = dependencies; |
| 16007 Value.call(this, type, code, false, !isConst, false); | 16026 Value.call(this, type0, code0, false, !isConst0, false); |
| 16008 // Initializers done | 16027 // Initializers done |
| 16009 } | 16028 } |
| 16010 $inherits(GlobalValue, Value); | 16029 $inherits(GlobalValue, Value); |
| 16011 GlobalValue.GlobalValue$fromStatic$factory = function(field, exp, dependencies)
{ | 16030 GlobalValue.GlobalValue$fromStatic$factory = function(field0, exp0, dependencies
0) { |
| 16012 var code = (exp.get$isConst() ? exp.canonicalCode : exp.code); | 16031 var code0 = (exp0.get$isConst() ? exp0.canonicalCode : exp0.code); |
| 16013 var codeWithComment = ('' + code + '/*' + field.declaringType.name + '.' + fie
ld.get$name() + '*/'); | 16032 var codeWithComment = ('' + code0 + '/*' + field0.declaringType.name + '.' + f
ield0.get$name() + '*/'); |
| 16014 return new GlobalValue(exp.type, codeWithComment, field.isFinal, field, null,
exp, code, null, dependencies.filter((function (d) { | 16033 return new GlobalValue(exp0.type, codeWithComment, field0.isFinal, field0, nul
l, exp0, code0, null, dependencies0.filter((function (d) { |
| 16015 return (d instanceof GlobalValue); | 16034 return (d instanceof GlobalValue); |
| 16016 }) | 16035 }) |
| 16017 )); | 16036 )); |
| 16018 } | 16037 } |
| 16019 GlobalValue.GlobalValue$fromConst$factory = function(uniqueId, exp, dependencies
) { | 16038 GlobalValue.GlobalValue$fromConst$factory = function(uniqueId, exp0, dependencie
s0) { |
| 16020 var name = ("const\$" + uniqueId + ""); | 16039 var name0 = ("const\$" + uniqueId + ""); |
| 16021 var codeWithComment = ("" + name + "/*" + exp.original.get$text() + "*/"); | 16040 var codeWithComment = ("" + name0 + "/*" + exp0.original.get$text() + "*/"); |
| 16022 return new GlobalValue(exp.type, codeWithComment, true, null, name, exp, name,
exp.original, dependencies.filter((function (d) { | 16041 return new GlobalValue(exp0.type, codeWithComment, true, null, name0, exp0, na
me0, exp0.original, dependencies0.filter((function (d) { |
| 16023 return (d instanceof GlobalValue); | 16042 return (d instanceof GlobalValue); |
| 16024 }) | 16043 }) |
| 16025 )); | 16044 )); |
| 16026 } | 16045 } |
| 16027 GlobalValue.prototype.get$name = function() { return this.name; }; | 16046 GlobalValue.prototype.get$name = function() { return this.name; }; |
| 16028 GlobalValue.prototype.set$name = function(value) { return this.name = value; }; | 16047 GlobalValue.prototype.set$name = function(value) { return this.name = value; }; |
| 16029 GlobalValue.prototype.get$isConst = function() { | 16048 GlobalValue.prototype.get$isConst = function() { |
| 16030 return this.exp.get$isConst() && (this.field == null || this.field.isFinal); | 16049 return this.exp.get$isConst() && (this.field == null || this.field.isFinal); |
| 16031 } | 16050 } |
| 16032 GlobalValue.prototype.get$actualValue = function() { | 16051 GlobalValue.prototype.get$actualValue = function() { |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16571 VarMethodStub.prototype.generateBody = function(code) { | 16590 VarMethodStub.prototype.generateBody = function(code) { |
| 16572 if (this._useDirectCall(this.member, this.args)) { | 16591 if (this._useDirectCall(this.member, this.args)) { |
| 16573 code.write(('' + this.get$typeName() + '.prototype.' + this.member.get$jsnam
e() + '')); | 16592 code.write(('' + this.get$typeName() + '.prototype.' + this.member.get$jsnam
e() + '')); |
| 16574 } | 16593 } |
| 16575 else { | 16594 else { |
| 16576 code.enterBlock(('function(' + this.args.getCode() + ') {')); | 16595 code.enterBlock(('function(' + this.args.getCode() + ') {')); |
| 16577 code.writeln(('return ' + this.body.code + ';')); | 16596 code.writeln(('return ' + this.body.code + ';')); |
| 16578 code.exitBlock('}'); | 16597 code.exitBlock('}'); |
| 16579 } | 16598 } |
| 16580 } | 16599 } |
| 16581 VarMethodStub.prototype._useDirectCall = function(member, args) { | 16600 VarMethodStub.prototype._useDirectCall = function(member0, args0) { |
| 16582 if ((member instanceof MethodMember) && $ne(member.declaringType.get$library()
, world.get$dom())) { | 16601 if ((member0 instanceof MethodMember) && $ne(member0.declaringType.get$library
(), world.get$dom())) { |
| 16583 var method = member; | 16602 var method = member0; |
| 16584 method.genParameterValues(); | 16603 method.genParameterValues(); |
| 16585 for (var i = args.get$length(); | 16604 for (var i = args0.get$length(); |
| 16586 i < method.parameters.length; i++) { | 16605 i < method.parameters.length; i++) { |
| 16587 if (method.parameters.$index(i).get$value().code != 'null') { | 16606 if (method.parameters.$index(i).get$value().code != 'null') { |
| 16588 return false; | 16607 return false; |
| 16589 } | 16608 } |
| 16590 } | 16609 } |
| 16591 return method.namesInOrder(args); | 16610 return method.namesInOrder(args0); |
| 16592 } | 16611 } |
| 16593 else { | 16612 else { |
| 16594 return false; | 16613 return false; |
| 16595 } | 16614 } |
| 16596 } | 16615 } |
| 16597 // ********** Code for VarMethodSet ************** | 16616 // ********** Code for VarMethodSet ************** |
| 16598 function VarMethodSet(name, members, callArgs, returnType) { | 16617 function VarMethodSet(name, members, callArgs, returnType) { |
| 16599 this.name = name; | 16618 this.name = name; |
| 16600 this.members = members; | 16619 this.members = members; |
| 16601 this.returnType = returnType; | 16620 this.returnType = returnType; |
| 16602 this.args = callArgs.toCallStubArgs(); | 16621 this.args = callArgs.toCallStubArgs(); |
| 16603 // Initializers done | 16622 // Initializers done |
| 16604 } | 16623 } |
| 16605 $inherits(VarMethodSet, VarMember); | 16624 $inherits(VarMethodSet, VarMember); |
| 16606 VarMethodSet.prototype.get$name = function() { return this.name; }; | 16625 VarMethodSet.prototype.get$name = function() { return this.name; }; |
| 16607 VarMethodSet.prototype.get$returnType = function() { return this.returnType; }; | 16626 VarMethodSet.prototype.get$returnType = function() { return this.returnType; }; |
| 16608 VarMethodSet.prototype.get$baseName = function() { | 16627 VarMethodSet.prototype.get$baseName = function() { |
| 16609 return this.members.$index(0).get$name(); | 16628 return this.members.$index(0).get$name(); |
| 16610 } | 16629 } |
| 16611 VarMethodSet.prototype.invoke = function(node, target, args) { | 16630 VarMethodSet.prototype.invoke = function(node, target, args0) { |
| 16612 this._invokeMembers(node); | 16631 this._invokeMembers(node); |
| 16613 return VarMember.prototype.invoke.call(this, node, target, args); | 16632 return VarMember.prototype.invoke.call(this, node, target, args0); |
| 16614 } | 16633 } |
| 16615 VarMethodSet.prototype._invokeMembers = function(node) { | 16634 VarMethodSet.prototype._invokeMembers = function(node) { |
| 16616 if (this._fallbackStubs != null) return; | 16635 if (this._fallbackStubs != null) return; |
| 16617 this._fallbackStubs = []; | 16636 this._fallbackStubs = []; |
| 16618 var $list = this.members; | 16637 var $list = this.members; |
| 16619 for (var $i = 0;$i < $list.length; $i++) { | 16638 for (var $i = 0;$i < $list.length; $i++) { |
| 16620 var member = $list.$index($i); | 16639 var member = $list.$index($i); |
| 16621 var target = new Value(member.declaringType, 'this', false, true, false); | 16640 var target = new Value(member.declaringType, 'this', false, true, false); |
| 16622 var result = member.invoke(world.gen, node, target, this.args); | 16641 var result = member.invoke(world.gen, node, target, this.args); |
| 16623 var stub = new VarMethodStub(this.name, member, this.args, result); | 16642 var stub = new VarMethodStub(this.name, member, this.args, result); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16672 var i = source.iterator(); | 16691 var i = source.iterator(); |
| 16673 var current = initialValue; | 16692 var current = initialValue; |
| 16674 if (current == null && i.hasNext()) { | 16693 if (current == null && i.hasNext()) { |
| 16675 current = i.next(); | 16694 current = i.next(); |
| 16676 } | 16695 } |
| 16677 while (i.hasNext()) { | 16696 while (i.hasNext()) { |
| 16678 current = callback.call$2(current, i.next()); | 16697 current = callback.call$2(current, i.next()); |
| 16679 } | 16698 } |
| 16680 return current; | 16699 return current; |
| 16681 } | 16700 } |
| 16682 function orderValuesByKeys(map) { | 16701 function orderValuesByKeys(map0) { |
| 16683 var keys = map.getKeys(); | 16702 var keys = map0.getKeys(); |
| 16684 keys.sort((function (x, y) { | 16703 keys.sort((function (x, y) { |
| 16685 return x.compareTo(y); | 16704 return x.compareTo(y); |
| 16686 }) | 16705 }) |
| 16687 ); | 16706 ); |
| 16688 var values = []; | 16707 var values = []; |
| 16689 for (var $i = keys.iterator(); $i.hasNext(); ) { | 16708 for (var $i = keys.iterator(); $i.hasNext(); ) { |
| 16690 var k = $i.next(); | 16709 var k = $i.next(); |
| 16691 values.add(map.$index(k)); | 16710 values.add(map0.$index(k)); |
| 16692 } | 16711 } |
| 16693 return values; | 16712 return values; |
| 16694 } | 16713 } |
| 16695 function isMultilineString(text) { | 16714 function isMultilineString(text) { |
| 16696 return text.startsWith('"""') || text.startsWith("'''"); | 16715 return text.startsWith('"""') || text.startsWith("'''"); |
| 16697 } | 16716 } |
| 16698 function isRawMultilineString(text) { | 16717 function isRawMultilineString(text) { |
| 16699 return text.startsWith('@"""') || text.startsWith("@'''"); | 16718 return text.startsWith('@"""') || text.startsWith("@'''"); |
| 16700 } | 16719 } |
| 16701 function parseStringLiteral(lit) { | 16720 function parseStringLiteral(lit) { |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16923 INTERFACE, | 16942 INTERFACE, |
| 16924 LIBRARY, | 16943 LIBRARY, |
| 16925 NATIVE, | 16944 NATIVE, |
| 16926 NEGATE, | 16945 NEGATE, |
| 16927 OPERATOR, | 16946 OPERATOR, |
| 16928 SET, | 16947 SET, |
| 16929 SOURCE, | 16948 SOURCE, |
| 16930 STATIC, | 16949 STATIC, |
| 16931 TYPEDEF ]*/; | 16950 TYPEDEF ]*/; |
| 16932 main(); | 16951 main(); |
| OLD | NEW |