| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 function AssertError() {} | 295 function AssertError() {} |
| 296 AssertError.prototype.toString = function() { | 296 AssertError.prototype.toString = function() { |
| 297 return ("Failed assertion: '" + this.failedAssertion + "' is not true ") + ("i
n " + this.url + " at line " + this.line + ", column " + this.column + "."); | 297 return ("Failed assertion: '" + this.failedAssertion + "' is not true ") + ("i
n " + this.url + " at line " + this.line + ", column " + this.column + "."); |
| 298 } | 298 } |
| 299 // ********** Code for TypeError ************** | 299 // ********** Code for TypeError ************** |
| 300 function TypeError() {} | 300 function TypeError() {} |
| 301 $inherits(TypeError, AssertError); | 301 $inherits(TypeError, AssertError); |
| 302 TypeError.prototype.toString = function() { | 302 TypeError.prototype.toString = function() { |
| 303 return ("Failed type check: type " + this.srcType + " is not assignable to typ
e ") + ("" + this.dstType + " of " + this.dstName + " in " + this.url + " at lin
e ") + ("" + this.line + ", column " + this.column + "."); | 303 return ("Failed type check: type " + this.srcType + " is not assignable to typ
e ") + ("" + this.dstType + " of " + this.dstName + " in " + this.url + " at lin
e ") + ("" + this.line + ", column " + this.column + "."); |
| 304 } | 304 } |
| 305 // ********** Code for FallThroughError ************** |
| 306 function FallThroughError() {} |
| 307 FallThroughError.prototype.toString = function() { |
| 308 return ("Switch case fall-through in " + this.url + " at line " + this.line +
"."); |
| 309 } |
| 305 // ********** Code for Object ************** | 310 // ********** Code for Object ************** |
| 306 Object.prototype.get$dynamic = function() { | 311 Object.prototype.get$dynamic = function() { |
| 307 return this; | 312 return this; |
| 308 } | 313 } |
| 309 Object.prototype.noSuchMethod = function(name, args) { | 314 Object.prototype.noSuchMethod = function(name, args) { |
| 310 $throw(new NoSuchMethodException(this, name, args)); | 315 $throw(new NoSuchMethodException(this, name, args)); |
| 311 } | 316 } |
| 312 $defineMethod(Object, "forEach$1", function($0) { | 317 $defineMethod(Object, "forEach$1", function($0) { |
| 313 return this.noSuchMethod("forEach$1", [$0]); | 318 return this.noSuchMethod("forEach$1", [$0]); |
| 314 } | 319 } |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 function ListIterator(array) { | 479 function ListIterator(array) { |
| 475 this._array = array; | 480 this._array = array; |
| 476 this._pos = 0; | 481 this._pos = 0; |
| 477 // Initializers done | 482 // Initializers done |
| 478 } | 483 } |
| 479 ListIterator.prototype.hasNext = function() { | 484 ListIterator.prototype.hasNext = function() { |
| 480 return this._array.length > this._pos; | 485 return this._array.length > this._pos; |
| 481 } | 486 } |
| 482 ListIterator.prototype.next = function() { | 487 ListIterator.prototype.next = function() { |
| 483 if (!this.hasNext()) { | 488 if (!this.hasNext()) { |
| 484 $throw(const$9/*const NoMoreElementsException()*/); | 489 $throw(const$121/*const NoMoreElementsException()*/); |
| 485 } | 490 } |
| 486 return this._array.$index(this._pos++); | 491 return this._array.$index(this._pos++); |
| 487 } | 492 } |
| 488 // ********** Code for JSSyntaxRegExp ************** | 493 // ********** Code for JSSyntaxRegExp ************** |
| 489 function JSSyntaxRegExp() {} | 494 function JSSyntaxRegExp() {} |
| 490 JSSyntaxRegExp._create$ctor = function(pattern, flags) { | 495 JSSyntaxRegExp._create$ctor = function(pattern, flags) { |
| 491 this.re = new RegExp(pattern, flags); | 496 this.re = new RegExp(pattern, flags); |
| 492 this.pattern = pattern; | 497 this.pattern = pattern; |
| 493 this.multiLine = this.re.multiline; | 498 this.multiLine = this.re.multiline; |
| 494 this.ignoreCase = this.re.ignoreCase; | 499 this.ignoreCase = this.re.ignoreCase; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 511 } | 516 } |
| 512 // ********** Code for _AllMatchesIterator ************** | 517 // ********** Code for _AllMatchesIterator ************** |
| 513 function _AllMatchesIterator(re, _str) { | 518 function _AllMatchesIterator(re, _str) { |
| 514 this._str = _str; | 519 this._str = _str; |
| 515 this._done = false; | 520 this._done = false; |
| 516 this._re = new JSSyntaxRegExp._create$ctor(re.pattern, 'g' + (re.multiLine ? '
m' : '') + (re.ignoreCase ? 'i' : '')); | 521 this._re = new JSSyntaxRegExp._create$ctor(re.pattern, 'g' + (re.multiLine ? '
m' : '') + (re.ignoreCase ? 'i' : '')); |
| 517 // Initializers done | 522 // Initializers done |
| 518 } | 523 } |
| 519 _AllMatchesIterator.prototype.next = function() { | 524 _AllMatchesIterator.prototype.next = function() { |
| 520 if (!this.hasNext()) { | 525 if (!this.hasNext()) { |
| 521 $throw(const$9/*const NoMoreElementsException()*/); | 526 $throw(const$121/*const NoMoreElementsException()*/); |
| 522 } | 527 } |
| 523 var next = this._next; | 528 var next = this._next; |
| 524 this._next = null; | 529 this._next = null; |
| 525 return next; | 530 return next; |
| 526 } | 531 } |
| 527 _AllMatchesIterator.prototype.hasNext = function() { | 532 _AllMatchesIterator.prototype.hasNext = function() { |
| 528 if (this._done) { | 533 if (this._done) { |
| 529 return false; | 534 return false; |
| 530 } | 535 } |
| 531 else if (this._next) { | 536 else if (this._next) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 | 568 |
| 564 if (truncated == -0.0) return 0; | 569 if (truncated == -0.0) return 0; |
| 565 return truncated; | 570 return truncated; |
| 566 } | 571 } |
| 567 NumImplementation.prototype.toDouble = function() { | 572 NumImplementation.prototype.toDouble = function() { |
| 568 return this + 0; | 573 return this + 0; |
| 569 } | 574 } |
| 570 NumImplementation.prototype.compareTo = function(other) { | 575 NumImplementation.prototype.compareTo = function(other) { |
| 571 var thisValue = this.toDouble(); | 576 var thisValue = this.toDouble(); |
| 572 if (thisValue < other) { | 577 if (thisValue < other) { |
| 573 return -1; | 578 return -1.000000/*-1*/; |
| 574 } | 579 } |
| 575 else if (thisValue > other) { | 580 else if (thisValue > other) { |
| 576 return 1; | 581 return 1; |
| 577 } | 582 } |
| 578 else if (thisValue == other) { | 583 else if (thisValue == other) { |
| 579 if (thisValue == 0) { | 584 if (thisValue == 0) { |
| 580 var thisIsNegative = this.isNegative(); | 585 var thisIsNegative = this.isNegative(); |
| 581 var otherIsNegative = other.isNegative(); | 586 var otherIsNegative = other.isNegative(); |
| 582 if ($eq(thisIsNegative, otherIsNegative)) return 0; | 587 if ($eq(thisIsNegative, otherIsNegative)) return 0; |
| 583 if (thisIsNegative) return -1; | 588 if (thisIsNegative) return -1.000000/*-1*/; |
| 584 return 1; | 589 return 1; |
| 585 } | 590 } |
| 586 return 0; | 591 return 0; |
| 587 } | 592 } |
| 588 else if (this.isNaN()) { | 593 else if (this.isNaN()) { |
| 589 if (other.isNaN()) { | 594 if (other.isNaN()) { |
| 590 return 0; | 595 return 0; |
| 591 } | 596 } |
| 592 return 1; | 597 return 1; |
| 593 } | 598 } |
| 594 else { | 599 else { |
| 595 return -1; | 600 return -1.000000/*-1*/; |
| 596 } | 601 } |
| 597 } | 602 } |
| 598 // ********** Code for DurationImplementation ************** | 603 // ********** Code for DurationImplementation ************** |
| 599 function DurationImplementation(days, hours, minutes, seconds, milliseconds) { | 604 function DurationImplementation(days, hours, minutes, seconds, milliseconds) { |
| 600 this._durationInMilliseconds = days * 86400000/*Duration.MILLISECONDS_PER_DAY*
/ + hours * 3600000/*Duration.MILLISECONDS_PER_HOUR*/ + minutes * 60000/*Duratio
n.MILLISECONDS_PER_MINUTE*/ + seconds * 1000/*Duration.MILLISECONDS_PER_SECOND*/
+ milliseconds; | 605 this._durationInMilliseconds = days * 86400000.000000/*Duration.MILLISECONDS_P
ER_DAY*/ + hours * 3600000.000000/*Duration.MILLISECONDS_PER_HOUR*/ + minutes *
60000.000000/*Duration.MILLISECONDS_PER_MINUTE*/ + seconds * 1000/*Duration.MILL
ISECONDS_PER_SECOND*/ + milliseconds; |
| 601 // Initializers done | 606 // Initializers done |
| 602 } | 607 } |
| 603 DurationImplementation.prototype.get$inHours = function() { | 608 DurationImplementation.prototype.get$inHours = function() { |
| 604 return $truncdiv(this._durationInMilliseconds, 3600000/*Duration.MILLISECONDS_
PER_HOUR*/); | 609 return $truncdiv(this._durationInMilliseconds, 3600000.000000/*Duration.MILLIS
ECONDS_PER_HOUR*/); |
| 605 } | 610 } |
| 606 DurationImplementation.prototype.get$inMinutes = function() { | 611 DurationImplementation.prototype.get$inMinutes = function() { |
| 607 return $truncdiv(this._durationInMilliseconds, 60000/*Duration.MILLISECONDS_PE
R_MINUTE*/); | 612 return $truncdiv(this._durationInMilliseconds, 60000.000000/*Duration.MILLISEC
ONDS_PER_MINUTE*/); |
| 608 } | 613 } |
| 609 DurationImplementation.prototype.get$inSeconds = function() { | 614 DurationImplementation.prototype.get$inSeconds = function() { |
| 610 return $truncdiv(this._durationInMilliseconds, 1000/*Duration.MILLISECONDS_PER
_SECOND*/); | 615 return $truncdiv(this._durationInMilliseconds, 1000/*Duration.MILLISECONDS_PER
_SECOND*/); |
| 611 } | 616 } |
| 612 DurationImplementation.prototype.get$inMilliseconds = function() { | 617 DurationImplementation.prototype.get$inMilliseconds = function() { |
| 613 return this._durationInMilliseconds; | 618 return this._durationInMilliseconds; |
| 614 } | 619 } |
| 615 DurationImplementation.prototype.$eq = function(other) { | 620 DurationImplementation.prototype.$eq = function(other) { |
| 616 if (!((other instanceof DurationImplementation))) return false; | 621 if (!((other instanceof DurationImplementation))) return false; |
| 617 return this._durationInMilliseconds == other.get$inMilliseconds(); | 622 return this._durationInMilliseconds == other.get$inMilliseconds(); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 HashMapImplementation._firstProbe = function(hashCode, length) { | 677 HashMapImplementation._firstProbe = function(hashCode, length) { |
| 673 return hashCode & (length - 1); | 678 return hashCode & (length - 1); |
| 674 } | 679 } |
| 675 HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length
) { | 680 HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length
) { |
| 676 return (currentProbe + numberOfProbes) & (length - 1); | 681 return (currentProbe + numberOfProbes) & (length - 1); |
| 677 } | 682 } |
| 678 HashMapImplementation.prototype._probeForAdding = function(key) { | 683 HashMapImplementation.prototype._probeForAdding = function(key) { |
| 679 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length
); | 684 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length
); |
| 680 var numberOfProbes = 1; | 685 var numberOfProbes = 1; |
| 681 var initialHash = hash; | 686 var initialHash = hash; |
| 682 var insertionIndex = -1; | 687 var insertionIndex = -1.000000/*-1*/; |
| 683 while (true) { | 688 while (true) { |
| 684 var existingKey = this._keys.$index(hash); | 689 var existingKey = this._keys.$index(hash); |
| 685 if (existingKey == null) { | 690 if (existingKey == null) { |
| 686 if (insertionIndex < 0) return hash; | 691 if (insertionIndex < 0) return hash; |
| 687 return insertionIndex; | 692 return insertionIndex; |
| 688 } | 693 } |
| 689 else if ($eq(existingKey, key)) { | 694 else if ($eq(existingKey, key)) { |
| 690 return hash; | 695 return hash; |
| 691 } | 696 } |
| 692 else if ((insertionIndex < 0) && (HashMapImplementation._deletedKey === exis
tingKey)) { | 697 else if ((insertionIndex < 0) && (HashMapImplementation._deletedKey === exis
tingKey)) { |
| 693 insertionIndex = hash; | 698 insertionIndex = hash; |
| 694 } | 699 } |
| 695 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); | 700 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); |
| 696 } | 701 } |
| 697 } | 702 } |
| 698 HashMapImplementation.prototype._probeForLookup = function(key) { | 703 HashMapImplementation.prototype._probeForLookup = function(key) { |
| 699 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length
); | 704 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length
); |
| 700 var numberOfProbes = 1; | 705 var numberOfProbes = 1; |
| 701 var initialHash = hash; | 706 var initialHash = hash; |
| 702 while (true) { | 707 while (true) { |
| 703 var existingKey = this._keys.$index(hash); | 708 var existingKey = this._keys.$index(hash); |
| 704 if (existingKey == null) return -1; | 709 if (existingKey == null) return -1.000000/*-1*/; |
| 705 if ($eq(existingKey, key)) return hash; | 710 if ($eq(existingKey, key)) return hash; |
| 706 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); | 711 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); |
| 707 } | 712 } |
| 708 } | 713 } |
| 709 HashMapImplementation.prototype._ensureCapacity = function() { | 714 HashMapImplementation.prototype._ensureCapacity = function() { |
| 710 var newNumberOfEntries = this._numberOfEntries + 1; | 715 var newNumberOfEntries = this._numberOfEntries + 1; |
| 711 if (newNumberOfEntries >= this._loadLimit) { | 716 if (newNumberOfEntries >= this._loadLimit) { |
| 712 this._grow(this._keys.length * 2); | 717 this._grow(this._keys.length * 2); |
| 713 return; | 718 return; |
| 714 } | 719 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 HashMapImplementation.prototype.getValues = function() { | 803 HashMapImplementation.prototype.getValues = function() { |
| 799 var list = new ListFactory$V(this.get$length()); | 804 var list = new ListFactory$V(this.get$length()); |
| 800 var i = 0; | 805 var i = 0; |
| 801 this.forEach(function _(key, value) { | 806 this.forEach(function _(key, value) { |
| 802 list.$setindex(i++, value); | 807 list.$setindex(i++, value); |
| 803 } | 808 } |
| 804 ); | 809 ); |
| 805 return list; | 810 return list; |
| 806 } | 811 } |
| 807 HashMapImplementation.prototype.containsKey = function(key) { | 812 HashMapImplementation.prototype.containsKey = function(key) { |
| 808 return (this._probeForLookup(key) != -1); | 813 return (this._probeForLookup(key) != -1.000000/*-1*/); |
| 809 } | 814 } |
| 810 $defineMethod(HashMapImplementation, "forEach$1", HashMapImplementation.prototyp
e.forEach); | 815 $defineMethod(HashMapImplementation, "forEach$1", HashMapImplementation.prototyp
e.forEach); |
| 811 // ********** Code for HashMapImplementation$E$E ************** | 816 // ********** Code for HashMapImplementation$E$E ************** |
| 812 function HashMapImplementation$E$E() { | 817 function HashMapImplementation$E$E() { |
| 813 // Initializers done | 818 // Initializers done |
| 814 if (HashMapImplementation._deletedKey == null) { | 819 if (HashMapImplementation._deletedKey == null) { |
| 815 HashMapImplementation._deletedKey = new Object(); | 820 HashMapImplementation._deletedKey = new Object(); |
| 816 } | 821 } |
| 817 this._numberOfEntries = 0; | 822 this._numberOfEntries = 0; |
| 818 this._numberOfDeleted = 0; | 823 this._numberOfDeleted = 0; |
| 819 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); | 824 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); |
| 820 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); | 825 this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/); |
| 821 this._values = new ListFactory$E(8/*HashMapImplementation._INITIAL_CAPACITY*/)
; | 826 this._values = new ListFactory$E(8/*HashMapImplementation._INITIAL_CAPACITY*/)
; |
| 822 } | 827 } |
| 823 $inherits(HashMapImplementation$E$E, HashMapImplementation); | 828 $inherits(HashMapImplementation$E$E, HashMapImplementation); |
| 824 HashMapImplementation$E$E._computeLoadLimit = function(capacity) { | 829 HashMapImplementation$E$E._computeLoadLimit = function(capacity) { |
| 825 return $truncdiv((capacity * 3), 4); | 830 return $truncdiv((capacity * 3), 4); |
| 826 } | 831 } |
| 827 HashMapImplementation$E$E._firstProbe = function(hashCode, length) { | 832 HashMapImplementation$E$E._firstProbe = function(hashCode, length) { |
| 828 return hashCode & (length - 1); | 833 return hashCode & (length - 1); |
| 829 } | 834 } |
| 830 HashMapImplementation$E$E._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { | 835 HashMapImplementation$E$E._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { |
| 831 return (currentProbe + numberOfProbes) & (length - 1); | 836 return (currentProbe + numberOfProbes) & (length - 1); |
| 832 } | 837 } |
| 833 HashMapImplementation$E$E.prototype._probeForAdding = function(key) { | 838 HashMapImplementation$E$E.prototype._probeForAdding = function(key) { |
| 834 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length
); | 839 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length
); |
| 835 var numberOfProbes = 1; | 840 var numberOfProbes = 1; |
| 836 var initialHash = hash; | 841 var initialHash = hash; |
| 837 var insertionIndex = -1; | 842 var insertionIndex = -1.000000/*-1*/; |
| 838 while (true) { | 843 while (true) { |
| 839 var existingKey = this._keys.$index(hash); | 844 var existingKey = this._keys.$index(hash); |
| 840 if (existingKey == null) { | 845 if (existingKey == null) { |
| 841 if (insertionIndex < 0) return hash; | 846 if (insertionIndex < 0) return hash; |
| 842 return insertionIndex; | 847 return insertionIndex; |
| 843 } | 848 } |
| 844 else if ($eq(existingKey, key)) { | 849 else if ($eq(existingKey, key)) { |
| 845 return hash; | 850 return hash; |
| 846 } | 851 } |
| 847 else if ((insertionIndex < 0) && (HashMapImplementation._deletedKey === exis
tingKey)) { | 852 else if ((insertionIndex < 0) && (HashMapImplementation._deletedKey === exis
tingKey)) { |
| 848 insertionIndex = hash; | 853 insertionIndex = hash; |
| 849 } | 854 } |
| 850 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); | 855 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); |
| 851 } | 856 } |
| 852 } | 857 } |
| 853 HashMapImplementation$E$E.prototype._probeForLookup = function(key) { | 858 HashMapImplementation$E$E.prototype._probeForLookup = function(key) { |
| 854 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length
); | 859 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length
); |
| 855 var numberOfProbes = 1; | 860 var numberOfProbes = 1; |
| 856 var initialHash = hash; | 861 var initialHash = hash; |
| 857 while (true) { | 862 while (true) { |
| 858 var existingKey = this._keys.$index(hash); | 863 var existingKey = this._keys.$index(hash); |
| 859 if (existingKey == null) return -1; | 864 if (existingKey == null) return -1.000000/*-1*/; |
| 860 if ($eq(existingKey, key)) return hash; | 865 if ($eq(existingKey, key)) return hash; |
| 861 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); | 866 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.l
ength); |
| 862 } | 867 } |
| 863 } | 868 } |
| 864 HashMapImplementation$E$E.prototype._ensureCapacity = function() { | 869 HashMapImplementation$E$E.prototype._ensureCapacity = function() { |
| 865 var newNumberOfEntries = this._numberOfEntries + 1; | 870 var newNumberOfEntries = this._numberOfEntries + 1; |
| 866 if (newNumberOfEntries >= this._loadLimit) { | 871 if (newNumberOfEntries >= this._loadLimit) { |
| 867 this._grow(this._keys.length * 2); | 872 this._grow(this._keys.length * 2); |
| 868 return; | 873 return; |
| 869 } | 874 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 HashMapImplementation$E$E.prototype.getKeys = function() { | 938 HashMapImplementation$E$E.prototype.getKeys = function() { |
| 934 var list = new ListFactory$E(this.get$length()); | 939 var list = new ListFactory$E(this.get$length()); |
| 935 var i = 0; | 940 var i = 0; |
| 936 this.forEach(function _(key, value) { | 941 this.forEach(function _(key, value) { |
| 937 list.$setindex(i++, key); | 942 list.$setindex(i++, key); |
| 938 } | 943 } |
| 939 ); | 944 ); |
| 940 return list; | 945 return list; |
| 941 } | 946 } |
| 942 HashMapImplementation$E$E.prototype.containsKey = function(key) { | 947 HashMapImplementation$E$E.prototype.containsKey = function(key) { |
| 943 return (this._probeForLookup(key) != -1); | 948 return (this._probeForLookup(key) != -1.000000/*-1*/); |
| 944 } | 949 } |
| 945 // ********** Code for HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePa
ir$K$V ************** | 950 // ********** Code for HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePa
ir$K$V ************** |
| 946 function HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V() { | 951 function HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V() { |
| 947 // Initializers done | 952 // Initializers done |
| 948 if (HashMapImplementation._deletedKey == null) { | 953 if (HashMapImplementation._deletedKey == null) { |
| 949 HashMapImplementation._deletedKey = new Object(); | 954 HashMapImplementation._deletedKey = new Object(); |
| 950 } | 955 } |
| 951 this._numberOfEntries = 0; | 956 this._numberOfEntries = 0; |
| 952 this._numberOfDeleted = 0; | 957 this._numberOfDeleted = 0; |
| 953 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); | 958 this._loadLimit = HashMapImplementation._computeLoadLimit(8/*HashMapImplementa
tion._INITIAL_CAPACITY*/); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1053 } | 1058 } |
| 1054 $defineMethod(HashSetImplementation, "forEach$1", HashSetImplementation.prototyp
e.forEach); | 1059 $defineMethod(HashSetImplementation, "forEach$1", HashSetImplementation.prototyp
e.forEach); |
| 1055 // ********** Code for HashSetImplementation$E ************** | 1060 // ********** Code for HashSetImplementation$E ************** |
| 1056 function HashSetImplementation$E() { | 1061 function HashSetImplementation$E() { |
| 1057 // Initializers done | 1062 // Initializers done |
| 1058 this._backingMap = new HashMapImplementation$E$E(); | 1063 this._backingMap = new HashMapImplementation$E$E(); |
| 1059 } | 1064 } |
| 1060 $inherits(HashSetImplementation$E, HashSetImplementation); | 1065 $inherits(HashSetImplementation$E, HashSetImplementation); |
| 1061 // ********** Code for HashSetIterator ************** | 1066 // ********** Code for HashSetIterator ************** |
| 1062 function HashSetIterator(set_) { | 1067 function HashSetIterator(set_) { |
| 1063 this._nextValidIndex = -1; | 1068 this._nextValidIndex = -1.000000/*-1*/; |
| 1064 this._entries = set_._backingMap._keys; | 1069 this._entries = set_._backingMap._keys; |
| 1065 // Initializers done | 1070 // Initializers done |
| 1066 this._advance(); | 1071 this._advance(); |
| 1067 } | 1072 } |
| 1068 HashSetIterator.prototype.hasNext = function() { | 1073 HashSetIterator.prototype.hasNext = function() { |
| 1069 if (this._nextValidIndex >= this._entries.length) return false; | 1074 if (this._nextValidIndex >= this._entries.length) return false; |
| 1070 if (this._entries.$index(this._nextValidIndex) === HashMapImplementation._dele
tedKey) { | 1075 if (this._entries.$index(this._nextValidIndex) === HashMapImplementation._dele
tedKey) { |
| 1071 this._advance(); | 1076 this._advance(); |
| 1072 } | 1077 } |
| 1073 return this._nextValidIndex < this._entries.length; | 1078 return this._nextValidIndex < this._entries.length; |
| 1074 } | 1079 } |
| 1075 HashSetIterator.prototype.next = function() { | 1080 HashSetIterator.prototype.next = function() { |
| 1076 if (!this.hasNext()) { | 1081 if (!this.hasNext()) { |
| 1077 $throw(const$9/*const NoMoreElementsException()*/); | 1082 $throw(const$121/*const NoMoreElementsException()*/); |
| 1078 } | 1083 } |
| 1079 var res = this._entries.$index(this._nextValidIndex); | 1084 var res = this._entries.$index(this._nextValidIndex); |
| 1080 this._advance(); | 1085 this._advance(); |
| 1081 return res; | 1086 return res; |
| 1082 } | 1087 } |
| 1083 HashSetIterator.prototype._advance = function() { | 1088 HashSetIterator.prototype._advance = function() { |
| 1084 var length = this._entries.length; | 1089 var length = this._entries.length; |
| 1085 var entry; | 1090 var entry; |
| 1086 var deletedKey = HashMapImplementation._deletedKey; | 1091 var deletedKey = HashMapImplementation._deletedKey; |
| 1087 do { | 1092 do { |
| 1088 if (++this._nextValidIndex >= length) break; | 1093 if (++this._nextValidIndex >= length) break; |
| 1089 entry = this._entries.$index(this._nextValidIndex); | 1094 entry = this._entries.$index(this._nextValidIndex); |
| 1090 } | 1095 } |
| 1091 while ((entry == null) || (entry === deletedKey)) | 1096 while ((entry == null) || (entry === deletedKey)) |
| 1092 } | 1097 } |
| 1093 // ********** Code for HashSetIterator$E ************** | 1098 // ********** Code for HashSetIterator$E ************** |
| 1094 function HashSetIterator$E(set_) { | 1099 function HashSetIterator$E(set_) { |
| 1095 this._nextValidIndex = -1; | 1100 this._nextValidIndex = -1.000000/*-1*/; |
| 1096 this._entries = set_._backingMap._keys; | 1101 this._entries = set_._backingMap._keys; |
| 1097 // Initializers done | 1102 // Initializers done |
| 1098 this._advance(); | 1103 this._advance(); |
| 1099 } | 1104 } |
| 1100 $inherits(HashSetIterator$E, HashSetIterator); | 1105 $inherits(HashSetIterator$E, HashSetIterator); |
| 1101 HashSetIterator$E.prototype._advance = function() { | 1106 HashSetIterator$E.prototype._advance = function() { |
| 1102 var length = this._entries.length; | 1107 var length = this._entries.length; |
| 1103 var entry; | 1108 var entry; |
| 1104 var deletedKey = HashMapImplementation._deletedKey; | 1109 var deletedKey = HashMapImplementation._deletedKey; |
| 1105 do { | 1110 do { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 function DoubleLinkedQueueEntry$KeyValuePair$String$Keyword() {} | 1293 function DoubleLinkedQueueEntry$KeyValuePair$String$Keyword() {} |
| 1289 $inherits(DoubleLinkedQueueEntry$KeyValuePair$String$Keyword, DoubleLinkedQueueE
ntry); | 1294 $inherits(DoubleLinkedQueueEntry$KeyValuePair$String$Keyword, DoubleLinkedQueueE
ntry); |
| 1290 // ********** Code for _DoubleLinkedQueueEntrySentinel ************** | 1295 // ********** Code for _DoubleLinkedQueueEntrySentinel ************** |
| 1291 function _DoubleLinkedQueueEntrySentinel() { | 1296 function _DoubleLinkedQueueEntrySentinel() { |
| 1292 DoubleLinkedQueueEntry$E.call(this, null); | 1297 DoubleLinkedQueueEntry$E.call(this, null); |
| 1293 // Initializers done | 1298 // Initializers done |
| 1294 this._link(this, this); | 1299 this._link(this, this); |
| 1295 } | 1300 } |
| 1296 $inherits(_DoubleLinkedQueueEntrySentinel, DoubleLinkedQueueEntry$E); | 1301 $inherits(_DoubleLinkedQueueEntrySentinel, DoubleLinkedQueueEntry$E); |
| 1297 _DoubleLinkedQueueEntrySentinel.prototype.remove = function() { | 1302 _DoubleLinkedQueueEntrySentinel.prototype.remove = function() { |
| 1298 $throw(const$10/*const EmptyQueueException()*/); | 1303 $throw(const$122/*const EmptyQueueException()*/); |
| 1299 } | 1304 } |
| 1300 _DoubleLinkedQueueEntrySentinel.prototype._asNonSentinelEntry = function() { | 1305 _DoubleLinkedQueueEntrySentinel.prototype._asNonSentinelEntry = function() { |
| 1301 return null; | 1306 return null; |
| 1302 } | 1307 } |
| 1303 _DoubleLinkedQueueEntrySentinel.prototype.get$element = function() { | 1308 _DoubleLinkedQueueEntrySentinel.prototype.get$element = function() { |
| 1304 $throw(const$10/*const EmptyQueueException()*/); | 1309 $throw(const$122/*const EmptyQueueException()*/); |
| 1305 } | 1310 } |
| 1306 // ********** Code for _DoubleLinkedQueueEntrySentinel$E ************** | 1311 // ********** Code for _DoubleLinkedQueueEntrySentinel$E ************** |
| 1307 function _DoubleLinkedQueueEntrySentinel$E() { | 1312 function _DoubleLinkedQueueEntrySentinel$E() { |
| 1308 DoubleLinkedQueueEntry$E.call(this, null); | 1313 DoubleLinkedQueueEntry$E.call(this, null); |
| 1309 // Initializers done | 1314 // Initializers done |
| 1310 this._link(this, this); | 1315 this._link(this, this); |
| 1311 } | 1316 } |
| 1312 $inherits(_DoubleLinkedQueueEntrySentinel$E, _DoubleLinkedQueueEntrySentinel); | 1317 $inherits(_DoubleLinkedQueueEntrySentinel$E, _DoubleLinkedQueueEntrySentinel); |
| 1313 _DoubleLinkedQueueEntrySentinel$E.prototype._link = function(p, n) { | 1318 _DoubleLinkedQueueEntrySentinel$E.prototype._link = function(p, n) { |
| 1314 this._next = n; | 1319 this._next = n; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1476 function _DoubleLinkedQueueIterator(_sentinel) { | 1481 function _DoubleLinkedQueueIterator(_sentinel) { |
| 1477 this._sentinel = _sentinel; | 1482 this._sentinel = _sentinel; |
| 1478 // Initializers done | 1483 // Initializers done |
| 1479 this._currentEntry = this._sentinel; | 1484 this._currentEntry = this._sentinel; |
| 1480 } | 1485 } |
| 1481 _DoubleLinkedQueueIterator.prototype.hasNext = function() { | 1486 _DoubleLinkedQueueIterator.prototype.hasNext = function() { |
| 1482 return this._currentEntry._next !== this._sentinel; | 1487 return this._currentEntry._next !== this._sentinel; |
| 1483 } | 1488 } |
| 1484 _DoubleLinkedQueueIterator.prototype.next = function() { | 1489 _DoubleLinkedQueueIterator.prototype.next = function() { |
| 1485 if (!this.hasNext()) { | 1490 if (!this.hasNext()) { |
| 1486 $throw(const$9/*const NoMoreElementsException()*/); | 1491 $throw(const$121/*const NoMoreElementsException()*/); |
| 1487 } | 1492 } |
| 1488 this._currentEntry = this._currentEntry._next; | 1493 this._currentEntry = this._currentEntry._next; |
| 1489 return this._currentEntry.get$element(); | 1494 return this._currentEntry.get$element(); |
| 1490 } | 1495 } |
| 1491 // ********** Code for _DoubleLinkedQueueIterator$E ************** | 1496 // ********** Code for _DoubleLinkedQueueIterator$E ************** |
| 1492 function _DoubleLinkedQueueIterator$E(_sentinel) { | 1497 function _DoubleLinkedQueueIterator$E(_sentinel) { |
| 1493 this._sentinel = _sentinel; | 1498 this._sentinel = _sentinel; |
| 1494 // Initializers done | 1499 // Initializers done |
| 1495 this._currentEntry = this._sentinel; | 1500 this._currentEntry = this._sentinel; |
| 1496 } | 1501 } |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1910 if (pieces.length > 0 && $eq(pieces.last(), '.')) { | 1915 if (pieces.length > 0 && $eq(pieces.last(), '.')) { |
| 1911 pieces.removeLast(); | 1916 pieces.removeLast(); |
| 1912 } | 1917 } |
| 1913 pieces.add(piece); | 1918 pieces.add(piece); |
| 1914 } | 1919 } |
| 1915 } | 1920 } |
| 1916 return Strings.join(pieces, '/'); | 1921 return Strings.join(pieces, '/'); |
| 1917 } | 1922 } |
| 1918 function dirname(path) { | 1923 function dirname(path) { |
| 1919 var lastSlash = path.lastIndexOf('/', path.length); | 1924 var lastSlash = path.lastIndexOf('/', path.length); |
| 1920 if (lastSlash == -1) { | 1925 if (lastSlash == -1.000000/*-1*/) { |
| 1921 return '.'; | 1926 return '.'; |
| 1922 } | 1927 } |
| 1923 else { | 1928 else { |
| 1924 return path.substring(0, lastSlash); | 1929 return path.substring(0, lastSlash); |
| 1925 } | 1930 } |
| 1926 } | 1931 } |
| 1927 function basename(path) { | 1932 function basename(path) { |
| 1928 var lastSlash = path.lastIndexOf('/', path.length); | 1933 var lastSlash = path.lastIndexOf('/', path.length); |
| 1929 if (lastSlash == -1) { | 1934 if (lastSlash == -1.000000/*-1*/) { |
| 1930 return path; | 1935 return path; |
| 1931 } | 1936 } |
| 1932 else { | 1937 else { |
| 1933 return path.substring(lastSlash + 1); | 1938 return path.substring(lastSlash + 1); |
| 1934 } | 1939 } |
| 1935 } | 1940 } |
| 1936 // ********** Library file_system_node ************** | 1941 // ********** Library file_system_node ************** |
| 1937 // ********** Code for NodeFileSystem ************** | 1942 // ********** Code for NodeFileSystem ************** |
| 1938 function NodeFileSystem() { | 1943 function NodeFileSystem() { |
| 1939 // Initializers done | 1944 // Initializers done |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1957 } | 1962 } |
| 1958 Keyword.prototype.is$SourceString = function(){return this;}; | 1963 Keyword.prototype.is$SourceString = function(){return this;}; |
| 1959 Keyword.get$keywords = function() { | 1964 Keyword.get$keywords = function() { |
| 1960 if (Keyword._keywords == null) { | 1965 if (Keyword._keywords == null) { |
| 1961 Keyword._keywords = Keyword.computeKeywordMap(); | 1966 Keyword._keywords = Keyword.computeKeywordMap(); |
| 1962 } | 1967 } |
| 1963 return Keyword._keywords; | 1968 return Keyword._keywords; |
| 1964 } | 1969 } |
| 1965 Keyword.computeKeywordMap = function() { | 1970 Keyword.computeKeywordMap = function() { |
| 1966 var result = new LinkedHashMapImplementation$String$Keyword(); | 1971 var result = new LinkedHashMapImplementation$String$Keyword(); |
| 1967 for (var $i = 0;$i < const$326/*Keyword.values*/.length; $i++) { | 1972 for (var $i = 0;$i < const$316/*Keyword.values*/.length; $i++) { |
| 1968 var keyword = const$326/*Keyword.values*/.$index($i); | 1973 var keyword = const$316/*Keyword.values*/.$index($i); |
| 1969 result.$setindex(keyword.syntax, keyword); | 1974 result.$setindex(keyword.syntax, keyword); |
| 1970 } | 1975 } |
| 1971 return result; | 1976 return result; |
| 1972 } | 1977 } |
| 1973 Keyword.prototype.hashCode = function() { | 1978 Keyword.prototype.hashCode = function() { |
| 1974 return this.syntax.hashCode(); | 1979 return this.syntax.hashCode(); |
| 1975 } | 1980 } |
| 1976 Keyword.prototype.$eq = function(other) { | 1981 Keyword.prototype.$eq = function(other) { |
| 1977 return !!(other && other.is$SourceString) && this.toString() == other.toString
(); | 1982 return !!(other && other.is$SourceString) && this.toString() == other.toString
(); |
| 1978 } | 1983 } |
| 1979 Keyword.prototype.toString = function() { | 1984 Keyword.prototype.toString = function() { |
| 1980 return this.syntax; | 1985 return this.syntax; |
| 1981 } | 1986 } |
| 1982 // ********** Code for KeywordState ************** | 1987 // ********** Code for KeywordState ************** |
| 1983 function KeywordState() {} | 1988 function KeywordState() {} |
| 1984 KeywordState.get$KEYWORD_STATE = function() { | 1989 KeywordState.get$KEYWORD_STATE = function() { |
| 1985 if (KeywordState._KEYWORD_STATE == null) { | 1990 if (KeywordState._KEYWORD_STATE == null) { |
| 1986 var strings = new ListFactory$String(const$326/*Keyword.values*/.length); | 1991 var strings = new ListFactory$String(const$316/*Keyword.values*/.length); |
| 1987 for (var i = 0; | 1992 for (var i = 0; |
| 1988 i < const$326/*Keyword.values*/.length; i++) { | 1993 i < const$316/*Keyword.values*/.length; i++) { |
| 1989 strings.$setindex(i, const$326/*Keyword.values*/.$index(i).syntax); | 1994 strings.$setindex(i, const$316/*Keyword.values*/.$index(i).syntax); |
| 1990 } | 1995 } |
| 1991 strings.sort((function (a, b) { | 1996 strings.sort((function (a, b) { |
| 1992 return a.compareTo(b); | 1997 return a.compareTo(b); |
| 1993 }) | 1998 }) |
| 1994 ); | 1999 ); |
| 1995 KeywordState._KEYWORD_STATE = KeywordState.computeKeywordStateTable(0, strin
gs, 0, strings.length); | 2000 KeywordState._KEYWORD_STATE = KeywordState.computeKeywordStateTable(0, strin
gs, 0, strings.length); |
| 1996 } | 2001 } |
| 1997 return KeywordState._KEYWORD_STATE; | 2002 return KeywordState._KEYWORD_STATE; |
| 1998 } | 2003 } |
| 1999 KeywordState.computeKeywordStateTable = function(start, strings, offset, length)
{ | 2004 KeywordState.computeKeywordStateTable = function(start, strings, offset, length)
{ |
| 2000 var result = new ListFactory$KeywordState(26); | 2005 var result = new ListFactory$KeywordState(26); |
| 2001 var chunk = 0; | 2006 var chunk = 0; |
| 2002 var chunkStart = -1; | 2007 var chunkStart = -1.000000/*-1*/; |
| 2003 for (var i = offset; | 2008 for (var i = offset; |
| 2004 i < offset + length; i++) { | 2009 i < offset + length; i++) { |
| 2005 if (strings.$index(i).length > start) { | 2010 if (strings.$index(i).length > start) { |
| 2006 var c = strings.$index(i).charCodeAt(start); | 2011 var c = strings.$index(i).charCodeAt(start); |
| 2007 if (chunk != c) { | 2012 if (chunk != c) { |
| 2008 if (chunkStart != -1) { | 2013 if (chunkStart != -1.000000/*-1*/) { |
| 2009 result.$setindex(chunk - 97/*null.$a*/, KeywordState.computeKeywordSta
teTable(start + 1, strings, chunkStart, i - chunkStart)); | 2014 result.$setindex(chunk - 97/*null.$a*/, KeywordState.computeKeywordSta
teTable(start + 1, strings, chunkStart, i - chunkStart)); |
| 2010 } | 2015 } |
| 2011 chunkStart = i; | 2016 chunkStart = i; |
| 2012 chunk = c; | 2017 chunk = c; |
| 2013 } | 2018 } |
| 2014 } | 2019 } |
| 2015 } | 2020 } |
| 2016 if (chunkStart != -1) { | 2021 if (chunkStart != -1.000000/*-1*/) { |
| 2017 result.$setindex(chunk - 97/*null.$a*/, KeywordState.computeKeywordStateTabl
e(start + 1, strings, chunkStart, offset + length - chunkStart)); | 2022 result.$setindex(chunk - 97/*null.$a*/, KeywordState.computeKeywordStateTabl
e(start + 1, strings, chunkStart, offset + length - chunkStart)); |
| 2018 } | 2023 } |
| 2019 else { | 2024 else { |
| 2020 return new LeafKeywordState(strings.$index(offset)); | 2025 return new LeafKeywordState(strings.$index(offset)); |
| 2021 } | 2026 } |
| 2022 return new ArrayKeywordState(result); | 2027 return new ArrayKeywordState(result); |
| 2023 } | 2028 } |
| 2024 // ********** Code for ArrayKeywordState ************** | 2029 // ********** Code for ArrayKeywordState ************** |
| 2025 function ArrayKeywordState(table) { | 2030 function ArrayKeywordState(table) { |
| 2026 this.table = table; | 2031 this.table = table; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2061 return true; | 2066 return true; |
| 2062 } | 2067 } |
| 2063 LeafKeywordState.prototype.next = function(c) { | 2068 LeafKeywordState.prototype.next = function(c) { |
| 2064 return null; | 2069 return null; |
| 2065 } | 2070 } |
| 2066 LeafKeywordState.prototype.toString = function() { | 2071 LeafKeywordState.prototype.toString = function() { |
| 2067 return this.keyword.syntax; | 2072 return this.keyword.syntax; |
| 2068 } | 2073 } |
| 2069 // ********** Code for ArrayBasedScanner ************** | 2074 // ********** Code for ArrayBasedScanner ************** |
| 2070 function ArrayBasedScanner() { | 2075 function ArrayBasedScanner() { |
| 2071 this.charOffset = -1; | 2076 this.charOffset = -1.000000/*-1*/; |
| 2072 this.tokenStart = -1; | 2077 this.tokenStart = -1.000000/*-1*/; |
| 2073 this.byteOffset = -1; | 2078 this.byteOffset = -1.000000/*-1*/; |
| 2074 this.tokens = new Token(0, -1); | 2079 this.tokens = new scanner_Token(0, -1.000000/*-1*/); |
| 2075 // Initializers done | 2080 // Initializers done |
| 2076 this.tail = this.tokens; | 2081 this.tail = this.tokens; |
| 2077 } | 2082 } |
| 2078 $inherits(ArrayBasedScanner, AbstractScanner$S); | 2083 $inherits(ArrayBasedScanner, AbstractScanner$S); |
| 2079 ArrayBasedScanner.prototype.get$charOffset = function() { return this.charOffset
; }; | 2084 ArrayBasedScanner.prototype.get$charOffset = function() { return this.charOffset
; }; |
| 2080 ArrayBasedScanner.prototype.set$charOffset = function(value) { return this.charO
ffset = value; }; | 2085 ArrayBasedScanner.prototype.set$charOffset = function(value) { return this.charO
ffset = value; }; |
| 2081 ArrayBasedScanner.prototype.get$byteOffset = function() { return this.byteOffset
; }; | 2086 ArrayBasedScanner.prototype.get$byteOffset = function() { return this.byteOffset
; }; |
| 2082 ArrayBasedScanner.prototype.set$byteOffset = function(value) { return this.byteO
ffset = value; }; | 2087 ArrayBasedScanner.prototype.set$byteOffset = function(value) { return this.byteO
ffset = value; }; |
| 2083 ArrayBasedScanner.prototype.advance = function() { | 2088 ArrayBasedScanner.prototype.advance = function() { |
| 2084 var next = this.nextByte(); | 2089 var next = this.nextByte(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 2111 return this.tokens.next; | 2116 return this.tokens.next; |
| 2112 } | 2117 } |
| 2113 ArrayBasedScanner.prototype.addToCharOffset = function(offset) { | 2118 ArrayBasedScanner.prototype.addToCharOffset = function(offset) { |
| 2114 this.charOffset += offset; | 2119 this.charOffset += offset; |
| 2115 } | 2120 } |
| 2116 ArrayBasedScanner.prototype.appendWhiteSpace = function(next) { | 2121 ArrayBasedScanner.prototype.appendWhiteSpace = function(next) { |
| 2117 | 2122 |
| 2118 } | 2123 } |
| 2119 // ********** Code for ArrayBasedScanner$String ************** | 2124 // ********** Code for ArrayBasedScanner$String ************** |
| 2120 function ArrayBasedScanner$String() { | 2125 function ArrayBasedScanner$String() { |
| 2121 this.charOffset = -1; | 2126 this.charOffset = -1.000000/*-1*/; |
| 2122 this.tokenStart = -1; | 2127 this.tokenStart = -1.000000/*-1*/; |
| 2123 this.byteOffset = -1; | 2128 this.byteOffset = -1.000000/*-1*/; |
| 2124 this.tokens = new Token(0, -1); | 2129 this.tokens = new scanner_Token(0, -1.000000/*-1*/); |
| 2125 // Initializers done | 2130 // Initializers done |
| 2126 this.tail = this.tokens; | 2131 this.tail = this.tokens; |
| 2127 } | 2132 } |
| 2128 $inherits(ArrayBasedScanner$String, ArrayBasedScanner); | 2133 $inherits(ArrayBasedScanner$String, ArrayBasedScanner); |
| 2129 ArrayBasedScanner$String.prototype.advance = function() { | 2134 ArrayBasedScanner$String.prototype.advance = function() { |
| 2130 var next = this.nextByte(); | 2135 var next = this.nextByte(); |
| 2131 this.charOffset++; | 2136 this.charOffset++; |
| 2132 return next; | 2137 return next; |
| 2133 } | 2138 } |
| 2134 ArrayBasedScanner$String.prototype.select = function(choice, yes, no) { | 2139 ArrayBasedScanner$String.prototype.select = function(choice, yes, no) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 2157 return this.tokens.next; | 2162 return this.tokens.next; |
| 2158 } | 2163 } |
| 2159 ArrayBasedScanner$String.prototype.addToCharOffset = function(offset) { | 2164 ArrayBasedScanner$String.prototype.addToCharOffset = function(offset) { |
| 2160 this.charOffset += offset; | 2165 this.charOffset += offset; |
| 2161 } | 2166 } |
| 2162 ArrayBasedScanner$String.prototype.appendWhiteSpace = function(next) { | 2167 ArrayBasedScanner$String.prototype.appendWhiteSpace = function(next) { |
| 2163 | 2168 |
| 2164 } | 2169 } |
| 2165 ArrayBasedScanner$String.prototype.tokenize = function() { | 2170 ArrayBasedScanner$String.prototype.tokenize = function() { |
| 2166 var next = this.advance(); | 2171 var next = this.advance(); |
| 2167 while (next != -1) { | 2172 while (next != -1.000000/*-1*/) { |
| 2168 next = this.bigSwitch(next); | 2173 next = this.bigSwitch(next); |
| 2169 } | 2174 } |
| 2170 return this.firstToken(); | 2175 return this.firstToken(); |
| 2171 } | 2176 } |
| 2172 ArrayBasedScanner$String.prototype.bigSwitch = function(next) { | 2177 ArrayBasedScanner$String.prototype.bigSwitch = function(next) { |
| 2173 this.beginToken(); | 2178 this.beginToken(); |
| 2174 switch (next) { | 2179 switch (next) { |
| 2175 case 9/*null.$TAB*/: | 2180 case 9/*null.$TAB*/: |
| 2176 case 10/*null.$LF*/: | 2181 case 10/*null.$LF*/: |
| 2177 case 13/*null.$CR*/: | 2182 case 13/*null.$CR*/: |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2376 case 118/*null.$v*/: | 2381 case 118/*null.$v*/: |
| 2377 case 119/*null.$w*/: | 2382 case 119/*null.$w*/: |
| 2378 case 120/*null.$x*/: | 2383 case 120/*null.$x*/: |
| 2379 case 121/*null.$y*/: | 2384 case 121/*null.$y*/: |
| 2380 case 122/*null.$z*/: | 2385 case 122/*null.$z*/: |
| 2381 | 2386 |
| 2382 return this.tokenizeIdentifier(next); | 2387 return this.tokenizeIdentifier(next); |
| 2383 | 2388 |
| 2384 default: | 2389 default: |
| 2385 | 2390 |
| 2386 if (next == -1) { | 2391 if (next == -1.000000/*-1*/) { |
| 2387 return -1; | 2392 return -1.000000/*-1*/; |
| 2388 } | 2393 } |
| 2389 if (next < 0x1f) { | 2394 if (next < 0x1f) { |
| 2390 $throw(this.charOffset); | 2395 $throw(this.charOffset); |
| 2391 $throw(new MalformedInputException(this.charOffset)); | 2396 $throw(new MalformedInputException(this.charOffset)); |
| 2392 } | 2397 } |
| 2393 return this.tokenizeIdentifier(next); | 2398 return this.tokenizeIdentifier(next); |
| 2394 | 2399 |
| 2395 } | 2400 } |
| 2396 } | 2401 } |
| 2397 ArrayBasedScanner$String.prototype.tokenizeTag = function(next) { | 2402 ArrayBasedScanner$String.prototype.tokenizeTag = function(next) { |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2552 case 62/*null.$GT*/: | 2557 case 62/*null.$GT*/: |
| 2553 | 2558 |
| 2554 return this.select(61/*null.$EQ*/, ">>>=", ">>>"); | 2559 return this.select(61/*null.$EQ*/, ">>>=", ">>>"); |
| 2555 | 2560 |
| 2556 default: | 2561 default: |
| 2557 | 2562 |
| 2558 this.appendStringToken(62/*null.$GT*/, ">>"); | 2563 this.appendStringToken(62/*null.$GT*/, ">>"); |
| 2559 return next; | 2564 return next; |
| 2560 | 2565 |
| 2561 } | 2566 } |
| 2567 $throw(new FallThroughError("leg/scanner/scanner.dart", 389)) |
| 2562 | 2568 |
| 2563 default: | 2569 default: |
| 2564 | 2570 |
| 2565 this.appendStringToken(62/*null.$GT*/, ">"); | 2571 this.appendStringToken(62/*null.$GT*/, ">"); |
| 2566 return next; | 2572 return next; |
| 2567 | 2573 |
| 2568 } | 2574 } |
| 2569 } | 2575 } |
| 2570 ArrayBasedScanner$String.prototype.tokenizeLessThan = function(next) { | 2576 ArrayBasedScanner$String.prototype.tokenizeLessThan = function(next) { |
| 2571 next = this.advance(); | 2577 next = this.advance(); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2795 | 2801 |
| 2796 this.appendStringToken(47/*null.$SLASH*/, "/"); | 2802 this.appendStringToken(47/*null.$SLASH*/, "/"); |
| 2797 return next; | 2803 return next; |
| 2798 | 2804 |
| 2799 } | 2805 } |
| 2800 } | 2806 } |
| 2801 ArrayBasedScanner$String.prototype.tokenizeSingleLineComment = function(next) { | 2807 ArrayBasedScanner$String.prototype.tokenizeSingleLineComment = function(next) { |
| 2802 while (true) { | 2808 while (true) { |
| 2803 next = this.advance(); | 2809 next = this.advance(); |
| 2804 switch (next) { | 2810 switch (next) { |
| 2805 case -1: | 2811 case -1.000000/*-1*/: |
| 2806 case 10/*null.$LF*/: | 2812 case 10/*null.$LF*/: |
| 2807 case 13/*null.$CR*/: | 2813 case 13/*null.$CR*/: |
| 2808 | 2814 |
| 2809 return next; | 2815 return next; |
| 2810 | 2816 |
| 2811 } | 2817 } |
| 2812 } | 2818 } |
| 2813 } | 2819 } |
| 2814 ArrayBasedScanner$String.prototype.tokenizeMultiLineComment = function(next) { | 2820 ArrayBasedScanner$String.prototype.tokenizeMultiLineComment = function(next) { |
| 2815 next = this.advance(); | 2821 next = this.advance(); |
| 2816 while (true) { | 2822 while (true) { |
| 2817 switch (next) { | 2823 switch (next) { |
| 2818 case -1: | 2824 case -1.000000/*-1*/: |
| 2819 | 2825 |
| 2820 return next; | 2826 return next; |
| 2821 | 2827 |
| 2822 case 42/*null.$STAR*/: | 2828 case 42/*null.$STAR*/: |
| 2823 | 2829 |
| 2824 next = this.advance(); | 2830 next = this.advance(); |
| 2825 if (next == 47/*null.$SLASH*/) { | 2831 if (next == 47/*null.$SLASH*/) { |
| 2826 return this.advance(); | 2832 return this.advance(); |
| 2827 } | 2833 } |
| 2828 else if (next == -1) { | 2834 else if (next == -1.000000/*-1*/) { |
| 2829 return next; | 2835 return next; |
| 2830 } | 2836 } |
| 2831 break; | 2837 break; |
| 2832 | 2838 |
| 2833 default: | 2839 default: |
| 2834 | 2840 |
| 2835 next = this.advance(); | 2841 next = this.advance(); |
| 2836 break; | 2842 break; |
| 2837 | 2843 |
| 2838 } | 2844 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2856 state = null; | 2862 state = null; |
| 2857 } | 2863 } |
| 2858 else if (next < 128) { | 2864 else if (next < 128) { |
| 2859 if (state != null && state.isLeaf()) { | 2865 if (state != null && state.isLeaf()) { |
| 2860 this.appendKeywordToken(state.get$keyword()); | 2866 this.appendKeywordToken(state.get$keyword()); |
| 2861 } | 2867 } |
| 2862 else if (isAscii) { | 2868 else if (isAscii) { |
| 2863 this.appendByteStringToken(97/*null.$a*/, this.asciiString(start)); | 2869 this.appendByteStringToken(97/*null.$a*/, this.asciiString(start)); |
| 2864 } | 2870 } |
| 2865 else { | 2871 else { |
| 2866 this.appendByteStringToken(97/*null.$a*/, this.utf8String(start, -1)); | 2872 this.appendByteStringToken(97/*null.$a*/, this.utf8String(start, -1.0000
00/*-1*/)); |
| 2867 } | 2873 } |
| 2868 return next; | 2874 return next; |
| 2869 } | 2875 } |
| 2870 else { | 2876 else { |
| 2871 var nonAsciiStart = this.byteOffset; | 2877 var nonAsciiStart = this.byteOffset; |
| 2872 do { | 2878 do { |
| 2873 next = this.nextByte(); | 2879 next = this.nextByte(); |
| 2874 } | 2880 } |
| 2875 while (next > 127) | 2881 while (next > 127) |
| 2876 var string = this.utf8String(nonAsciiStart, -1).toString(); | 2882 var string = this.utf8String(nonAsciiStart, -1.000000/*-1*/).toString(); |
| 2877 isAscii = false; | 2883 isAscii = false; |
| 2878 this.addToCharOffset(string.length); | 2884 this.addToCharOffset(string.length); |
| 2879 return next; | 2885 return next; |
| 2880 } | 2886 } |
| 2881 next = this.advance(); | 2887 next = this.advance(); |
| 2882 } | 2888 } |
| 2883 } | 2889 } |
| 2884 ArrayBasedScanner$String.prototype.tokenizeRawString = function(next) { | 2890 ArrayBasedScanner$String.prototype.tokenizeRawString = function(next) { |
| 2885 var start = this.byteOffset; | 2891 var start = this.byteOffset; |
| 2886 next = this.advance(); | 2892 next = this.advance(); |
| 2887 if (next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/) { | 2893 if (next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/) { |
| 2888 return this.tokenizeString(next, start, true); | 2894 return this.tokenizeString(next, start, true); |
| 2889 } | 2895 } |
| 2890 else { | 2896 else { |
| 2891 $throw(new MalformedInputException(this.charOffset)); | 2897 $throw(new MalformedInputException(this.charOffset)); |
| 2892 } | 2898 } |
| 2893 } | 2899 } |
| 2894 ArrayBasedScanner$String.prototype.tokenizeString = function(next, start, raw) { | 2900 ArrayBasedScanner$String.prototype.tokenizeString = function(next, start, raw) { |
| 2895 var q = next; | 2901 var q = next; |
| 2896 next = this.advance(); | 2902 next = this.advance(); |
| 2897 if (q == next) { | 2903 if (q == next) { |
| 2898 next = this.advance(); | 2904 next = this.advance(); |
| 2899 if (q == next) { | 2905 if (q == next) { |
| 2900 return this.tokenizeMultiLineString(q, start, raw); | 2906 return this.tokenizeMultiLineString(q, start, raw); |
| 2901 } | 2907 } |
| 2902 else { | 2908 else { |
| 2903 this.appendByteStringToken(q, this.utf8String(start, -1)); | 2909 this.appendByteStringToken(q, this.utf8String(start, -1.000000/*-1*/)); |
| 2904 return next; | 2910 return next; |
| 2905 } | 2911 } |
| 2906 } | 2912 } |
| 2907 if (raw) { | 2913 if (raw) { |
| 2908 return this.tokenizeSingleLineRawString(next, q, start); | 2914 return this.tokenizeSingleLineRawString(next, q, start); |
| 2909 } | 2915 } |
| 2910 else { | 2916 else { |
| 2911 return this.tokenizeSingleLineString(next, q, start); | 2917 return this.tokenizeSingleLineString(next, q, start); |
| 2912 } | 2918 } |
| 2913 } | 2919 } |
| 2914 ArrayBasedScanner$String.prototype.tokenizeSingleLineString = function(next, q1,
start) { | 2920 ArrayBasedScanner$String.prototype.tokenizeSingleLineString = function(next, q1,
start) { |
| 2915 while (next != -1) { | 2921 while (next != -1.000000/*-1*/) { |
| 2916 if (next == q1) { | 2922 if (next == q1) { |
| 2917 this.appendByteStringToken(q1, this.utf8String(start, 0)); | 2923 this.appendByteStringToken(q1, this.utf8String(start, 0)); |
| 2918 return this.advance(); | 2924 return this.advance(); |
| 2919 } | 2925 } |
| 2920 else if (next == 92/*null.$BACKSLASH*/) { | 2926 else if (next == 92/*null.$BACKSLASH*/) { |
| 2921 next = this.advance(); | 2927 next = this.advance(); |
| 2922 if (next == -1) { | 2928 if (next == -1.000000/*-1*/) { |
| 2923 $throw(new MalformedInputException(this.charOffset)); | 2929 $throw(new MalformedInputException(this.charOffset)); |
| 2924 } | 2930 } |
| 2925 } | 2931 } |
| 2926 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { | 2932 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { |
| 2927 $throw(new MalformedInputException(this.charOffset)); | 2933 $throw(new MalformedInputException(this.charOffset)); |
| 2928 } | 2934 } |
| 2929 next = this.advance(); | 2935 next = this.advance(); |
| 2930 } | 2936 } |
| 2931 $throw(new MalformedInputException(this.charOffset)); | 2937 $throw(new MalformedInputException(this.charOffset)); |
| 2932 } | 2938 } |
| 2933 ArrayBasedScanner$String.prototype.tokenizeSingleLineRawString = function(next,
q1, start) { | 2939 ArrayBasedScanner$String.prototype.tokenizeSingleLineRawString = function(next,
q1, start) { |
| 2934 next = this.advance(); | 2940 next = this.advance(); |
| 2935 while (next != -1) { | 2941 while (next != -1.000000/*-1*/) { |
| 2936 if (next == q1) { | 2942 if (next == q1) { |
| 2937 this.appendByteStringToken(q1, this.utf8String(start, 0)); | 2943 this.appendByteStringToken(q1, this.utf8String(start, 0)); |
| 2938 return this.advance(); | 2944 return this.advance(); |
| 2939 } | 2945 } |
| 2940 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { | 2946 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { |
| 2941 $throw(new MalformedInputException(this.charOffset)); | 2947 $throw(new MalformedInputException(this.charOffset)); |
| 2942 } | 2948 } |
| 2943 next = this.advance(); | 2949 next = this.advance(); |
| 2944 } | 2950 } |
| 2945 $throw(new MalformedInputException(this.charOffset)); | 2951 $throw(new MalformedInputException(this.charOffset)); |
| 2946 } | 2952 } |
| 2947 ArrayBasedScanner$String.prototype.tokenizeMultiLineString = function(q, start,
raw) { | 2953 ArrayBasedScanner$String.prototype.tokenizeMultiLineString = function(q, start,
raw) { |
| 2948 var next = this.advance(); | 2954 var next = this.advance(); |
| 2949 while (next != -1) { | 2955 while (next != -1.000000/*-1*/) { |
| 2950 if (next == q) { | 2956 if (next == q) { |
| 2951 next = this.advance(); | 2957 next = this.advance(); |
| 2952 if (next == q) { | 2958 if (next == q) { |
| 2953 next = this.advance(); | 2959 next = this.advance(); |
| 2954 if (next == q) { | 2960 if (next == q) { |
| 2955 this.appendByteStringToken(q, this.utf8String(start, 0)); | 2961 this.appendByteStringToken(q, this.utf8String(start, 0)); |
| 2956 return this.advance(); | 2962 return this.advance(); |
| 2957 } | 2963 } |
| 2958 } | 2964 } |
| 2959 } | 2965 } |
| 2960 next = this.advance(); | 2966 next = this.advance(); |
| 2961 } | 2967 } |
| 2962 return next; | 2968 return next; |
| 2963 } | 2969 } |
| 2964 // ********** Code for top level ************** | 2970 // ********** Code for top level ************** |
| 2965 // ********** Library util_implementation ************** | 2971 // ********** Library util_implementation ************** |
| 2966 // ********** Code for LinkFactory ************** | 2972 // ********** Code for LinkFactory ************** |
| 2967 function LinkFactory() {} | 2973 function LinkFactory() {} |
| 2968 LinkFactory.Link$factory = function(head, tail) { | 2974 LinkFactory.Link$factory = function(head, tail) { |
| 2969 return new LinkEntry(head, (tail == null) ? const$328/*const LinkTail()*/ : ta
il); | 2975 return new LinkEntry(head, (tail == null) ? const$318/*const LinkTail()*/ : ta
il); |
| 2970 } | 2976 } |
| 2971 LinkFactory.Link$fromList$factory = function(list) { | 2977 LinkFactory.Link$fromList$factory = function(list) { |
| 2972 switch (list.length) { | 2978 switch (list.length) { |
| 2973 case 0: | 2979 case 0: |
| 2974 | 2980 |
| 2975 return const$328/*const LinkTail()*/; | 2981 return const$318/*const LinkTail()*/; |
| 2976 | 2982 |
| 2977 case 1: | 2983 case 1: |
| 2978 | 2984 |
| 2979 return LinkFactory.Link$factory(list.$index(0)); | 2985 return LinkFactory.Link$factory(list.$index(0)); |
| 2980 | 2986 |
| 2981 case 2: | 2987 case 2: |
| 2982 | 2988 |
| 2983 return LinkFactory.Link$factory(list.$index(0), LinkFactory.Link$factory(l
ist.$index(1))); | 2989 return LinkFactory.Link$factory(list.$index(0), LinkFactory.Link$factory(l
ist.$index(1))); |
| 2984 | 2990 |
| 2985 case 3: | 2991 case 3: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 3016 // Initializers done | 3022 // Initializers done |
| 3017 } | 3023 } |
| 3018 $inherits(LinkTail, AbstractLink$T); | 3024 $inherits(LinkTail, AbstractLink$T); |
| 3019 LinkTail.prototype.get$head = function() { | 3025 LinkTail.prototype.get$head = function() { |
| 3020 return null; | 3026 return null; |
| 3021 } | 3027 } |
| 3022 LinkTail.prototype.get$tail = function() { | 3028 LinkTail.prototype.get$tail = function() { |
| 3023 return null; | 3029 return null; |
| 3024 } | 3030 } |
| 3025 LinkTail.prototype.toList = function() { | 3031 LinkTail.prototype.toList = function() { |
| 3026 return const$8/*const <HInstruction>[]*/; | 3032 return const$120/*const <HInstruction>[]*/; |
| 3027 } | 3033 } |
| 3028 LinkTail.prototype.isEmpty = function() { | 3034 LinkTail.prototype.isEmpty = function() { |
| 3029 return true; | 3035 return true; |
| 3030 } | 3036 } |
| 3031 // ********** Code for LinkEntry ************** | 3037 // ********** Code for LinkEntry ************** |
| 3032 function LinkEntry(head, realTail) { | 3038 function LinkEntry(head, realTail) { |
| 3033 this.head = head; | 3039 this.head = head; |
| 3034 this.realTail = realTail; | 3040 this.realTail = realTail; |
| 3035 // Initializers done | 3041 // Initializers done |
| 3036 } | 3042 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 3064 Element.prototype.get$name = function() { return this.name; }; | 3070 Element.prototype.get$name = function() { return this.name; }; |
| 3065 Element.prototype.hashCode = function() { | 3071 Element.prototype.hashCode = function() { |
| 3066 return this.name.hashCode(); | 3072 return this.name.hashCode(); |
| 3067 } | 3073 } |
| 3068 // ********** Code for top level ************** | 3074 // ********** Code for top level ************** |
| 3069 // ********** Library scanner ************** | 3075 // ********** Library scanner ************** |
| 3070 // ********** Code for AbstractScanner ************** | 3076 // ********** Code for AbstractScanner ************** |
| 3071 function AbstractScanner() {} | 3077 function AbstractScanner() {} |
| 3072 AbstractScanner.prototype.tokenize = function() { | 3078 AbstractScanner.prototype.tokenize = function() { |
| 3073 var next = this.advance(); | 3079 var next = this.advance(); |
| 3074 while (next != -1) { | 3080 while (next != -1.000000/*-1*/) { |
| 3075 next = this.bigSwitch(next); | 3081 next = this.bigSwitch(next); |
| 3076 } | 3082 } |
| 3077 return this.firstToken(); | 3083 return this.firstToken(); |
| 3078 } | 3084 } |
| 3079 AbstractScanner.prototype.bigSwitch = function(next) { | 3085 AbstractScanner.prototype.bigSwitch = function(next) { |
| 3080 this.beginToken(); | 3086 this.beginToken(); |
| 3081 switch (next) { | 3087 switch (next) { |
| 3082 case 9/*null.$TAB*/: | 3088 case 9/*null.$TAB*/: |
| 3083 case 10/*null.$LF*/: | 3089 case 10/*null.$LF*/: |
| 3084 case 13/*null.$CR*/: | 3090 case 13/*null.$CR*/: |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3283 case 118/*null.$v*/: | 3289 case 118/*null.$v*/: |
| 3284 case 119/*null.$w*/: | 3290 case 119/*null.$w*/: |
| 3285 case 120/*null.$x*/: | 3291 case 120/*null.$x*/: |
| 3286 case 121/*null.$y*/: | 3292 case 121/*null.$y*/: |
| 3287 case 122/*null.$z*/: | 3293 case 122/*null.$z*/: |
| 3288 | 3294 |
| 3289 return this.tokenizeIdentifier(next); | 3295 return this.tokenizeIdentifier(next); |
| 3290 | 3296 |
| 3291 default: | 3297 default: |
| 3292 | 3298 |
| 3293 if (next == -1) { | 3299 if (next == -1.000000/*-1*/) { |
| 3294 return -1; | 3300 return -1.000000/*-1*/; |
| 3295 } | 3301 } |
| 3296 if (next < 0x1f) { | 3302 if (next < 0x1f) { |
| 3297 $throw(this.get$charOffset()); | 3303 $throw(this.get$charOffset()); |
| 3298 $throw(new MalformedInputException(this.get$charOffset())); | 3304 $throw(new MalformedInputException(this.get$charOffset())); |
| 3299 } | 3305 } |
| 3300 return this.tokenizeIdentifier(next); | 3306 return this.tokenizeIdentifier(next); |
| 3301 | 3307 |
| 3302 } | 3308 } |
| 3303 } | 3309 } |
| 3304 AbstractScanner.prototype.tokenizeTag = function(next) { | 3310 AbstractScanner.prototype.tokenizeTag = function(next) { |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3459 case 62/*null.$GT*/: | 3465 case 62/*null.$GT*/: |
| 3460 | 3466 |
| 3461 return this.select(61/*null.$EQ*/, ">>>=", ">>>"); | 3467 return this.select(61/*null.$EQ*/, ">>>=", ">>>"); |
| 3462 | 3468 |
| 3463 default: | 3469 default: |
| 3464 | 3470 |
| 3465 this.appendStringToken(62/*null.$GT*/, ">>"); | 3471 this.appendStringToken(62/*null.$GT*/, ">>"); |
| 3466 return next; | 3472 return next; |
| 3467 | 3473 |
| 3468 } | 3474 } |
| 3475 $throw(new FallThroughError("leg/scanner/scanner.dart", 389)) |
| 3469 | 3476 |
| 3470 default: | 3477 default: |
| 3471 | 3478 |
| 3472 this.appendStringToken(62/*null.$GT*/, ">"); | 3479 this.appendStringToken(62/*null.$GT*/, ">"); |
| 3473 return next; | 3480 return next; |
| 3474 | 3481 |
| 3475 } | 3482 } |
| 3476 } | 3483 } |
| 3477 AbstractScanner.prototype.tokenizeLessThan = function(next) { | 3484 AbstractScanner.prototype.tokenizeLessThan = function(next) { |
| 3478 next = this.advance(); | 3485 next = this.advance(); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3702 | 3709 |
| 3703 this.appendStringToken(47/*null.$SLASH*/, "/"); | 3710 this.appendStringToken(47/*null.$SLASH*/, "/"); |
| 3704 return next; | 3711 return next; |
| 3705 | 3712 |
| 3706 } | 3713 } |
| 3707 } | 3714 } |
| 3708 AbstractScanner.prototype.tokenizeSingleLineComment = function(next) { | 3715 AbstractScanner.prototype.tokenizeSingleLineComment = function(next) { |
| 3709 while (true) { | 3716 while (true) { |
| 3710 next = this.advance(); | 3717 next = this.advance(); |
| 3711 switch (next) { | 3718 switch (next) { |
| 3712 case -1: | 3719 case -1.000000/*-1*/: |
| 3713 case 10/*null.$LF*/: | 3720 case 10/*null.$LF*/: |
| 3714 case 13/*null.$CR*/: | 3721 case 13/*null.$CR*/: |
| 3715 | 3722 |
| 3716 return next; | 3723 return next; |
| 3717 | 3724 |
| 3718 } | 3725 } |
| 3719 } | 3726 } |
| 3720 } | 3727 } |
| 3721 AbstractScanner.prototype.tokenizeMultiLineComment = function(next) { | 3728 AbstractScanner.prototype.tokenizeMultiLineComment = function(next) { |
| 3722 next = this.advance(); | 3729 next = this.advance(); |
| 3723 while (true) { | 3730 while (true) { |
| 3724 switch (next) { | 3731 switch (next) { |
| 3725 case -1: | 3732 case -1.000000/*-1*/: |
| 3726 | 3733 |
| 3727 return next; | 3734 return next; |
| 3728 | 3735 |
| 3729 case 42/*null.$STAR*/: | 3736 case 42/*null.$STAR*/: |
| 3730 | 3737 |
| 3731 next = this.advance(); | 3738 next = this.advance(); |
| 3732 if (next == 47/*null.$SLASH*/) { | 3739 if (next == 47/*null.$SLASH*/) { |
| 3733 return this.advance(); | 3740 return this.advance(); |
| 3734 } | 3741 } |
| 3735 else if (next == -1) { | 3742 else if (next == -1.000000/*-1*/) { |
| 3736 return next; | 3743 return next; |
| 3737 } | 3744 } |
| 3738 break; | 3745 break; |
| 3739 | 3746 |
| 3740 default: | 3747 default: |
| 3741 | 3748 |
| 3742 next = this.advance(); | 3749 next = this.advance(); |
| 3743 break; | 3750 break; |
| 3744 | 3751 |
| 3745 } | 3752 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 3763 state = null; | 3770 state = null; |
| 3764 } | 3771 } |
| 3765 else if (next < 128) { | 3772 else if (next < 128) { |
| 3766 if (state != null && state.isLeaf()) { | 3773 if (state != null && state.isLeaf()) { |
| 3767 this.appendKeywordToken(state.get$keyword()); | 3774 this.appendKeywordToken(state.get$keyword()); |
| 3768 } | 3775 } |
| 3769 else if (isAscii) { | 3776 else if (isAscii) { |
| 3770 this.appendByteStringToken(97/*null.$a*/, this.asciiString(start)); | 3777 this.appendByteStringToken(97/*null.$a*/, this.asciiString(start)); |
| 3771 } | 3778 } |
| 3772 else { | 3779 else { |
| 3773 this.appendByteStringToken(97/*null.$a*/, this.utf8String(start, -1)); | 3780 this.appendByteStringToken(97/*null.$a*/, this.utf8String(start, -1.0000
00/*-1*/)); |
| 3774 } | 3781 } |
| 3775 return next; | 3782 return next; |
| 3776 } | 3783 } |
| 3777 else { | 3784 else { |
| 3778 var nonAsciiStart = this.get$byteOffset(); | 3785 var nonAsciiStart = this.get$byteOffset(); |
| 3779 do { | 3786 do { |
| 3780 next = this.nextByte(); | 3787 next = this.nextByte(); |
| 3781 } | 3788 } |
| 3782 while (next > 127) | 3789 while (next > 127) |
| 3783 var string = this.utf8String(nonAsciiStart, -1).toString(); | 3790 var string = this.utf8String(nonAsciiStart, -1.000000/*-1*/).toString(); |
| 3784 isAscii = false; | 3791 isAscii = false; |
| 3785 this.addToCharOffset(string.length); | 3792 this.addToCharOffset(string.length); |
| 3786 return next; | 3793 return next; |
| 3787 } | 3794 } |
| 3788 next = this.advance(); | 3795 next = this.advance(); |
| 3789 } | 3796 } |
| 3790 } | 3797 } |
| 3791 AbstractScanner.prototype.tokenizeRawString = function(next) { | 3798 AbstractScanner.prototype.tokenizeRawString = function(next) { |
| 3792 var start = this.get$byteOffset(); | 3799 var start = this.get$byteOffset(); |
| 3793 next = this.advance(); | 3800 next = this.advance(); |
| 3794 if (next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/) { | 3801 if (next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/) { |
| 3795 return this.tokenizeString(next, start, true); | 3802 return this.tokenizeString(next, start, true); |
| 3796 } | 3803 } |
| 3797 else { | 3804 else { |
| 3798 $throw(new MalformedInputException(this.get$charOffset())); | 3805 $throw(new MalformedInputException(this.get$charOffset())); |
| 3799 } | 3806 } |
| 3800 } | 3807 } |
| 3801 AbstractScanner.prototype.tokenizeString = function(next, start, raw) { | 3808 AbstractScanner.prototype.tokenizeString = function(next, start, raw) { |
| 3802 var q = next; | 3809 var q = next; |
| 3803 next = this.advance(); | 3810 next = this.advance(); |
| 3804 if (q == next) { | 3811 if (q == next) { |
| 3805 next = this.advance(); | 3812 next = this.advance(); |
| 3806 if (q == next) { | 3813 if (q == next) { |
| 3807 return this.tokenizeMultiLineString(q, start, raw); | 3814 return this.tokenizeMultiLineString(q, start, raw); |
| 3808 } | 3815 } |
| 3809 else { | 3816 else { |
| 3810 this.appendByteStringToken(q, this.utf8String(start, -1)); | 3817 this.appendByteStringToken(q, this.utf8String(start, -1.000000/*-1*/)); |
| 3811 return next; | 3818 return next; |
| 3812 } | 3819 } |
| 3813 } | 3820 } |
| 3814 if (raw) { | 3821 if (raw) { |
| 3815 return this.tokenizeSingleLineRawString(next, q, start); | 3822 return this.tokenizeSingleLineRawString(next, q, start); |
| 3816 } | 3823 } |
| 3817 else { | 3824 else { |
| 3818 return this.tokenizeSingleLineString(next, q, start); | 3825 return this.tokenizeSingleLineString(next, q, start); |
| 3819 } | 3826 } |
| 3820 } | 3827 } |
| 3821 AbstractScanner.prototype.tokenizeSingleLineString = function(next, q1, start) { | 3828 AbstractScanner.prototype.tokenizeSingleLineString = function(next, q1, start) { |
| 3822 while (next != -1) { | 3829 while (next != -1.000000/*-1*/) { |
| 3823 if (next == q1) { | 3830 if (next == q1) { |
| 3824 this.appendByteStringToken(q1, this.utf8String(start, 0)); | 3831 this.appendByteStringToken(q1, this.utf8String(start, 0)); |
| 3825 return this.advance(); | 3832 return this.advance(); |
| 3826 } | 3833 } |
| 3827 else if (next == 92/*null.$BACKSLASH*/) { | 3834 else if (next == 92/*null.$BACKSLASH*/) { |
| 3828 next = this.advance(); | 3835 next = this.advance(); |
| 3829 if (next == -1) { | 3836 if (next == -1.000000/*-1*/) { |
| 3830 $throw(new MalformedInputException(this.get$charOffset())); | 3837 $throw(new MalformedInputException(this.get$charOffset())); |
| 3831 } | 3838 } |
| 3832 } | 3839 } |
| 3833 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { | 3840 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { |
| 3834 $throw(new MalformedInputException(this.get$charOffset())); | 3841 $throw(new MalformedInputException(this.get$charOffset())); |
| 3835 } | 3842 } |
| 3836 next = this.advance(); | 3843 next = this.advance(); |
| 3837 } | 3844 } |
| 3838 $throw(new MalformedInputException(this.get$charOffset())); | 3845 $throw(new MalformedInputException(this.get$charOffset())); |
| 3839 } | 3846 } |
| 3840 AbstractScanner.prototype.tokenizeSingleLineRawString = function(next, q1, start
) { | 3847 AbstractScanner.prototype.tokenizeSingleLineRawString = function(next, q1, start
) { |
| 3841 next = this.advance(); | 3848 next = this.advance(); |
| 3842 while (next != -1) { | 3849 while (next != -1.000000/*-1*/) { |
| 3843 if (next == q1) { | 3850 if (next == q1) { |
| 3844 this.appendByteStringToken(q1, this.utf8String(start, 0)); | 3851 this.appendByteStringToken(q1, this.utf8String(start, 0)); |
| 3845 return this.advance(); | 3852 return this.advance(); |
| 3846 } | 3853 } |
| 3847 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { | 3854 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { |
| 3848 $throw(new MalformedInputException(this.get$charOffset())); | 3855 $throw(new MalformedInputException(this.get$charOffset())); |
| 3849 } | 3856 } |
| 3850 next = this.advance(); | 3857 next = this.advance(); |
| 3851 } | 3858 } |
| 3852 $throw(new MalformedInputException(this.get$charOffset())); | 3859 $throw(new MalformedInputException(this.get$charOffset())); |
| 3853 } | 3860 } |
| 3854 AbstractScanner.prototype.tokenizeMultiLineString = function(q, start, raw) { | 3861 AbstractScanner.prototype.tokenizeMultiLineString = function(q, start, raw) { |
| 3855 var next = this.advance(); | 3862 var next = this.advance(); |
| 3856 while (next != -1) { | 3863 while (next != -1.000000/*-1*/) { |
| 3857 if (next == q) { | 3864 if (next == q) { |
| 3858 next = this.advance(); | 3865 next = this.advance(); |
| 3859 if (next == q) { | 3866 if (next == q) { |
| 3860 next = this.advance(); | 3867 next = this.advance(); |
| 3861 if (next == q) { | 3868 if (next == q) { |
| 3862 this.appendByteStringToken(q, this.utf8String(start, 0)); | 3869 this.appendByteStringToken(q, this.utf8String(start, 0)); |
| 3863 return this.advance(); | 3870 return this.advance(); |
| 3864 } | 3871 } |
| 3865 } | 3872 } |
| 3866 } | 3873 } |
| 3867 next = this.advance(); | 3874 next = this.advance(); |
| 3868 } | 3875 } |
| 3869 return next; | 3876 return next; |
| 3870 } | 3877 } |
| 3871 // ********** Code for AbstractScanner$S ************** | 3878 // ********** Code for AbstractScanner$S ************** |
| 3872 function AbstractScanner$S() {} | 3879 function AbstractScanner$S() {} |
| 3873 $inherits(AbstractScanner$S, AbstractScanner); | 3880 $inherits(AbstractScanner$S, AbstractScanner); |
| 3874 AbstractScanner$S.prototype.tokenize = function() { | 3881 AbstractScanner$S.prototype.tokenize = function() { |
| 3875 var next = this.advance(); | 3882 var next = this.advance(); |
| 3876 while (next != -1) { | 3883 while (next != -1.000000/*-1*/) { |
| 3877 next = this.bigSwitch(next); | 3884 next = this.bigSwitch(next); |
| 3878 } | 3885 } |
| 3879 return this.firstToken(); | 3886 return this.firstToken(); |
| 3880 } | 3887 } |
| 3881 AbstractScanner$S.prototype.bigSwitch = function(next) { | 3888 AbstractScanner$S.prototype.bigSwitch = function(next) { |
| 3882 this.beginToken(); | 3889 this.beginToken(); |
| 3883 switch (next) { | 3890 switch (next) { |
| 3884 case 9/*null.$TAB*/: | 3891 case 9/*null.$TAB*/: |
| 3885 case 10/*null.$LF*/: | 3892 case 10/*null.$LF*/: |
| 3886 case 13/*null.$CR*/: | 3893 case 13/*null.$CR*/: |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4085 case 118/*null.$v*/: | 4092 case 118/*null.$v*/: |
| 4086 case 119/*null.$w*/: | 4093 case 119/*null.$w*/: |
| 4087 case 120/*null.$x*/: | 4094 case 120/*null.$x*/: |
| 4088 case 121/*null.$y*/: | 4095 case 121/*null.$y*/: |
| 4089 case 122/*null.$z*/: | 4096 case 122/*null.$z*/: |
| 4090 | 4097 |
| 4091 return this.tokenizeIdentifier(next); | 4098 return this.tokenizeIdentifier(next); |
| 4092 | 4099 |
| 4093 default: | 4100 default: |
| 4094 | 4101 |
| 4095 if (next == -1) { | 4102 if (next == -1.000000/*-1*/) { |
| 4096 return -1; | 4103 return -1.000000/*-1*/; |
| 4097 } | 4104 } |
| 4098 if (next < 0x1f) { | 4105 if (next < 0x1f) { |
| 4099 $throw(this.get$charOffset()); | 4106 $throw(this.get$charOffset()); |
| 4100 $throw(new MalformedInputException(this.get$charOffset())); | 4107 $throw(new MalformedInputException(this.get$charOffset())); |
| 4101 } | 4108 } |
| 4102 return this.tokenizeIdentifier(next); | 4109 return this.tokenizeIdentifier(next); |
| 4103 | 4110 |
| 4104 } | 4111 } |
| 4105 } | 4112 } |
| 4106 AbstractScanner$S.prototype.tokenizeTag = function(next) { | 4113 AbstractScanner$S.prototype.tokenizeTag = function(next) { |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4261 case 62/*null.$GT*/: | 4268 case 62/*null.$GT*/: |
| 4262 | 4269 |
| 4263 return this.select(61/*null.$EQ*/, ">>>=", ">>>"); | 4270 return this.select(61/*null.$EQ*/, ">>>=", ">>>"); |
| 4264 | 4271 |
| 4265 default: | 4272 default: |
| 4266 | 4273 |
| 4267 this.appendStringToken(62/*null.$GT*/, ">>"); | 4274 this.appendStringToken(62/*null.$GT*/, ">>"); |
| 4268 return next; | 4275 return next; |
| 4269 | 4276 |
| 4270 } | 4277 } |
| 4278 $throw(new FallThroughError("leg/scanner/scanner.dart", 389)) |
| 4271 | 4279 |
| 4272 default: | 4280 default: |
| 4273 | 4281 |
| 4274 this.appendStringToken(62/*null.$GT*/, ">"); | 4282 this.appendStringToken(62/*null.$GT*/, ">"); |
| 4275 return next; | 4283 return next; |
| 4276 | 4284 |
| 4277 } | 4285 } |
| 4278 } | 4286 } |
| 4279 AbstractScanner$S.prototype.tokenizeLessThan = function(next) { | 4287 AbstractScanner$S.prototype.tokenizeLessThan = function(next) { |
| 4280 next = this.advance(); | 4288 next = this.advance(); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4504 | 4512 |
| 4505 this.appendStringToken(47/*null.$SLASH*/, "/"); | 4513 this.appendStringToken(47/*null.$SLASH*/, "/"); |
| 4506 return next; | 4514 return next; |
| 4507 | 4515 |
| 4508 } | 4516 } |
| 4509 } | 4517 } |
| 4510 AbstractScanner$S.prototype.tokenizeSingleLineComment = function(next) { | 4518 AbstractScanner$S.prototype.tokenizeSingleLineComment = function(next) { |
| 4511 while (true) { | 4519 while (true) { |
| 4512 next = this.advance(); | 4520 next = this.advance(); |
| 4513 switch (next) { | 4521 switch (next) { |
| 4514 case -1: | 4522 case -1.000000/*-1*/: |
| 4515 case 10/*null.$LF*/: | 4523 case 10/*null.$LF*/: |
| 4516 case 13/*null.$CR*/: | 4524 case 13/*null.$CR*/: |
| 4517 | 4525 |
| 4518 return next; | 4526 return next; |
| 4519 | 4527 |
| 4520 } | 4528 } |
| 4521 } | 4529 } |
| 4522 } | 4530 } |
| 4523 AbstractScanner$S.prototype.tokenizeMultiLineComment = function(next) { | 4531 AbstractScanner$S.prototype.tokenizeMultiLineComment = function(next) { |
| 4524 next = this.advance(); | 4532 next = this.advance(); |
| 4525 while (true) { | 4533 while (true) { |
| 4526 switch (next) { | 4534 switch (next) { |
| 4527 case -1: | 4535 case -1.000000/*-1*/: |
| 4528 | 4536 |
| 4529 return next; | 4537 return next; |
| 4530 | 4538 |
| 4531 case 42/*null.$STAR*/: | 4539 case 42/*null.$STAR*/: |
| 4532 | 4540 |
| 4533 next = this.advance(); | 4541 next = this.advance(); |
| 4534 if (next == 47/*null.$SLASH*/) { | 4542 if (next == 47/*null.$SLASH*/) { |
| 4535 return this.advance(); | 4543 return this.advance(); |
| 4536 } | 4544 } |
| 4537 else if (next == -1) { | 4545 else if (next == -1.000000/*-1*/) { |
| 4538 return next; | 4546 return next; |
| 4539 } | 4547 } |
| 4540 break; | 4548 break; |
| 4541 | 4549 |
| 4542 default: | 4550 default: |
| 4543 | 4551 |
| 4544 next = this.advance(); | 4552 next = this.advance(); |
| 4545 break; | 4553 break; |
| 4546 | 4554 |
| 4547 } | 4555 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 4565 state = null; | 4573 state = null; |
| 4566 } | 4574 } |
| 4567 else if (next < 128) { | 4575 else if (next < 128) { |
| 4568 if (state != null && state.isLeaf()) { | 4576 if (state != null && state.isLeaf()) { |
| 4569 this.appendKeywordToken(state.get$keyword()); | 4577 this.appendKeywordToken(state.get$keyword()); |
| 4570 } | 4578 } |
| 4571 else if (isAscii) { | 4579 else if (isAscii) { |
| 4572 this.appendByteStringToken(97/*null.$a*/, this.asciiString(start)); | 4580 this.appendByteStringToken(97/*null.$a*/, this.asciiString(start)); |
| 4573 } | 4581 } |
| 4574 else { | 4582 else { |
| 4575 this.appendByteStringToken(97/*null.$a*/, this.utf8String(start, -1)); | 4583 this.appendByteStringToken(97/*null.$a*/, this.utf8String(start, -1.0000
00/*-1*/)); |
| 4576 } | 4584 } |
| 4577 return next; | 4585 return next; |
| 4578 } | 4586 } |
| 4579 else { | 4587 else { |
| 4580 var nonAsciiStart = this.get$byteOffset(); | 4588 var nonAsciiStart = this.get$byteOffset(); |
| 4581 do { | 4589 do { |
| 4582 next = this.nextByte(); | 4590 next = this.nextByte(); |
| 4583 } | 4591 } |
| 4584 while (next > 127) | 4592 while (next > 127) |
| 4585 var string = this.utf8String(nonAsciiStart, -1).toString(); | 4593 var string = this.utf8String(nonAsciiStart, -1.000000/*-1*/).toString(); |
| 4586 isAscii = false; | 4594 isAscii = false; |
| 4587 this.addToCharOffset(string.length); | 4595 this.addToCharOffset(string.length); |
| 4588 return next; | 4596 return next; |
| 4589 } | 4597 } |
| 4590 next = this.advance(); | 4598 next = this.advance(); |
| 4591 } | 4599 } |
| 4592 } | 4600 } |
| 4593 AbstractScanner$S.prototype.tokenizeRawString = function(next) { | 4601 AbstractScanner$S.prototype.tokenizeRawString = function(next) { |
| 4594 var start = this.get$byteOffset(); | 4602 var start = this.get$byteOffset(); |
| 4595 next = this.advance(); | 4603 next = this.advance(); |
| 4596 if (next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/) { | 4604 if (next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/) { |
| 4597 return this.tokenizeString(next, start, true); | 4605 return this.tokenizeString(next, start, true); |
| 4598 } | 4606 } |
| 4599 else { | 4607 else { |
| 4600 $throw(new MalformedInputException(this.get$charOffset())); | 4608 $throw(new MalformedInputException(this.get$charOffset())); |
| 4601 } | 4609 } |
| 4602 } | 4610 } |
| 4603 AbstractScanner$S.prototype.tokenizeString = function(next, start, raw) { | 4611 AbstractScanner$S.prototype.tokenizeString = function(next, start, raw) { |
| 4604 var q = next; | 4612 var q = next; |
| 4605 next = this.advance(); | 4613 next = this.advance(); |
| 4606 if (q == next) { | 4614 if (q == next) { |
| 4607 next = this.advance(); | 4615 next = this.advance(); |
| 4608 if (q == next) { | 4616 if (q == next) { |
| 4609 return this.tokenizeMultiLineString(q, start, raw); | 4617 return this.tokenizeMultiLineString(q, start, raw); |
| 4610 } | 4618 } |
| 4611 else { | 4619 else { |
| 4612 this.appendByteStringToken(q, this.utf8String(start, -1)); | 4620 this.appendByteStringToken(q, this.utf8String(start, -1.000000/*-1*/)); |
| 4613 return next; | 4621 return next; |
| 4614 } | 4622 } |
| 4615 } | 4623 } |
| 4616 if (raw) { | 4624 if (raw) { |
| 4617 return this.tokenizeSingleLineRawString(next, q, start); | 4625 return this.tokenizeSingleLineRawString(next, q, start); |
| 4618 } | 4626 } |
| 4619 else { | 4627 else { |
| 4620 return this.tokenizeSingleLineString(next, q, start); | 4628 return this.tokenizeSingleLineString(next, q, start); |
| 4621 } | 4629 } |
| 4622 } | 4630 } |
| 4623 AbstractScanner$S.prototype.tokenizeSingleLineString = function(next, q1, start)
{ | 4631 AbstractScanner$S.prototype.tokenizeSingleLineString = function(next, q1, start)
{ |
| 4624 while (next != -1) { | 4632 while (next != -1.000000/*-1*/) { |
| 4625 if (next == q1) { | 4633 if (next == q1) { |
| 4626 this.appendByteStringToken(q1, this.utf8String(start, 0)); | 4634 this.appendByteStringToken(q1, this.utf8String(start, 0)); |
| 4627 return this.advance(); | 4635 return this.advance(); |
| 4628 } | 4636 } |
| 4629 else if (next == 92/*null.$BACKSLASH*/) { | 4637 else if (next == 92/*null.$BACKSLASH*/) { |
| 4630 next = this.advance(); | 4638 next = this.advance(); |
| 4631 if (next == -1) { | 4639 if (next == -1.000000/*-1*/) { |
| 4632 $throw(new MalformedInputException(this.get$charOffset())); | 4640 $throw(new MalformedInputException(this.get$charOffset())); |
| 4633 } | 4641 } |
| 4634 } | 4642 } |
| 4635 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { | 4643 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { |
| 4636 $throw(new MalformedInputException(this.get$charOffset())); | 4644 $throw(new MalformedInputException(this.get$charOffset())); |
| 4637 } | 4645 } |
| 4638 next = this.advance(); | 4646 next = this.advance(); |
| 4639 } | 4647 } |
| 4640 $throw(new MalformedInputException(this.get$charOffset())); | 4648 $throw(new MalformedInputException(this.get$charOffset())); |
| 4641 } | 4649 } |
| 4642 AbstractScanner$S.prototype.tokenizeSingleLineRawString = function(next, q1, sta
rt) { | 4650 AbstractScanner$S.prototype.tokenizeSingleLineRawString = function(next, q1, sta
rt) { |
| 4643 next = this.advance(); | 4651 next = this.advance(); |
| 4644 while (next != -1) { | 4652 while (next != -1.000000/*-1*/) { |
| 4645 if (next == q1) { | 4653 if (next == q1) { |
| 4646 this.appendByteStringToken(q1, this.utf8String(start, 0)); | 4654 this.appendByteStringToken(q1, this.utf8String(start, 0)); |
| 4647 return this.advance(); | 4655 return this.advance(); |
| 4648 } | 4656 } |
| 4649 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { | 4657 else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) { |
| 4650 $throw(new MalformedInputException(this.get$charOffset())); | 4658 $throw(new MalformedInputException(this.get$charOffset())); |
| 4651 } | 4659 } |
| 4652 next = this.advance(); | 4660 next = this.advance(); |
| 4653 } | 4661 } |
| 4654 $throw(new MalformedInputException(this.get$charOffset())); | 4662 $throw(new MalformedInputException(this.get$charOffset())); |
| 4655 } | 4663 } |
| 4656 AbstractScanner$S.prototype.tokenizeMultiLineString = function(q, start, raw) { | 4664 AbstractScanner$S.prototype.tokenizeMultiLineString = function(q, start, raw) { |
| 4657 var next = this.advance(); | 4665 var next = this.advance(); |
| 4658 while (next != -1) { | 4666 while (next != -1.000000/*-1*/) { |
| 4659 if (next == q) { | 4667 if (next == q) { |
| 4660 next = this.advance(); | 4668 next = this.advance(); |
| 4661 if (next == q) { | 4669 if (next == q) { |
| 4662 next = this.advance(); | 4670 next = this.advance(); |
| 4663 if (next == q) { | 4671 if (next == q) { |
| 4664 this.appendByteStringToken(q, this.utf8String(start, 0)); | 4672 this.appendByteStringToken(q, this.utf8String(start, 0)); |
| 4665 return this.advance(); | 4673 return this.advance(); |
| 4666 } | 4674 } |
| 4667 } | 4675 } |
| 4668 } | 4676 } |
| 4669 next = this.advance(); | 4677 next = this.advance(); |
| 4670 } | 4678 } |
| 4671 return next; | 4679 return next; |
| 4672 } | 4680 } |
| 4673 // ********** Code for MalformedInputException ************** | 4681 // ********** Code for MalformedInputException ************** |
| 4674 function MalformedInputException(ignored) { | 4682 function MalformedInputException(ignored) { |
| 4675 // Initializers done | 4683 // Initializers done |
| 4676 } | 4684 } |
| 4677 // ********** Code for Parser ************** | 4685 // ********** Code for scanner_Parser ************** |
| 4678 function Parser(listener) { | 4686 function scanner_Parser(listener) { |
| 4679 this.listener = listener; | 4687 this.listener = listener; |
| 4680 // Initializers done | 4688 // Initializers done |
| 4681 } | 4689 } |
| 4682 Parser.prototype.next = function(token) { | 4690 scanner_Parser.prototype.next = function(token) { |
| 4683 return this.checkEof(token.next); | 4691 return this.checkEof(token.next); |
| 4684 } | 4692 } |
| 4685 Parser.prototype.checkEof = function(token) { | 4693 scanner_Parser.prototype.checkEof = function(token) { |
| 4686 if (token == null) { | 4694 if (token == null) { |
| 4687 this.listener.unexpectedEof(); | 4695 this.listener.unexpectedEof(); |
| 4688 $throw("Unexpected EOF"); | 4696 $throw("Unexpected EOF"); |
| 4689 } | 4697 } |
| 4690 return token; | 4698 return token; |
| 4691 } | 4699 } |
| 4692 Parser.prototype.parseUnit = function(token) { | 4700 scanner_Parser.prototype.parseUnit = function(token) { |
| 4693 while (token != null) { | 4701 while (token != null) { |
| 4694 switch (token.get$value()) { | 4702 switch (token.get$value()) { |
| 4695 case const$308/*Keyword.INTERFACE*/: | 4703 case const$298/*Keyword.INTERFACE*/: |
| 4696 | 4704 |
| 4697 token = this.parseInterface(token); | 4705 token = this.parseInterface(token); |
| 4698 break; | 4706 break; |
| 4699 | 4707 |
| 4700 case const$296/*Keyword.CLASS*/: | 4708 case const$286/*Keyword.CLASS*/: |
| 4701 | 4709 |
| 4702 token = this.parseClass(token); | 4710 token = this.parseClass(token); |
| 4703 break; | 4711 break; |
| 4704 | 4712 |
| 4705 case const$324/*Keyword.TYPEDEF*/: | 4713 case const$314/*Keyword.TYPEDEF*/: |
| 4706 | 4714 |
| 4707 token = this.parseNamedFunctionAlias(token); | 4715 token = this.parseNamedFunctionAlias(token); |
| 4708 break; | 4716 break; |
| 4709 | 4717 |
| 4710 case const$338/*const SourceString("#")*/: | 4718 case const$328/*const SourceString("#")*/: |
| 4711 | 4719 |
| 4712 token = this.parseLibraryTags(token); | 4720 token = this.parseLibraryTags(token); |
| 4713 break; | 4721 break; |
| 4714 | 4722 |
| 4715 default: | 4723 default: |
| 4716 | 4724 |
| 4717 token = this.parseTopLevelMember(token); | 4725 token = this.parseTopLevelMember(token); |
| 4718 break; | 4726 break; |
| 4719 | 4727 |
| 4720 } | 4728 } |
| 4721 } | 4729 } |
| 4722 } | 4730 } |
| 4723 Parser.prototype.parseInterface = function(token) { | 4731 scanner_Parser.prototype.parseInterface = function(token) { |
| 4724 this.listener.beginInterface(token); | 4732 this.listener.beginInterface(token); |
| 4725 token = this.parseIdentifier(this.next(token)); | 4733 token = this.parseIdentifier(this.next(token)); |
| 4726 token = this.parseTypeVariablesOpt(token); | 4734 token = this.parseTypeVariablesOpt(token); |
| 4727 token = this.parseSupertypesClauseOpt(token); | 4735 token = this.parseSupertypesClauseOpt(token); |
| 4728 token = this.parseFactoryClauseOpt(token); | 4736 token = this.parseFactoryClauseOpt(token); |
| 4729 return this.parseInterfaceBody(token); | 4737 return this.parseInterfaceBody(token); |
| 4730 } | 4738 } |
| 4731 Parser.prototype.parseInterfaceBody = function(token) { | 4739 scanner_Parser.prototype.parseInterfaceBody = function(token) { |
| 4732 token = this.skipBlock(token); | 4740 token = this.skipBlock(token); |
| 4733 this.listener.endInterface(token); | 4741 this.listener.endInterface(token); |
| 4734 return token.next; | 4742 return token.next; |
| 4735 } | 4743 } |
| 4736 Parser.prototype.parseNamedFunctionAlias = function(token) { | 4744 scanner_Parser.prototype.parseNamedFunctionAlias = function(token) { |
| 4737 this.listener.beginFunctionTypeAlias(token); | 4745 this.listener.beginFunctionTypeAlias(token); |
| 4738 token = this.parseReturnTypeOpt(this.next(token)); | 4746 token = this.parseReturnTypeOpt(this.next(token)); |
| 4739 token = this.parseIdentifier(token); | 4747 token = this.parseIdentifier(token); |
| 4740 token = this.parseTypeVariablesOpt(token); | 4748 token = this.parseTypeVariablesOpt(token); |
| 4741 token = this.parseParameters(token); | 4749 token = this.parseParameters(token); |
| 4742 this.listener.endFunctionTypeAlias(token); | 4750 this.listener.endFunctionTypeAlias(token); |
| 4743 return this.expect(const$337/*const SourceString(";")*/, token); | 4751 return this.expect(const$327/*const SourceString(";")*/, token); |
| 4744 } | 4752 } |
| 4745 Parser.prototype.parseReturnTypeOpt = function(token) { | 4753 scanner_Parser.prototype.parseReturnTypeOpt = function(token) { |
| 4746 if ($eq(token.get$value(), const$288/*Keyword.VOID*/)) { | 4754 if ($eq(token.get$value(), const$278/*Keyword.VOID*/)) { |
| 4747 return this.next(token); | 4755 return this.next(token); |
| 4748 } | 4756 } |
| 4749 else { | 4757 else { |
| 4750 return this.parseTypeOpt(token); | 4758 return this.parseTypeOpt(token); |
| 4751 } | 4759 } |
| 4752 } | 4760 } |
| 4753 Parser.prototype.parseParameters = function(token) { | 4761 scanner_Parser.prototype.parseParameters = function(token) { |
| 4754 this.expect(const$335/*const SourceString("(")*/, token); | 4762 this.expect(const$325/*const SourceString("(")*/, token); |
| 4755 if (this.optional(const$336/*const SourceString(")")*/, this.next(token))) { | 4763 if (this.optional(const$326/*const SourceString(")")*/, this.next(token))) { |
| 4756 return this.next(this.next(token)); | 4764 return this.next(this.next(token)); |
| 4757 } | 4765 } |
| 4758 do { | 4766 do { |
| 4759 token = this.parseTypeOpt(this.next(token)); | 4767 token = this.parseTypeOpt(this.next(token)); |
| 4760 token = this.parseIdentifier(token); | 4768 token = this.parseIdentifier(token); |
| 4761 } | 4769 } |
| 4762 while (this.optional(const$331/*const SourceString(",")*/, token)) | 4770 while (this.optional(const$321/*const SourceString(",")*/, token)) |
| 4763 return this.expect(const$336/*const SourceString(")")*/, token); | 4771 return this.expect(const$326/*const SourceString(")")*/, token); |
| 4764 } | 4772 } |
| 4765 Parser.prototype.parseTypeOpt = function(token) { | 4773 scanner_Parser.prototype.parseTypeOpt = function(token) { |
| 4766 switch (true) { | 4774 switch (true) { |
| 4767 case this.optional(const$329/*const SourceString("<")*/, this.next(token)): | 4775 case this.optional(const$319/*const SourceString("<")*/, this.next(token)): |
| 4768 case this.optional(const$330/*const SourceString(".")*/, this.next(token)): | 4776 case this.optional(const$320/*const SourceString(".")*/, this.next(token)): |
| 4769 case this.isIdentifier(this.next(token)): | 4777 case this.isIdentifier(this.next(token)): |
| 4770 | 4778 |
| 4771 return this.parseType(token); | 4779 return this.parseType(token); |
| 4772 | 4780 |
| 4773 default: | 4781 default: |
| 4774 | 4782 |
| 4775 return token; | 4783 return token; |
| 4776 | 4784 |
| 4777 } | 4785 } |
| 4778 } | 4786 } |
| 4779 Parser.prototype.isIdentifier = function(token) { | 4787 scanner_Parser.prototype.isIdentifier = function(token) { |
| 4780 switch (token.kind) { | 4788 switch (token.kind) { |
| 4781 case 97/*null.$a*/: | 4789 case 97/*null.$a*/: |
| 4782 | 4790 |
| 4783 return true; | 4791 return true; |
| 4784 | 4792 |
| 4785 case 107/*null.$k*/: | 4793 case 107/*null.$k*/: |
| 4786 | 4794 |
| 4787 return token.get$value().isPseudo; | 4795 return token.get$value().isPseudo; |
| 4788 | 4796 |
| 4789 default: | 4797 default: |
| 4790 | 4798 |
| 4791 return false; | 4799 return false; |
| 4792 | 4800 |
| 4793 } | 4801 } |
| 4794 } | 4802 } |
| 4795 Parser.prototype.parseSupertypesClauseOpt = function(token) { | 4803 scanner_Parser.prototype.parseSupertypesClauseOpt = function(token) { |
| 4796 if (this.optional(const$298/*Keyword.EXTENDS*/, token)) { | 4804 if (this.optional(const$288/*Keyword.EXTENDS*/, token)) { |
| 4797 do { | 4805 do { |
| 4798 token = this.parseType(this.next(token)); | 4806 token = this.parseType(this.next(token)); |
| 4799 } | 4807 } |
| 4800 while (this.optional(const$331/*const SourceString(",")*/, token)) | 4808 while (this.optional(const$321/*const SourceString(",")*/, token)) |
| 4801 } | 4809 } |
| 4802 return token; | 4810 return token; |
| 4803 } | 4811 } |
| 4804 Parser.prototype.parseFactoryClauseOpt = function(token) { | 4812 scanner_Parser.prototype.parseFactoryClauseOpt = function(token) { |
| 4805 if (this.optional(const$300/*Keyword.FACTORY*/, token)) { | 4813 if (this.optional(const$290/*Keyword.FACTORY*/, token)) { |
| 4806 return this.parseType(this.next(token)); | 4814 return this.parseType(this.next(token)); |
| 4807 } | 4815 } |
| 4808 return token; | 4816 return token; |
| 4809 } | 4817 } |
| 4810 Parser.prototype.skipBlock = function(token) { | 4818 scanner_Parser.prototype.skipBlock = function(token) { |
| 4811 if (!this.optional(const$333/*const SourceString("{")*/, token)) return this.l
istener.expectedBlock(token); | 4819 if (!this.optional(const$323/*const SourceString("{")*/, token)) return this.l
istener.expectedBlock(token); |
| 4812 token = this.next(token); | 4820 token = this.next(token); |
| 4813 var nesting = 1; | 4821 var nesting = 1; |
| 4814 do { | 4822 do { |
| 4815 switch (token.kind) { | 4823 switch (token.kind) { |
| 4816 case 123/*null.$LBRACE*/: | 4824 case 123/*null.$LBRACE*/: |
| 4817 | 4825 |
| 4818 nesting++; | 4826 nesting++; |
| 4819 break; | 4827 break; |
| 4820 | 4828 |
| 4821 case 125/*null.$RBRACE*/: | 4829 case 125/*null.$RBRACE*/: |
| 4822 | 4830 |
| 4823 nesting--; | 4831 nesting--; |
| 4824 if (nesting == 0) { | 4832 if (nesting == 0) { |
| 4825 return token; | 4833 return token; |
| 4826 } | 4834 } |
| 4827 break; | 4835 break; |
| 4828 | 4836 |
| 4829 } | 4837 } |
| 4830 token = this.next(token); | 4838 token = this.next(token); |
| 4831 } | 4839 } |
| 4832 while (token != null) | 4840 while (token != null) |
| 4833 $throw("Internal error: unreachable code"); | 4841 $throw("Internal error: unreachable code"); |
| 4834 } | 4842 } |
| 4835 Parser.prototype.parseClass = function(token) { | 4843 scanner_Parser.prototype.parseClass = function(token) { |
| 4836 this.listener.beginClass(token); | 4844 this.listener.beginClass(token); |
| 4837 token = this.parseIdentifier(this.next(token)); | 4845 token = this.parseIdentifier(this.next(token)); |
| 4838 token = this.parseTypeVariablesOpt(token); | 4846 token = this.parseTypeVariablesOpt(token); |
| 4839 token = this.parseSuperclassClauseOpt(token); | 4847 token = this.parseSuperclassClauseOpt(token); |
| 4840 token = this.parseImplementsOpt(token); | 4848 token = this.parseImplementsOpt(token); |
| 4841 token = this.parseNativeClassClauseOpt(token); | 4849 token = this.parseNativeClassClauseOpt(token); |
| 4842 return this.parseClassBody(token); | 4850 return this.parseClassBody(token); |
| 4843 } | 4851 } |
| 4844 Parser.prototype.parseNativeClassClauseOpt = function(token) { | 4852 scanner_Parser.prototype.parseNativeClassClauseOpt = function(token) { |
| 4845 if (this.optional(const$312/*Keyword.NATIVE*/, token)) { | 4853 if (this.optional(const$302/*Keyword.NATIVE*/, token)) { |
| 4846 return this.parseString(this.next(token)); | 4854 return this.parseString(this.next(token)); |
| 4847 } | 4855 } |
| 4848 return token; | 4856 return token; |
| 4849 } | 4857 } |
| 4850 Parser.prototype.parseString = function(token) { | 4858 scanner_Parser.prototype.parseString = function(token) { |
| 4851 switch (token.kind) { | 4859 switch (token.kind) { |
| 4852 case 39/*null.$SQ*/: | 4860 case 39/*null.$SQ*/: |
| 4853 case 34/*null.$DQ*/: | 4861 case 34/*null.$DQ*/: |
| 4854 | 4862 |
| 4855 return this.next(token); | 4863 return this.next(token); |
| 4856 | 4864 |
| 4857 default: | 4865 default: |
| 4858 | 4866 |
| 4859 return this.listener.expected(const$334/*const SourceString("string")*/, t
oken); | 4867 return this.listener.expected(const$324/*const SourceString("string")*/, t
oken); |
| 4860 | 4868 |
| 4861 } | 4869 } |
| 4862 } | 4870 } |
| 4863 Parser.prototype.parseIdentifier = function(token) { | 4871 scanner_Parser.prototype.parseIdentifier = function(token) { |
| 4864 if (this.isIdentifier(token)) { | 4872 if (this.isIdentifier(token)) { |
| 4865 this.listener.identifier(token); | 4873 this.listener.identifier(token); |
| 4866 } | 4874 } |
| 4867 else { | 4875 else { |
| 4868 this.listener.notIdentifier(token); | 4876 this.listener.notIdentifier(token); |
| 4869 } | 4877 } |
| 4870 return this.next(token); | 4878 return this.next(token); |
| 4871 } | 4879 } |
| 4872 Parser.prototype.parseTypeVariablesOpt = function(token) { | 4880 scanner_Parser.prototype.parseTypeVariablesOpt = function(token) { |
| 4873 if (!this.optional(const$329/*const SourceString("<")*/, token)) { | 4881 if (!this.optional(const$319/*const SourceString("<")*/, token)) { |
| 4874 return token; | 4882 return token; |
| 4875 } | 4883 } |
| 4876 this.listener.beginTypeVariables(token); | 4884 this.listener.beginTypeVariables(token); |
| 4877 do { | 4885 do { |
| 4878 token = this.parseTypeVariable(this.next(token)); | 4886 token = this.parseTypeVariable(this.next(token)); |
| 4879 } | 4887 } |
| 4880 while (this.optional(const$331/*const SourceString(",")*/, token)) | 4888 while (this.optional(const$321/*const SourceString(",")*/, token)) |
| 4881 return this.expect(const$332/*const SourceString(">")*/, token); | 4889 return this.expect(const$322/*const SourceString(">")*/, token); |
| 4882 } | 4890 } |
| 4883 Parser.prototype.expect = function(string, token) { | 4891 scanner_Parser.prototype.expect = function(string, token) { |
| 4884 if ($ne(string, token.get$value())) { | 4892 if ($ne(string, token.get$value())) { |
| 4885 return this.listener.expected(string, token); | 4893 return this.listener.expected(string, token); |
| 4886 } | 4894 } |
| 4887 return token.next; | 4895 return token.next; |
| 4888 } | 4896 } |
| 4889 Parser.prototype.parseTypeVariable = function(token) { | 4897 scanner_Parser.prototype.parseTypeVariable = function(token) { |
| 4890 this.listener.beginTypeVariable(token); | 4898 this.listener.beginTypeVariable(token); |
| 4891 token = this.parseIdentifier(token); | 4899 token = this.parseIdentifier(token); |
| 4892 token = this.parseSuperclassClauseOpt(token); | 4900 token = this.parseSuperclassClauseOpt(token); |
| 4893 this.listener.endTypeVariable(token); | 4901 this.listener.endTypeVariable(token); |
| 4894 return token; | 4902 return token; |
| 4895 } | 4903 } |
| 4896 Parser.prototype.optional = function(value, token) { | 4904 scanner_Parser.prototype.optional = function(value, token) { |
| 4897 return $eq(value, token.get$value()); | 4905 return $eq(value, token.get$value()); |
| 4898 } | 4906 } |
| 4899 Parser.prototype.parseSuperclassClauseOpt = function(token) { | 4907 scanner_Parser.prototype.parseSuperclassClauseOpt = function(token) { |
| 4900 if (this.optional(const$298/*Keyword.EXTENDS*/, token)) { | 4908 if (this.optional(const$288/*Keyword.EXTENDS*/, token)) { |
| 4901 return this.parseType(this.next(token)); | 4909 return this.parseType(this.next(token)); |
| 4902 } | 4910 } |
| 4903 return token; | 4911 return token; |
| 4904 } | 4912 } |
| 4905 Parser.prototype.parseType = function(token) { | 4913 scanner_Parser.prototype.parseType = function(token) { |
| 4906 if (this.isIdentifier(token)) { | 4914 if (this.isIdentifier(token)) { |
| 4907 token = this.parseIdentifier(token); | 4915 token = this.parseIdentifier(token); |
| 4908 while (this.optional(const$330/*const SourceString(".")*/, token)) { | 4916 while (this.optional(const$320/*const SourceString(".")*/, token)) { |
| 4909 token = this.parseIdentifier(this.next(token)); | 4917 token = this.parseIdentifier(this.next(token)); |
| 4910 } | 4918 } |
| 4911 } | 4919 } |
| 4912 else { | 4920 else { |
| 4913 token = this.listener.expectedType(token); | 4921 token = this.listener.expectedType(token); |
| 4914 } | 4922 } |
| 4915 return this.parseTypeArgumentsOpt(token); | 4923 return this.parseTypeArgumentsOpt(token); |
| 4916 } | 4924 } |
| 4917 Parser.prototype.parseTypeArgumentsOpt = function(token) { | 4925 scanner_Parser.prototype.parseTypeArgumentsOpt = function(token) { |
| 4918 if (this.optional(const$329/*const SourceString("<")*/, token)) { | 4926 if (this.optional(const$319/*const SourceString("<")*/, token)) { |
| 4919 this.listener.beginTypeArguments(this.next(token)); | 4927 this.listener.beginTypeArguments(this.next(token)); |
| 4920 do { | 4928 do { |
| 4921 token = this.parseType(this.next(token)); | 4929 token = this.parseType(this.next(token)); |
| 4922 } | 4930 } |
| 4923 while (this.optional(const$331/*const SourceString(",")*/, token)) | 4931 while (this.optional(const$321/*const SourceString(",")*/, token)) |
| 4924 return this.expect(const$332/*const SourceString(">")*/, token); | 4932 return this.expect(const$322/*const SourceString(">")*/, token); |
| 4925 } | 4933 } |
| 4926 return token; | 4934 return token; |
| 4927 } | 4935 } |
| 4928 Parser.prototype.parseImplementsOpt = function(token) { | 4936 scanner_Parser.prototype.parseImplementsOpt = function(token) { |
| 4929 if (this.optional(const$304/*Keyword.IMPLEMENTS*/, token)) { | 4937 if (this.optional(const$294/*Keyword.IMPLEMENTS*/, token)) { |
| 4930 do { | 4938 do { |
| 4931 token = this.parseType(this.next(token)); | 4939 token = this.parseType(this.next(token)); |
| 4932 } | 4940 } |
| 4933 while (this.optional(const$331/*const SourceString(",")*/, token)) | 4941 while (this.optional(const$321/*const SourceString(",")*/, token)) |
| 4934 } | 4942 } |
| 4935 return token; | 4943 return token; |
| 4936 } | 4944 } |
| 4937 Parser.prototype.parseClassBody = function(token) { | 4945 scanner_Parser.prototype.parseClassBody = function(token) { |
| 4938 token = this.skipBlock(token); | 4946 token = this.skipBlock(token); |
| 4939 this.listener.endClass(token); | 4947 this.listener.endClass(token); |
| 4940 return token.next; | 4948 return token.next; |
| 4941 } | 4949 } |
| 4942 Parser.prototype.parseTopLevelMember = function(token) { | 4950 scanner_Parser.prototype.parseTopLevelMember = function(token) { |
| 4943 var start = token; | 4951 var start = token; |
| 4944 this.listener.beginTopLevelMember(token); | 4952 this.listener.beginTopLevelMember(token); |
| 4945 var previous = token; | 4953 var previous = token; |
| 4946 LOOP: | 4954 LOOP: |
| 4947 while (token != null) { | 4955 while (token != null) { |
| 4948 switch (token.kind) { | 4956 switch (token.kind) { |
| 4949 case 123/*null.$LBRACE*/: | 4957 case 123/*null.$LBRACE*/: |
| 4950 case 59/*null.$SEMICOLON*/: | 4958 case 59/*null.$SEMICOLON*/: |
| 4951 case 40/*null.$LPAREN*/: | 4959 case 40/*null.$LPAREN*/: |
| 4952 case 61/*null.$EQ*/: | 4960 case 61/*null.$EQ*/: |
| 4953 | 4961 |
| 4954 break LOOP; | 4962 break LOOP; |
| 4955 | 4963 |
| 4956 default: | 4964 default: |
| 4957 | 4965 |
| 4958 token = this.next(previous = token); | 4966 token = this.next(previous = token); |
| 4959 break; | 4967 break; |
| 4960 | 4968 |
| 4961 } | 4969 } |
| 4962 } | 4970 } |
| 4963 token = this.parseIdentifier(previous); | 4971 token = this.parseIdentifier(previous); |
| 4964 if (this.optional(const$335/*const SourceString("(")*/, token)) { | 4972 if (this.optional(const$325/*const SourceString("(")*/, token)) { |
| 4965 this.listener.topLevelMethod(start); | 4973 this.listener.topLevelMethod(start); |
| 4966 } | 4974 } |
| 4967 else if (this.optional(const$339/*const SourceString("=")*/, token) || this.op
tional(const$337/*const SourceString(";")*/, token)) { | 4975 else if (this.optional(const$329/*const SourceString("=")*/, token) || this.op
tional(const$327/*const SourceString(";")*/, token)) { |
| 4968 this.listener.topLevelField(start); | 4976 this.listener.topLevelField(start); |
| 4969 } | 4977 } |
| 4970 else { | 4978 else { |
| 4971 token = this.listener.unexpected(token); | 4979 token = this.listener.unexpected(token); |
| 4972 } | 4980 } |
| 4973 while (token != null && token.kind != 123/*null.$LBRACE*/ && token.kind != 59/
*null.$SEMICOLON*/) { | 4981 while (token != null && token.kind != 123/*null.$LBRACE*/ && token.kind != 59/
*null.$SEMICOLON*/) { |
| 4974 token = this.next(token); | 4982 token = this.next(token); |
| 4975 } | 4983 } |
| 4976 if (!this.optional(const$337/*const SourceString(";")*/, token)) { | 4984 if (!this.optional(const$327/*const SourceString(";")*/, token)) { |
| 4977 token = this.skipBlock(token); | 4985 token = this.skipBlock(token); |
| 4978 } | 4986 } |
| 4979 this.listener.endTopLevelMember(token); | 4987 this.listener.endTopLevelMember(token); |
| 4980 return token.next; | 4988 return token.next; |
| 4981 } | 4989 } |
| 4982 Parser.prototype.parseLibraryTags = function(token) { | 4990 scanner_Parser.prototype.parseLibraryTags = function(token) { |
| 4983 this.listener.beginLibraryTag(token); | 4991 this.listener.beginLibraryTag(token); |
| 4984 token = this.parseIdentifier(this.next(token)); | 4992 token = this.parseIdentifier(this.next(token)); |
| 4985 token = this.expect(const$335/*const SourceString("(")*/, token); | 4993 token = this.expect(const$325/*const SourceString("(")*/, token); |
| 4986 while (token != null && token.kind != 40/*null.$LPAREN*/ && token.kind != 41/*
null.$RPAREN*/) { | 4994 while (token != null && token.kind != 40/*null.$LPAREN*/ && token.kind != 41/*
null.$RPAREN*/) { |
| 4987 token = this.next(token); | 4995 token = this.next(token); |
| 4988 } | 4996 } |
| 4989 token = this.expect(const$336/*const SourceString(")")*/, token); | 4997 token = this.expect(const$326/*const SourceString(")")*/, token); |
| 4990 return this.expect(const$337/*const SourceString(";")*/, token); | 4998 return this.expect(const$327/*const SourceString(";")*/, token); |
| 4991 } | 4999 } |
| 4992 // ********** Code for BodyParser ************** | 5000 // ********** Code for BodyParser ************** |
| 4993 function BodyParser(listener) { | 5001 function BodyParser(listener) { |
| 4994 Parser.call(this, listener); | 5002 scanner_Parser.call(this, listener); |
| 4995 // Initializers done | 5003 // Initializers done |
| 4996 } | 5004 } |
| 4997 $inherits(BodyParser, Parser); | 5005 $inherits(BodyParser, scanner_Parser); |
| 4998 BodyParser.prototype.parseMethod = function(token) { | 5006 BodyParser.prototype.parseMethod = function(token) { |
| 4999 token = this.parseReturnType(token); | 5007 token = this.parseReturnType(token); |
| 5000 token = this.parseIdentifier(token); | 5008 token = this.parseIdentifier(token); |
| 5001 token = this.parseFormalParameters(token); | 5009 token = this.parseFormalParameters(token); |
| 5002 return this.parseMethodBody(token); | 5010 return this.parseMethodBody(token); |
| 5003 } | 5011 } |
| 5004 BodyParser.prototype.parseReturnType = function(token) { | 5012 BodyParser.prototype.parseReturnType = function(token) { |
| 5005 if (this.optional(const$288/*Keyword.VOID*/, token)) { | 5013 if (this.optional(const$278/*Keyword.VOID*/, token)) { |
| 5006 return token.next; | 5014 return token.next; |
| 5007 } | 5015 } |
| 5008 return this.parseType(token); | 5016 return this.parseType(token); |
| 5009 } | 5017 } |
| 5010 BodyParser.prototype.parseFormalParameters = function(token) { | 5018 BodyParser.prototype.parseFormalParameters = function(token) { |
| 5011 this.listener.beginArguments(token); | 5019 this.listener.beginArguments(token); |
| 5012 this.expect(const$335/*const SourceString("(")*/, token); | 5020 this.expect(const$325/*const SourceString("(")*/, token); |
| 5013 if (this.optional(const$336/*const SourceString(")")*/, token.next)) { | 5021 if (this.optional(const$326/*const SourceString(")")*/, token.next)) { |
| 5014 return token.next.next; | 5022 return token.next.next; |
| 5015 } | 5023 } |
| 5016 do { | 5024 do { |
| 5017 token = this.parseType(this.next(token)); | 5025 token = this.parseType(this.next(token)); |
| 5018 token = this.parseIdentifier(token); | 5026 token = this.parseIdentifier(token); |
| 5019 } | 5027 } |
| 5020 while (this.optional(const$331/*const SourceString(",")*/, token)) | 5028 while (this.optional(const$321/*const SourceString(",")*/, token)) |
| 5021 return this.expect(const$336/*const SourceString(")")*/, token); | 5029 return this.expect(const$326/*const SourceString(")")*/, token); |
| 5022 } | 5030 } |
| 5023 BodyParser.prototype.parseMethodBody = function(token) { | 5031 BodyParser.prototype.parseMethodBody = function(token) { |
| 5024 if (this.optional(const$337/*const SourceString(";")*/, token)) { | 5032 if (this.optional(const$327/*const SourceString(";")*/, token)) { |
| 5025 return token.next; | 5033 return token.next; |
| 5026 } | 5034 } |
| 5027 token = this.checkEof(this.expect(const$333/*const SourceString("{")*/, token)
); | 5035 token = this.checkEof(this.expect(const$323/*const SourceString("{")*/, token)
); |
| 5028 while (!this.optional(const$340/*const SourceString("}")*/, token)) { | 5036 while (!this.optional(const$330/*const SourceString("}")*/, token)) { |
| 5029 token = this.parseStatement(token); | 5037 token = this.parseStatement(token); |
| 5030 } | 5038 } |
| 5031 return this.expect(const$340/*const SourceString("}")*/, token); | 5039 return this.expect(const$330/*const SourceString("}")*/, token); |
| 5032 } | 5040 } |
| 5033 BodyParser.prototype.parseStatement = function(token) { | 5041 BodyParser.prototype.parseStatement = function(token) { |
| 5034 this.checkEof(token); | 5042 this.checkEof(token); |
| 5035 switch (token.get$value()) { | 5043 switch (token.get$value()) { |
| 5036 case const$272/*Keyword.RETURN*/: | 5044 case const$262/*Keyword.RETURN*/: |
| 5037 | 5045 |
| 5038 token = this.expectSemicolon(this.parseReturnStatement(token)); | 5046 token = this.expectSemicolon(this.parseReturnStatement(token)); |
| 5039 break; | 5047 break; |
| 5040 | 5048 |
| 5041 default: | 5049 default: |
| 5042 | 5050 |
| 5043 token = this.expectSemicolon(this.parseExpression(token)); | 5051 token = this.expectSemicolon(this.parseExpression(token)); |
| 5044 break; | 5052 break; |
| 5045 | 5053 |
| 5046 } | 5054 } |
| 5047 this.listener.endStatement(token); | 5055 this.listener.endStatement(token); |
| 5048 return token; | 5056 return token; |
| 5049 } | 5057 } |
| 5050 BodyParser.prototype.expectSemicolon = function(token) { | 5058 BodyParser.prototype.expectSemicolon = function(token) { |
| 5051 return this.expect(const$337/*const SourceString(";")*/, token); | 5059 return this.expect(const$327/*const SourceString(";")*/, token); |
| 5052 } | 5060 } |
| 5053 BodyParser.prototype.parseReturnStatement = function(token) { | 5061 BodyParser.prototype.parseReturnStatement = function(token) { |
| 5054 this.listener.beginReturnStatement(token); | 5062 this.listener.beginReturnStatement(token); |
| 5055 return this.parseExpression(this.next(token)); | 5063 return this.parseExpression(this.next(token)); |
| 5056 } | 5064 } |
| 5057 BodyParser.prototype.parseExpression = function(token) { | 5065 BodyParser.prototype.parseExpression = function(token) { |
| 5058 switch (token.kind) { | 5066 switch (token.kind) { |
| 5059 case 105/*null.$i*/: | 5067 case 105/*null.$i*/: |
| 5060 | 5068 |
| 5061 token = this.parseLiteralNumber(token); | 5069 token = this.parseLiteralNumber(token); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 5072 this.listener.unexpected(token); | 5080 this.listener.unexpected(token); |
| 5073 $throw("not yet implemented"); | 5081 $throw("not yet implemented"); |
| 5074 | 5082 |
| 5075 } | 5083 } |
| 5076 return token; | 5084 return token; |
| 5077 } | 5085 } |
| 5078 BodyParser.prototype.parseLiteralNumber = function(token) { | 5086 BodyParser.prototype.parseLiteralNumber = function(token) { |
| 5079 return token.next; | 5087 return token.next; |
| 5080 } | 5088 } |
| 5081 BodyParser.prototype.parseArgumentsOpt = function(token) { | 5089 BodyParser.prototype.parseArgumentsOpt = function(token) { |
| 5082 if (this.optional(const$335/*const SourceString("(")*/, token)) { | 5090 if (this.optional(const$325/*const SourceString("(")*/, token)) { |
| 5083 this.listener.beginArguments(token); | 5091 this.listener.beginArguments(token); |
| 5084 do { | 5092 do { |
| 5085 token = this.parseExpression(this.next(token)); | 5093 token = this.parseExpression(this.next(token)); |
| 5086 } | 5094 } |
| 5087 while (this.optional(const$331/*const SourceString(",")*/, token)) | 5095 while (this.optional(const$321/*const SourceString(",")*/, token)) |
| 5088 return this.expect(const$336/*const SourceString(")")*/, token); | 5096 return this.expect(const$326/*const SourceString(")")*/, token); |
| 5089 } | 5097 } |
| 5090 return token; | 5098 return token; |
| 5091 } | 5099 } |
| 5092 // ********** Code for Listener ************** | 5100 // ********** Code for Listener ************** |
| 5093 function Listener(canceler) { | 5101 function Listener(canceler) { |
| 5094 this.classCount = 0 | 5102 this.classCount = 0 |
| 5095 this.aliasCount = 0 | 5103 this.aliasCount = 0 |
| 5096 this.interfaceCount = 0 | 5104 this.interfaceCount = 0 |
| 5097 this.libraryTagCount = 0 | 5105 this.libraryTagCount = 0 |
| 5098 this.topLevelMemberCount = 0 | 5106 this.topLevelMemberCount = 0 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5142 Listener.prototype.beginTypeVariable = function(token) { | 5150 Listener.prototype.beginTypeVariable = function(token) { |
| 5143 | 5151 |
| 5144 } | 5152 } |
| 5145 Listener.prototype.endTypeVariable = function(token) { | 5153 Listener.prototype.endTypeVariable = function(token) { |
| 5146 | 5154 |
| 5147 } | 5155 } |
| 5148 Listener.prototype.beginTypeVariables = function(token) { | 5156 Listener.prototype.beginTypeVariables = function(token) { |
| 5149 | 5157 |
| 5150 } | 5158 } |
| 5151 Listener.prototype.identifier = function(token) { | 5159 Listener.prototype.identifier = function(token) { |
| 5152 this.previousIdentifier = new Identifier(token); | 5160 this.previousIdentifier = new tree_Identifier(token); |
| 5153 } | 5161 } |
| 5154 Listener.prototype.beginTypeArguments = function(token) { | 5162 Listener.prototype.beginTypeArguments = function(token) { |
| 5155 | 5163 |
| 5156 } | 5164 } |
| 5157 Listener.prototype.expected = function(string, token) { | 5165 Listener.prototype.expected = function(string, token) { |
| 5158 this.canceler.cancel(("Expected '" + string + "', but got '" + token + "' ") +
("@ " + token.charOffset + "")); | 5166 this.canceler.cancel(("Expected '" + string + "', but got '" + token + "' ") +
("@ " + token.charOffset + "")); |
| 5159 } | 5167 } |
| 5160 Listener.prototype.unexpectedEof = function() { | 5168 Listener.prototype.unexpectedEof = function() { |
| 5161 this.canceler.cancel("Unexpected end of file"); | 5169 this.canceler.cancel("Unexpected end of file"); |
| 5162 } | 5170 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5241 // Initializers done | 5249 // Initializers done |
| 5242 } | 5250 } |
| 5243 $inherits(StringScanner, ArrayBasedScanner$String); | 5251 $inherits(StringScanner, ArrayBasedScanner$String); |
| 5244 StringScanner.prototype.nextByte = function() { | 5252 StringScanner.prototype.nextByte = function() { |
| 5245 return this.charAt(++this.byteOffset); | 5253 return this.charAt(++this.byteOffset); |
| 5246 } | 5254 } |
| 5247 StringScanner.prototype.peek = function() { | 5255 StringScanner.prototype.peek = function() { |
| 5248 return this.charAt(this.byteOffset + 1); | 5256 return this.charAt(this.byteOffset + 1); |
| 5249 } | 5257 } |
| 5250 StringScanner.prototype.charAt = function(index) { | 5258 StringScanner.prototype.charAt = function(index) { |
| 5251 return (this.string.length > index) ? this.string.charCodeAt(index) : -1; | 5259 return (this.string.length > index) ? this.string.charCodeAt(index) : -1.00000
0/*-1*/; |
| 5252 } | 5260 } |
| 5253 StringScanner.prototype.asciiString = function(start) { | 5261 StringScanner.prototype.asciiString = function(start) { |
| 5254 return this.string.substring(start, this.byteOffset); | 5262 return this.string.substring(start, this.byteOffset); |
| 5255 } | 5263 } |
| 5256 StringScanner.prototype.utf8String = function(start, offset) { | 5264 StringScanner.prototype.utf8String = function(start, offset) { |
| 5257 return this.string.substring(start, this.byteOffset + offset + 1); | 5265 return this.string.substring(start, this.byteOffset + offset + 1); |
| 5258 } | 5266 } |
| 5259 StringScanner.prototype.appendByteStringToken = function(kind, value) { | 5267 StringScanner.prototype.appendByteStringToken = function(kind, value) { |
| 5260 this.tail.next = new StringToken(kind, value, this.tokenStart); | 5268 this.tail.next = new StringToken(kind, value, this.tokenStart); |
| 5261 this.tail = this.tail.next; | 5269 this.tail = this.tail.next; |
| 5262 } | 5270 } |
| 5263 // ********** Code for Token ************** | 5271 // ********** Code for scanner_Token ************** |
| 5264 function Token(kind, charOffset) { | 5272 function scanner_Token(kind, charOffset) { |
| 5265 this.kind = kind; | 5273 this.kind = kind; |
| 5266 this.charOffset = charOffset; | 5274 this.charOffset = charOffset; |
| 5267 // Initializers done | 5275 // Initializers done |
| 5268 } | 5276 } |
| 5269 Token.prototype.toString = function() { | 5277 scanner_Token.prototype.toString = function() { |
| 5270 return Strings.String$fromCharCodes$factory([this.kind]); | 5278 return Strings.String$fromCharCodes$factory([this.kind]); |
| 5271 } | 5279 } |
| 5272 // ********** Code for KeywordToken ************** | 5280 // ********** Code for KeywordToken ************** |
| 5273 function KeywordToken(value, charOffset) { | 5281 function KeywordToken(value, charOffset) { |
| 5274 this.value = value; | 5282 this.value = value; |
| 5275 Token.call(this, 107/*null.$k*/, charOffset); | 5283 scanner_Token.call(this, 107/*null.$k*/, charOffset); |
| 5276 // Initializers done | 5284 // Initializers done |
| 5277 } | 5285 } |
| 5278 $inherits(KeywordToken, Token); | 5286 $inherits(KeywordToken, scanner_Token); |
| 5279 KeywordToken.prototype.get$value = function() { return this.value; }; | 5287 KeywordToken.prototype.get$value = function() { return this.value; }; |
| 5280 KeywordToken.prototype.toString = function() { | 5288 KeywordToken.prototype.toString = function() { |
| 5281 return this.value.syntax; | 5289 return this.value.syntax; |
| 5282 } | 5290 } |
| 5283 // ********** Code for StringToken ************** | 5291 // ********** Code for StringToken ************** |
| 5284 function StringToken(kind, value, charOffset) { | 5292 function StringToken(kind, value, charOffset) { |
| 5285 this.value = new StringWrapper(value); | 5293 this.value = new StringWrapper(value); |
| 5286 Token.call(this, kind, charOffset); | 5294 scanner_Token.call(this, kind, charOffset); |
| 5287 // Initializers done | 5295 // Initializers done |
| 5288 } | 5296 } |
| 5289 $inherits(StringToken, Token); | 5297 $inherits(StringToken, scanner_Token); |
| 5290 StringToken.prototype.get$value = function() { return this.value; }; | 5298 StringToken.prototype.get$value = function() { return this.value; }; |
| 5291 StringToken.prototype.toString = function() { | 5299 StringToken.prototype.toString = function() { |
| 5292 return this.value.toString(); | 5300 return this.value.toString(); |
| 5293 } | 5301 } |
| 5294 // ********** Code for StringWrapper ************** | 5302 // ********** Code for StringWrapper ************** |
| 5295 function StringWrapper(my_personal_string_and_you_cannot_have_it) { | 5303 function StringWrapper(my_personal_string_and_you_cannot_have_it) { |
| 5296 this.my_personal_string_and_you_cannot_have_it = my_personal_string_and_you_ca
nnot_have_it; | 5304 this.my_personal_string_and_you_cannot_have_it = my_personal_string_and_you_ca
nnot_have_it; |
| 5297 // Initializers done | 5305 // Initializers done |
| 5298 } | 5306 } |
| 5299 StringWrapper.prototype.is$SourceString = function(){return this;}; | 5307 StringWrapper.prototype.is$SourceString = function(){return this;}; |
| 5300 StringWrapper.prototype.hashCode = function() { | 5308 StringWrapper.prototype.hashCode = function() { |
| 5301 return this.toString().hashCode(); | 5309 return this.toString().hashCode(); |
| 5302 } | 5310 } |
| 5303 StringWrapper.prototype.$eq = function(other) { | 5311 StringWrapper.prototype.$eq = function(other) { |
| 5304 return !!(other && other.is$SourceString) && this.toString() == other.toString
(); | 5312 return !!(other && other.is$SourceString) && this.toString() == other.toString
(); |
| 5305 } | 5313 } |
| 5306 StringWrapper.prototype.toString = function() { | 5314 StringWrapper.prototype.toString = function() { |
| 5307 return this.my_personal_string_and_you_cannot_have_it; | 5315 return this.my_personal_string_and_you_cannot_have_it; |
| 5308 } | 5316 } |
| 5309 // ********** Code for top level ************** | 5317 // ********** Code for top level ************** |
| 5310 // ********** Library tree ************** | 5318 // ********** Library tree ************** |
| 5311 // ********** Code for Node ************** | 5319 // ********** Code for tree_Node ************** |
| 5312 function Node() {} | 5320 function tree_Node() {} |
| 5313 Node.prototype.hashCode = function() { | 5321 tree_Node.prototype.hashCode = function() { |
| 5314 return this._hashCode; | 5322 return this._hashCode; |
| 5315 } | 5323 } |
| 5316 Node.prototype.toString = function() { | 5324 tree_Node.prototype.toString = function() { |
| 5317 return this.get$debugString(); | 5325 return this.get$debugString(); |
| 5318 } | 5326 } |
| 5319 // ********** Code for Expression ************** | 5327 // ********** Code for tree_Expression ************** |
| 5320 function Expression() {} | 5328 function tree_Expression() {} |
| 5321 $inherits(Expression, Node); | 5329 $inherits(tree_Expression, tree_Node); |
| 5322 // ********** Code for Statement ************** | 5330 // ********** Code for tree_Statement ************** |
| 5323 function Statement() {} | 5331 function tree_Statement() {} |
| 5324 $inherits(Statement, Node); | 5332 $inherits(tree_Statement, tree_Node); |
| 5325 // ********** Code for Invocation ************** | 5333 // ********** Code for Invocation ************** |
| 5326 function Invocation(receiver, selector, argumentsNode) { | 5334 function Invocation(receiver, selector, argumentsNode) { |
| 5327 this.debugString = "invocation" | 5335 this.debugString = "invocation" |
| 5328 this.receiver = receiver; | 5336 this.receiver = receiver; |
| 5329 this.selector = selector; | 5337 this.selector = selector; |
| 5330 this.argumentsNode = argumentsNode; | 5338 this.argumentsNode = argumentsNode; |
| 5331 // Initializers done | 5339 // Initializers done |
| 5332 } | 5340 } |
| 5333 $inherits(Invocation, Expression); | 5341 $inherits(Invocation, tree_Expression); |
| 5334 Invocation.prototype.get$arguments = function() { | 5342 Invocation.prototype.get$arguments = function() { |
| 5335 return this.argumentsNode.nodes; | 5343 return this.argumentsNode.nodes; |
| 5336 } | 5344 } |
| 5337 Invocation.prototype.get$debugString = function() { return this.debugString; }; | 5345 Invocation.prototype.get$debugString = function() { return this.debugString; }; |
| 5338 Invocation.prototype.accept = function(visitor) { | 5346 Invocation.prototype.accept = function(visitor) { |
| 5339 return visitor.visitInvocation(this); | 5347 return visitor.visitInvocation(this); |
| 5340 } | 5348 } |
| 5341 // ********** Code for NewExpression ************** | 5349 // ********** Code for tree_NewExpression ************** |
| 5342 function NewExpression() {} | 5350 function tree_NewExpression() {} |
| 5343 $inherits(NewExpression, Expression); | 5351 $inherits(tree_NewExpression, tree_Expression); |
| 5344 NewExpression.prototype.get$debugString = function() { return this.debugString;
}; | 5352 tree_NewExpression.prototype.get$debugString = function() { return this.debugStr
ing; }; |
| 5345 // ********** Code for NodeList ************** | 5353 // ********** Code for NodeList ************** |
| 5346 function NodeList(beginToken, nodes, endToken, delimiter) { | 5354 function NodeList(beginToken, nodes, endToken, delimiter) { |
| 5347 this.debugString = "node list" | 5355 this.debugString = "node list" |
| 5348 this.beginToken = beginToken; | 5356 this.beginToken = beginToken; |
| 5349 this.nodes = nodes; | 5357 this.nodes = nodes; |
| 5350 this.endToken = endToken; | 5358 this.endToken = endToken; |
| 5351 this.delimiter = delimiter; | 5359 this.delimiter = delimiter; |
| 5352 // Initializers done | 5360 // Initializers done |
| 5353 } | 5361 } |
| 5354 $inherits(NodeList, Node); | 5362 $inherits(NodeList, tree_Node); |
| 5355 NodeList.prototype.get$debugString = function() { return this.debugString; }; | 5363 NodeList.prototype.get$debugString = function() { return this.debugString; }; |
| 5356 NodeList.prototype.accept = function(visitor) { | 5364 NodeList.prototype.accept = function(visitor) { |
| 5357 return visitor.visitNodeList(this); | 5365 return visitor.visitNodeList(this); |
| 5358 } | 5366 } |
| 5359 // ********** Code for Block ************** | 5367 // ********** Code for Block ************** |
| 5360 function Block(beginToken, statements, endToken) { | 5368 function Block(beginToken, statements, endToken) { |
| 5361 this.debugString = "block" | 5369 this.debugString = "block" |
| 5362 this.beginToken = beginToken; | 5370 this.beginToken = beginToken; |
| 5363 this.statements = statements; | 5371 this.statements = statements; |
| 5364 this.endToken = endToken; | 5372 this.endToken = endToken; |
| 5365 // Initializers done | 5373 // Initializers done |
| 5366 } | 5374 } |
| 5367 $inherits(Block, Statement); | 5375 $inherits(Block, tree_Statement); |
| 5368 Block.prototype.get$debugString = function() { return this.debugString; }; | 5376 Block.prototype.get$debugString = function() { return this.debugString; }; |
| 5369 Block.prototype.accept = function(visitor) { | 5377 Block.prototype.accept = function(visitor) { |
| 5370 return visitor.visitBlock(this); | 5378 return visitor.visitBlock(this); |
| 5371 } | 5379 } |
| 5372 // ********** Code for FunctionExpression ************** | 5380 // ********** Code for FunctionExpression ************** |
| 5373 function FunctionExpression(name, parameters, body, returnType) { | 5381 function FunctionExpression(name, parameters, body, returnType) { |
| 5374 this.debugString = "function expression" | 5382 this.debugString = "function expression" |
| 5375 this.name = name; | 5383 this.name = name; |
| 5376 this.parameters = parameters; | 5384 this.parameters = parameters; |
| 5377 this.body = body; | 5385 this.body = body; |
| 5378 this.returnType = returnType; | 5386 this.returnType = returnType; |
| 5379 // Initializers done | 5387 // Initializers done |
| 5380 } | 5388 } |
| 5381 $inherits(FunctionExpression, Expression); | 5389 $inherits(FunctionExpression, tree_Expression); |
| 5382 FunctionExpression.prototype.get$name = function() { return this.name; }; | 5390 FunctionExpression.prototype.get$name = function() { return this.name; }; |
| 5383 FunctionExpression.prototype.get$parameters = function() { return this.parameter
s; }; | 5391 FunctionExpression.prototype.get$parameters = function() { return this.parameter
s; }; |
| 5384 FunctionExpression.prototype.get$returnType = function() { return this.returnTyp
e; }; | 5392 FunctionExpression.prototype.get$returnType = function() { return this.returnTyp
e; }; |
| 5385 FunctionExpression.prototype.get$debugString = function() { return this.debugStr
ing; }; | 5393 FunctionExpression.prototype.get$debugString = function() { return this.debugStr
ing; }; |
| 5386 FunctionExpression.prototype.accept = function(visitor) { | 5394 FunctionExpression.prototype.accept = function(visitor) { |
| 5387 return visitor.visitFunctionExpression(this); | 5395 return visitor.visitFunctionExpression(this); |
| 5388 } | 5396 } |
| 5389 // ********** Code for Literal ************** | 5397 // ********** Code for Literal ************** |
| 5390 function Literal(value) { | 5398 function Literal(value) { |
| 5391 this.value = value; | 5399 this.value = value; |
| 5392 // Initializers done | 5400 // Initializers done |
| 5393 } | 5401 } |
| 5394 $inherits(Literal, Expression); | 5402 $inherits(Literal, tree_Expression); |
| 5395 Literal.prototype.get$value = function() { return this.value; }; | 5403 Literal.prototype.get$value = function() { return this.value; }; |
| 5396 Literal.prototype.get$debugString = function() { | 5404 Literal.prototype.get$debugString = function() { |
| 5397 return ("" + this.value + ""); | 5405 return ("" + this.value + ""); |
| 5398 } | 5406 } |
| 5399 Literal.prototype.accept = function(visitor) { | 5407 Literal.prototype.accept = function(visitor) { |
| 5400 return visitor.visitLiteral(this); | 5408 return visitor.visitLiteral(this); |
| 5401 } | 5409 } |
| 5402 // ********** Code for Identifier ************** | 5410 // ********** Code for tree_Identifier ************** |
| 5403 function Identifier(token) { | 5411 function tree_Identifier(token) { |
| 5404 this.token = token; | 5412 this.token = token; |
| 5405 // Initializers done | 5413 // Initializers done |
| 5406 } | 5414 } |
| 5407 Identifier.fromString$ctor = function(string) { | 5415 tree_Identifier.fromString$ctor = function(string) { |
| 5408 this.token = new StringToken(97, string, -1); | 5416 this.token = new StringToken(97, string, -1.000000/*-1*/); |
| 5409 // Initializers done | 5417 // Initializers done |
| 5410 } | 5418 } |
| 5411 Identifier.fromString$ctor.prototype = Identifier.prototype; | 5419 tree_Identifier.fromString$ctor.prototype = tree_Identifier.prototype; |
| 5412 $inherits(Identifier, Expression); | 5420 $inherits(tree_Identifier, tree_Expression); |
| 5413 Identifier.prototype.get$debugString = function() { | 5421 tree_Identifier.prototype.get$debugString = function() { |
| 5414 return this.get$name().toString(); | 5422 return this.get$name().toString(); |
| 5415 } | 5423 } |
| 5416 Identifier.prototype.get$name = function() { | 5424 tree_Identifier.prototype.get$name = function() { |
| 5417 return this.token.get$value(); | 5425 return this.token.get$value(); |
| 5418 } | 5426 } |
| 5419 Identifier.prototype.accept = function(visitor) { | 5427 tree_Identifier.prototype.accept = function(visitor) { |
| 5420 return visitor.visitIdentifier(this); | 5428 return visitor.visitIdentifier(this); |
| 5421 } | 5429 } |
| 5422 // ********** Code for Operator ************** | 5430 // ********** Code for Operator ************** |
| 5423 function Operator() {} | 5431 function Operator() {} |
| 5424 Operator.fromString$ctor = function(string) { | 5432 Operator.fromString$ctor = function(string) { |
| 5425 Identifier.fromString$ctor.call(this, string); | 5433 tree_Identifier.fromString$ctor.call(this, string); |
| 5426 // Initializers done | 5434 // Initializers done |
| 5427 } | 5435 } |
| 5428 Operator.fromString$ctor.prototype = Operator.prototype; | 5436 Operator.fromString$ctor.prototype = Operator.prototype; |
| 5429 $inherits(Operator, Identifier); | 5437 $inherits(Operator, tree_Identifier); |
| 5430 Operator.prototype.accept = function(visitor) { | 5438 Operator.prototype.accept = function(visitor) { |
| 5431 return visitor.visitOperator(this); | 5439 return visitor.visitOperator(this); |
| 5432 } | 5440 } |
| 5433 // ********** Code for Return ************** | 5441 // ********** Code for Return ************** |
| 5434 function Return(expression) { | 5442 function Return(expression) { |
| 5435 this.debugString = "return" | 5443 this.debugString = "return" |
| 5436 this.expression = expression; | 5444 this.expression = expression; |
| 5437 // Initializers done | 5445 // Initializers done |
| 5438 } | 5446 } |
| 5439 $inherits(Return, Statement); | 5447 $inherits(Return, tree_Statement); |
| 5440 Return.prototype.get$debugString = function() { return this.debugString; }; | 5448 Return.prototype.get$debugString = function() { return this.debugString; }; |
| 5441 Return.prototype.accept = function(visitor) { | 5449 Return.prototype.accept = function(visitor) { |
| 5442 return visitor.visitReturn(this); | 5450 return visitor.visitReturn(this); |
| 5443 } | 5451 } |
| 5444 // ********** Code for ExpressionStatement ************** | 5452 // ********** Code for tree_ExpressionStatement ************** |
| 5445 function ExpressionStatement(expression) { | 5453 function tree_ExpressionStatement(expression) { |
| 5446 this.expression = expression; | 5454 this.expression = expression; |
| 5447 // Initializers done | 5455 // Initializers done |
| 5448 } | 5456 } |
| 5449 $inherits(ExpressionStatement, Statement); | 5457 $inherits(tree_ExpressionStatement, tree_Statement); |
| 5450 ExpressionStatement.prototype.get$debugString = function() { | 5458 tree_ExpressionStatement.prototype.get$debugString = function() { |
| 5451 return ("" + this.expression.get$debugString() + ""); | 5459 return ("" + this.expression.get$debugString() + ""); |
| 5452 } | 5460 } |
| 5453 ExpressionStatement.prototype.accept = function(visitor) { | 5461 tree_ExpressionStatement.prototype.accept = function(visitor) { |
| 5454 return visitor.visitExpressionStatement(this); | 5462 return visitor.visitExpressionStatement(this); |
| 5455 } | 5463 } |
| 5456 // ********** Code for TypeAnnotation ************** | 5464 // ********** Code for TypeAnnotation ************** |
| 5457 function TypeAnnotation(typeName) { | 5465 function TypeAnnotation(typeName) { |
| 5458 this.typeName = typeName; | 5466 this.typeName = typeName; |
| 5459 // Initializers done | 5467 // Initializers done |
| 5460 } | 5468 } |
| 5461 $inherits(TypeAnnotation, Node); | 5469 $inherits(TypeAnnotation, tree_Node); |
| 5462 TypeAnnotation.prototype.get$typeName = function() { return this.typeName; }; | 5470 TypeAnnotation.prototype.get$typeName = function() { return this.typeName; }; |
| 5463 TypeAnnotation.prototype.get$debugString = function() { | 5471 TypeAnnotation.prototype.get$debugString = function() { |
| 5464 return ("" + this.typeName + ""); | 5472 return ("" + this.typeName + ""); |
| 5465 } | 5473 } |
| 5466 TypeAnnotation.prototype.accept = function(visitor) { | 5474 TypeAnnotation.prototype.accept = function(visitor) { |
| 5467 return visitor.visitTypeAnnotation(this); | 5475 return visitor.visitTypeAnnotation(this); |
| 5468 } | 5476 } |
| 5469 // ********** Code for top level ************** | 5477 // ********** Code for top level ************** |
| 5470 // ********** Library ssa ************** | 5478 // ********** Library ssa ************** |
| 5471 // ********** Code for HInstructionVisitor ************** | 5479 // ********** Code for HInstructionVisitor ************** |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5599 this.inputs = inputs; | 5607 this.inputs = inputs; |
| 5600 // Initializers done | 5608 // Initializers done |
| 5601 } | 5609 } |
| 5602 HInstruction.prototype.canBeGeneratedAtUseSite = function() { | 5610 HInstruction.prototype.canBeGeneratedAtUseSite = function() { |
| 5603 return this._canBeGeneratedAtUseSite; | 5611 return this._canBeGeneratedAtUseSite; |
| 5604 } | 5612 } |
| 5605 HInstruction.prototype.setCanBeGeneratedAtUseSite = function() { | 5613 HInstruction.prototype.setCanBeGeneratedAtUseSite = function() { |
| 5606 this._canBeGeneratedAtUseSite = true; | 5614 this._canBeGeneratedAtUseSite = true; |
| 5607 } | 5615 } |
| 5608 HInstruction.prototype.get$usedBy = function() { | 5616 HInstruction.prototype.get$usedBy = function() { |
| 5609 if (this._usedBy == null) return const$8/*const <HInstruction>[]*/; | 5617 if (this._usedBy == null) return const$120/*const <HInstruction>[]*/; |
| 5610 return this._usedBy; | 5618 return this._usedBy; |
| 5611 } | 5619 } |
| 5612 HInstruction.prototype.isInBasicBlock = function() { | 5620 HInstruction.prototype.isInBasicBlock = function() { |
| 5613 return this._usedBy != null; | 5621 return this._usedBy != null; |
| 5614 } | 5622 } |
| 5615 HInstruction.prototype.notifyAddedToBlock = function() { | 5623 HInstruction.prototype.notifyAddedToBlock = function() { |
| 5616 this._usedBy = []; | 5624 this._usedBy = []; |
| 5617 for (var i = 0; | 5625 for (var i = 0; |
| 5618 i < this.inputs.length; i++) { | 5626 i < this.inputs.length; i++) { |
| 5619 this.inputs.$index(i).get$usedBy().add(this); | 5627 this.inputs.$index(i).get$usedBy().add(this); |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6079 if (!(ex instanceof PipelineCancelledException)) throw ex; | 6087 if (!(ex instanceof PipelineCancelledException)) throw ex; |
| 6080 this.pipeline.log(("Parsing failed: " + ex.reason + "")); | 6088 this.pipeline.log(("Parsing failed: " + ex.reason + "")); |
| 6081 } | 6089 } |
| 6082 } | 6090 } |
| 6083 var emptyList = new NodeList(null, LinkFactory.Link$fromList$factory([])); | 6091 var emptyList = new NodeList(null, LinkFactory.Link$fromList$factory([])); |
| 6084 if (text == 'void main ( ) { print ( 3 + 4 ) ; }') { | 6092 if (text == 'void main ( ) { print ( 3 + 4 ) ; }') { |
| 6085 var three = new Literal(3); | 6093 var three = new Literal(3); |
| 6086 var four = new Literal(4); | 6094 var four = new Literal(4); |
| 6087 var plus = ParserStage.newOperator('+'); | 6095 var plus = ParserStage.newOperator('+'); |
| 6088 var sum = new Invocation(three, plus, ParserStage.newArguments([four])); | 6096 var sum = new Invocation(three, plus, ParserStage.newArguments([four])); |
| 6089 var print = new ExpressionStatement(new Invocation(null, ParserStage.newIden
tifier('print'), ParserStage.newArguments([sum]))); | 6097 var print = new tree_ExpressionStatement(new Invocation(null, ParserStage.ne
wIdentifier('print'), ParserStage.newArguments([sum]))); |
| 6090 var body = new Block(null, LinkFactory.Link$factory(print), null); | 6098 var body = new Block(null, LinkFactory.Link$factory(print), null); |
| 6091 var node = new FunctionExpression(ParserStage.newIdentifier('main'), emptyLi
st, body); | 6099 var node = new FunctionExpression(ParserStage.newIdentifier('main'), emptyLi
st, body); |
| 6092 this.pipeline.universe.define(ParserStage.newElement('main', node)); | 6100 this.pipeline.universe.define(ParserStage.newElement('main', node)); |
| 6093 } | 6101 } |
| 6094 else if ((text == 'void foo ( ) { return 3 + 4 ; }') && text2 == 'void main (
) { print ( foo ( ) ) ; }') { | 6102 else if ((text == 'void foo ( ) { return 3 + 4 ; }') && text2 == 'void main (
) { print ( foo ( ) ) ; }') { |
| 6095 var foo = new Invocation(null, ParserStage.newIdentifier('foo'), ParserStage
.newArguments([])); | 6103 var foo = new Invocation(null, ParserStage.newIdentifier('foo'), ParserStage
.newArguments([])); |
| 6096 var print = new ExpressionStatement(new Invocation(null, ParserStage.newIden
tifier('print'), ParserStage.newArguments([foo]))); | 6104 var print = new tree_ExpressionStatement(new Invocation(null, ParserStage.ne
wIdentifier('print'), ParserStage.newArguments([foo]))); |
| 6097 var body = new Block(null, LinkFactory.Link$factory(print), null); | 6105 var body = new Block(null, LinkFactory.Link$factory(print), null); |
| 6098 var node = new FunctionExpression(ParserStage.newIdentifier('main'), emptyLi
st, body); | 6106 var node = new FunctionExpression(ParserStage.newIdentifier('main'), emptyLi
st, body); |
| 6099 this.pipeline.universe.define(ParserStage.newElement('main', node)); | 6107 this.pipeline.universe.define(ParserStage.newElement('main', node)); |
| 6100 var three = new Literal(3); | 6108 var three = new Literal(3); |
| 6101 var four = new Literal(4); | 6109 var four = new Literal(4); |
| 6102 var plus = ParserStage.newOperator('+'); | 6110 var plus = ParserStage.newOperator('+'); |
| 6103 var sum = new Invocation(three, plus, ParserStage.newArguments([four])); | 6111 var sum = new Invocation(three, plus, ParserStage.newArguments([four])); |
| 6104 var ret = new Return(sum); | 6112 var ret = new Return(sum); |
| 6105 body = new Block(null, LinkFactory.Link$factory(ret), null); | 6113 body = new Block(null, LinkFactory.Link$factory(ret), null); |
| 6106 node = new FunctionExpression(ParserStage.newIdentifier('foo'), emptyList, b
ody); | 6114 node = new FunctionExpression(ParserStage.newIdentifier('foo'), emptyList, b
ody); |
| 6107 this.pipeline.universe.define(ParserStage.newElement('foo', node)); | 6115 this.pipeline.universe.define(ParserStage.newElement('foo', node)); |
| 6108 } | 6116 } |
| 6109 else if (text == 'void main ( ) { return 3 ; }') { | 6117 else if (text == 'void main ( ) { return 3 ; }') { |
| 6110 var three = new Literal(3); | 6118 var three = new Literal(3); |
| 6111 var body = new Block(null, LinkFactory.Link$factory(new Return(three)), null
); | 6119 var body = new Block(null, LinkFactory.Link$factory(new Return(three)), null
); |
| 6112 var node = new FunctionExpression(ParserStage.newIdentifier('main'), emptyLi
st, body, new TypeAnnotation('void')); | 6120 var node = new FunctionExpression(ParserStage.newIdentifier('main'), emptyLi
st, body, new TypeAnnotation('void')); |
| 6113 this.pipeline.universe.define(ParserStage.newElement('main', node)); | 6121 this.pipeline.universe.define(ParserStage.newElement('main', node)); |
| 6114 } | 6122 } |
| 6115 else { | 6123 else { |
| 6116 this.pipeline.cancel(); | 6124 this.pipeline.cancel(); |
| 6117 } | 6125 } |
| 6118 return input; | 6126 return input; |
| 6119 } | 6127 } |
| 6120 ParserStage.prototype.tokenize = function(text) { | 6128 ParserStage.prototype.tokenize = function(text) { |
| 6121 var tokens = this.pipeline.world.withTiming('[leg] scanning', (function () { | 6129 var tokens = this.pipeline.world.withTiming('[leg] scanning', (function () { |
| 6122 return new StringScanner(text).tokenize(); | 6130 return new StringScanner(text).tokenize(); |
| 6123 }) | 6131 }) |
| 6124 ); | 6132 ); |
| 6125 var listener = new Listener(this.pipeline); | 6133 var listener = new Listener(this.pipeline); |
| 6126 var parser = new Parser(listener); | 6134 var parser = new scanner_Parser(listener); |
| 6127 this.pipeline.world.withTiming('[leg] parsing', (function () { | 6135 this.pipeline.world.withTiming('[leg] parsing', (function () { |
| 6128 return parser.parseUnit(tokens); | 6136 return parser.parseUnit(tokens); |
| 6129 }) | 6137 }) |
| 6130 ); | 6138 ); |
| 6131 this.pipeline.log(new TokenPrinter(tokens)); | 6139 this.pipeline.log(new TokenPrinter(tokens)); |
| 6132 this.pipeline.log(("Parsing " + listener.libraryTagCount + " tags, ") + ("" +
listener.classCount + " classes, ") + ("" + listener.interfaceCount + " interfac
es, ") + ("" + listener.aliasCount + " typedefs, ") + ("" + listener.topLevelMem
berCount + " top-level members")); | 6140 this.pipeline.log(("Parsing " + listener.libraryTagCount + " tags, ") + ("" +
listener.classCount + " classes, ") + ("" + listener.interfaceCount + " interfac
es, ") + ("" + listener.aliasCount + " typedefs, ") + ("" + listener.topLevelMem
berCount + " top-level members")); |
| 6133 return listener.topLevelElements; | 6141 return listener.topLevelElements; |
| 6134 } | 6142 } |
| 6135 ParserStage.newArguments = function(expressions) { | 6143 ParserStage.newArguments = function(expressions) { |
| 6136 return new NodeList(null, LinkFactory.Link$fromList$factory(expressions), null
, null); | 6144 return new NodeList(null, LinkFactory.Link$fromList$factory(expressions), null
, null); |
| 6137 } | 6145 } |
| 6138 ParserStage.newIdentifier = function(name) { | 6146 ParserStage.newIdentifier = function(name) { |
| 6139 return new Identifier.fromString$ctor(name); | 6147 return new tree_Identifier.fromString$ctor(name); |
| 6140 } | 6148 } |
| 6141 ParserStage.newOperator = function(name) { | 6149 ParserStage.newOperator = function(name) { |
| 6142 return new Operator.fromString$ctor(name); | 6150 return new Operator.fromString$ctor(name); |
| 6143 } | 6151 } |
| 6144 ParserStage.newElement = function(name, node) { | 6152 ParserStage.newElement = function(name, node) { |
| 6145 return new Element(new StringWrapper(name), node); | 6153 return new Element(new StringWrapper(name), node); |
| 6146 } | 6154 } |
| 6147 // ********** Code for Universe ************** | 6155 // ********** Code for Universe ************** |
| 6148 function Universe() { | 6156 function Universe() { |
| 6149 this.elements = $map([]); | 6157 this.elements = $map([]); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6315 return element; | 6323 return element; |
| 6316 } | 6324 } |
| 6317 ResolverVisitor.prototype.visitIdentifier = function(node) { | 6325 ResolverVisitor.prototype.visitIdentifier = function(node) { |
| 6318 this.fail(node); | 6326 this.fail(node); |
| 6319 } | 6327 } |
| 6320 ResolverVisitor.prototype.visitInvocation = function(node) { | 6328 ResolverVisitor.prototype.visitInvocation = function(node) { |
| 6321 var selector = node.selector; | 6329 var selector = node.selector; |
| 6322 var target = this.pipeline.universe.find(selector.get$name()); | 6330 var target = this.pipeline.universe.find(selector.get$name()); |
| 6323 if (target == null) { | 6331 if (target == null) { |
| 6324 var name = selector.get$name(); | 6332 var name = selector.get$name(); |
| 6325 if ($eq(name, const$139/*const SourceString('print')*/) || $eq(name, const$1
40/*const SourceString('+')*/)) { | 6333 if ($eq(name, const$333/*const SourceString('print')*/) || $eq(name, const$3
34/*const SourceString('+')*/)) { |
| 6326 } | 6334 } |
| 6327 else { | 6335 else { |
| 6328 this.fail(node); | 6336 this.fail(node); |
| 6329 } | 6337 } |
| 6330 } | 6338 } |
| 6331 else { | 6339 else { |
| 6332 this.pipeline.worklist.add(selector.get$name()); | 6340 this.pipeline.worklist.add(selector.get$name()); |
| 6333 } | 6341 } |
| 6334 this.visit(node.argumentsNode); | 6342 this.visit(node.argumentsNode); |
| 6335 return null; | 6343 return null; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6388 return this.name.toString(); | 6396 return this.name.toString(); |
| 6389 } | 6397 } |
| 6390 // ********** Code for FunctionType ************** | 6398 // ********** Code for FunctionType ************** |
| 6391 function FunctionType(returnType) { | 6399 function FunctionType(returnType) { |
| 6392 this.returnType = returnType; | 6400 this.returnType = returnType; |
| 6393 // Initializers done | 6401 // Initializers done |
| 6394 } | 6402 } |
| 6395 FunctionType.prototype.get$returnType = function() { return this.returnType; }; | 6403 FunctionType.prototype.get$returnType = function() { return this.returnType; }; |
| 6396 // ********** Code for Types ************** | 6404 // ********** Code for Types ************** |
| 6397 function Types() { | 6405 function Types() { |
| 6398 this.VOID = const$134/*const SimpleType(const SourceString('void'))*/ | 6406 this.VOID = const$337/*const SimpleType(const SourceString('void'))*/ |
| 6399 this.INT = const$136/*const SimpleType(const SourceString('int'))*/ | 6407 this.INT = const$339/*const SimpleType(const SourceString('int'))*/ |
| 6400 this.DYNAMIC = const$138/*const SimpleType(const SourceString('Dynamic'))*/ | 6408 this.DYNAMIC = const$341/*const SimpleType(const SourceString('Dynamic'))*/ |
| 6401 // Initializers done | 6409 // Initializers done |
| 6402 } | 6410 } |
| 6403 Types.prototype.isSubtype = function(r, s) { | 6411 Types.prototype.isSubtype = function(r, s) { |
| 6404 return r === s || r === this.DYNAMIC || s === this.DYNAMIC; | 6412 return r === s || r === this.DYNAMIC || s === this.DYNAMIC; |
| 6405 } | 6413 } |
| 6406 Types.prototype.isAssignable = function(r, s) { | 6414 Types.prototype.isAssignable = function(r, s) { |
| 6407 return this.isSubtype(r, s) || this.isSubtype(s, r); | 6415 return this.isSubtype(r, s) || this.isSubtype(s, r); |
| 6408 } | 6416 } |
| 6409 // ********** Code for TypeCheckerVisitor ************** | 6417 // ********** Code for TypeCheckerVisitor ************** |
| 6410 function TypeCheckerVisitor(pipeline, elements, types, listener) { | 6418 function TypeCheckerVisitor(pipeline, elements, types, listener) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6471 } | 6479 } |
| 6472 return this.types.VOID; | 6480 return this.types.VOID; |
| 6473 } | 6481 } |
| 6474 // ********** Code for leg_Script ************** | 6482 // ********** Code for leg_Script ************** |
| 6475 function leg_Script(text) { | 6483 function leg_Script(text) { |
| 6476 this.text = text; | 6484 this.text = text; |
| 6477 // Initializers done | 6485 // Initializers done |
| 6478 } | 6486 } |
| 6479 leg_Script.prototype.get$text = function() { return this.text; }; | 6487 leg_Script.prototype.get$text = function() { return this.text; }; |
| 6480 // ********** Code for top level ************** | 6488 // ********** Code for top level ************** |
| 6481 function compile(world) { | 6489 function leg_compile(world) { |
| 6482 var file = world.readFile(options.dartScript); | 6490 var file = world.readFile(options.dartScript); |
| 6483 var script = new leg_Script(file.get$text()); | 6491 var script = new leg_Script(file.get$text()); |
| 6484 var pipeline = new WorldPipeline(world, script); | 6492 var pipeline = new WorldPipeline(world, script); |
| 6485 return pipeline.run(); | 6493 return pipeline.run(); |
| 6486 } | 6494 } |
| 6487 // ********** Library lang ************** | 6495 // ********** Library lang ************** |
| 6488 // ********** Code for CodeWriter ************** | 6496 // ********** Code for CodeWriter ************** |
| 6489 function CodeWriter() { | 6497 function CodeWriter() { |
| 6490 this._indentation = 0 | 6498 this._indentation = 0 |
| 6491 this._pendingIndent = false | 6499 this._pendingIndent = false |
| (...skipping 12 matching lines...) Expand all Loading... |
| 6504 } | 6512 } |
| 6505 } | 6513 } |
| 6506 CodeWriter.prototype.comment = function(text) { | 6514 CodeWriter.prototype.comment = function(text) { |
| 6507 if (this.writeComments) { | 6515 if (this.writeComments) { |
| 6508 this.writeln(text); | 6516 this.writeln(text); |
| 6509 } | 6517 } |
| 6510 } | 6518 } |
| 6511 CodeWriter.prototype.write = function(text) { | 6519 CodeWriter.prototype.write = function(text) { |
| 6512 if (text.length == 0) return; | 6520 if (text.length == 0) return; |
| 6513 if (this._pendingIndent) this._indent(); | 6521 if (this._pendingIndent) this._indent(); |
| 6514 if (text.indexOf('\n', 0) != -1) { | 6522 if (text.indexOf('\n', 0) != -1.000000/*-1*/) { |
| 6515 var lines = text.split('\n'); | 6523 var lines = text.split('\n'); |
| 6516 for (var i = 0; | 6524 for (var i = 0; |
| 6517 i < lines.length - 1; i++) { | 6525 i < lines.length - 1; i++) { |
| 6518 this.writeln(lines.$index(i)); | 6526 this.writeln(lines.$index(i)); |
| 6519 } | 6527 } |
| 6520 this.write(lines.$index(lines.length - 1)); | 6528 this.write(lines.$index(lines.length - 1)); |
| 6521 } | 6529 } |
| 6522 else { | 6530 else { |
| 6523 this._buf.add(text); | 6531 this._buf.add(text); |
| 6524 } | 6532 } |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6801 var values = map.getValues(); | 6809 var values = map.getValues(); |
| 6802 values.sort(this.get$_compareMembers()); | 6810 values.sort(this.get$_compareMembers()); |
| 6803 return values; | 6811 return values; |
| 6804 } | 6812 } |
| 6805 WorldGenerator.prototype._compareMembers = function(x, y) { | 6813 WorldGenerator.prototype._compareMembers = function(x, y) { |
| 6806 if (x.get$span() != null && y.get$span() != null) { | 6814 if (x.get$span() != null && y.get$span() != null) { |
| 6807 var spans = x.get$span().compareTo(y.get$span()); | 6815 var spans = x.get$span().compareTo(y.get$span()); |
| 6808 if (spans != 0) return spans; | 6816 if (spans != 0) return spans; |
| 6809 } | 6817 } |
| 6810 if (x.get$span() == null) return 1; | 6818 if (x.get$span() == null) return 1; |
| 6811 if (y.get$span() == null) return -1; | 6819 if (y.get$span() == null) return -1.000000/*-1*/; |
| 6812 return x.get$name().compareTo(y.get$name()); | 6820 return x.get$name().compareTo(y.get$name()); |
| 6813 } | 6821 } |
| 6814 WorldGenerator.prototype.get$_compareMembers = function() { | 6822 WorldGenerator.prototype.get$_compareMembers = function() { |
| 6815 return WorldGenerator.prototype._compareMembers.bind(this); | 6823 return WorldGenerator.prototype._compareMembers.bind(this); |
| 6816 } | 6824 } |
| 6817 WorldGenerator.prototype.useMapFactory = function() { | 6825 WorldGenerator.prototype.useMapFactory = function() { |
| 6818 var factType = world.get$coreimpl().types.$index('HashMapImplementation'); | 6826 var factType = world.get$coreimpl().types.$index('HashMapImplementation'); |
| 6819 var m = factType.resolveMember('\$setindex'); | 6827 var m = factType.resolveMember('\$setindex'); |
| 6820 this.genMethod(m.members.$index(0)); | 6828 this.genMethod(m.members.$index(0)); |
| 6821 var c = factType.getConstructor(''); | 6829 var c = factType.getConstructor(''); |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7243 if ((body instanceof BlockStatement)) { | 7251 if ((body instanceof BlockStatement)) { |
| 7244 var $list = body.body; | 7252 var $list = body.body; |
| 7245 for (var $i = body.body.iterator(); $i.hasNext(); ) { | 7253 for (var $i = body.body.iterator(); $i.hasNext(); ) { |
| 7246 var stmt = $i.next(); | 7254 var stmt = $i.next(); |
| 7247 stmt.visit(this); | 7255 stmt.visit(this); |
| 7248 } | 7256 } |
| 7249 } | 7257 } |
| 7250 else { | 7258 else { |
| 7251 if (body != null) body.visit(this); | 7259 if (body != null) body.visit(this); |
| 7252 } | 7260 } |
| 7261 return false; |
| 7253 } | 7262 } |
| 7254 MethodGenerator.prototype._pushBlock = function(reentrant) { | 7263 MethodGenerator.prototype._pushBlock = function(reentrant) { |
| 7255 this._scope = new BlockScope(this, this._scope, reentrant); | 7264 this._scope = new BlockScope(this, this._scope, reentrant); |
| 7256 } | 7265 } |
| 7257 MethodGenerator.prototype._popBlock = function() { | 7266 MethodGenerator.prototype._popBlock = function() { |
| 7258 this._scope = this._scope.parent; | 7267 this._scope = this._scope.parent; |
| 7259 } | 7268 } |
| 7260 MethodGenerator.prototype._makeLambdaMethod = function(name, func) { | 7269 MethodGenerator.prototype._makeLambdaMethod = function(name, func) { |
| 7261 var meth = new MethodMember(name, this.method.declaringType, func); | 7270 var meth = new MethodMember(name, this.method.declaringType, func); |
| 7262 meth.isLambda = true; | 7271 meth.isLambda = true; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 7280 } | 7289 } |
| 7281 MethodGenerator.prototype.visitVoid = function(node) { | 7290 MethodGenerator.prototype.visitVoid = function(node) { |
| 7282 if ((node instanceof PostfixExpression)) { | 7291 if ((node instanceof PostfixExpression)) { |
| 7283 var value = this.visitPostfixExpression(node, true); | 7292 var value = this.visitPostfixExpression(node, true); |
| 7284 value.checkFirstClass(node.span); | 7293 value.checkFirstClass(node.span); |
| 7285 return value; | 7294 return value; |
| 7286 } | 7295 } |
| 7287 return this.visitValue(node); | 7296 return this.visitValue(node); |
| 7288 } | 7297 } |
| 7289 MethodGenerator.prototype.visitDietStatement = function(node) { | 7298 MethodGenerator.prototype.visitDietStatement = function(node) { |
| 7290 var parser = new lang_Parser(node.span.file, false, node.span.start); | 7299 var parser = new Parser(node.span.file, false, node.span.start); |
| 7291 this.visitStatementsInBlock(parser.block()); | 7300 this.visitStatementsInBlock(parser.block()); |
| 7301 return false; |
| 7292 } | 7302 } |
| 7293 MethodGenerator.prototype.visitVariableDefinition = function(node) { | 7303 MethodGenerator.prototype.visitVariableDefinition = function(node) { |
| 7294 var isFinal = false; | 7304 var isFinal = false; |
| 7295 if (node.modifiers != null && node.modifiers.$index(0).kind == 96/*TokenKind.F
INAL*/) { | 7305 if (node.modifiers != null && node.modifiers.$index(0).kind == 96/*TokenKind.F
INAL*/) { |
| 7296 isFinal = true; | 7306 isFinal = true; |
| 7297 } | 7307 } |
| 7298 this.writer.write('var '); | 7308 this.writer.write('var '); |
| 7299 var type = this.method.resolveType(node.type); | 7309 var type = this.method.resolveType(node.type); |
| 7300 for (var i = 0; | 7310 for (var i = 0; |
| 7301 i < node.names.length; i++) { | 7311 i < node.names.length; i++) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 7315 } | 7325 } |
| 7316 var val = this._scope.create(name, thisType, node.names.$index(i)); | 7326 var val = this._scope.create(name, thisType, node.names.$index(i)); |
| 7317 if (value == null) { | 7327 if (value == null) { |
| 7318 this.writer.write(('' + val.code + '')); | 7328 this.writer.write(('' + val.code + '')); |
| 7319 } | 7329 } |
| 7320 else { | 7330 else { |
| 7321 this.writer.write(('' + val.code + ' = ' + value.code + '')); | 7331 this.writer.write(('' + val.code + ' = ' + value.code + '')); |
| 7322 } | 7332 } |
| 7323 } | 7333 } |
| 7324 this.writer.writeln(';'); | 7334 this.writer.writeln(';'); |
| 7335 return false; |
| 7325 } | 7336 } |
| 7326 MethodGenerator.prototype.visitFunctionDefinition = function(node) { | 7337 MethodGenerator.prototype.visitFunctionDefinition = function(node) { |
| 7327 var name = world.toJsIdentifier(node.name.name); | 7338 var name = world.toJsIdentifier(node.name.name); |
| 7328 var meth = this._makeLambdaMethod(name, node); | 7339 var meth = this._makeLambdaMethod(name, node); |
| 7329 var funcValue = this._scope.create(name, meth.get$functionType(), this.method.
get$definition()); | 7340 var funcValue = this._scope.create(name, meth.get$functionType(), this.method.
get$definition()); |
| 7330 meth.generator.writeDefinition(this.writer, null); | 7341 meth.generator.writeDefinition(this.writer, null); |
| 7342 return false; |
| 7331 } | 7343 } |
| 7332 MethodGenerator.prototype.visitReturnStatement = function(node) { | 7344 MethodGenerator.prototype.visitReturnStatement = function(node) { |
| 7333 if (node.value == null) { | 7345 if (node.value == null) { |
| 7334 this.writer.writeln('return;'); | 7346 this.writer.writeln('return;'); |
| 7335 } | 7347 } |
| 7336 else { | 7348 else { |
| 7337 if (this.method.get$isConstructor()) { | 7349 if (this.method.get$isConstructor()) { |
| 7338 world.error('return of value not allowed from constructor', node.span); | 7350 world.error('return of value not allowed from constructor', node.span); |
| 7339 } | 7351 } |
| 7340 this.writer.writeln(('return ' + this.visitValue(node.value).code + ';')); | 7352 this.writer.writeln(('return ' + this.visitValue(node.value).code + ';')); |
| 7341 } | 7353 } |
| 7354 return true; |
| 7342 } | 7355 } |
| 7343 MethodGenerator.prototype.visitThrowStatement = function(node) { | 7356 MethodGenerator.prototype.visitThrowStatement = function(node) { |
| 7344 if (node.value != null) { | 7357 if (node.value != null) { |
| 7345 var value = this.visitValue(node.value); | 7358 var value = this.visitValue(node.value); |
| 7346 value.invoke(this.parent, 'toString', node, Arguments.get$EMPTY()); | 7359 value.invoke(this.parent, 'toString', node, Arguments.get$EMPTY()); |
| 7347 this.writer.writeln(('\$throw(' + value.code + ');')); | 7360 this.writer.writeln(('\$throw(' + value.code + ');')); |
| 7348 } | 7361 } |
| 7349 else { | 7362 else { |
| 7350 var rethrow = this._scope.getRethrow(); | 7363 var rethrow = this._scope.getRethrow(); |
| 7351 if (rethrow == null) { | 7364 if (rethrow == null) { |
| 7352 world.error('rethrow outside of catch', node.span); | 7365 world.error('rethrow outside of catch', node.span); |
| 7353 } | 7366 } |
| 7354 else { | 7367 else { |
| 7355 this.writer.writeln(('throw ' + rethrow.code + ';')); | 7368 this.writer.writeln(('throw ' + rethrow.code + ';')); |
| 7356 } | 7369 } |
| 7357 } | 7370 } |
| 7371 return true; |
| 7358 } | 7372 } |
| 7359 MethodGenerator.prototype.visitAssertStatement = function(node) { | 7373 MethodGenerator.prototype.visitAssertStatement = function(node) { |
| 7360 var test = this.visitValue(node.test); | 7374 var test = this.visitValue(node.test); |
| 7361 if (options.enableAsserts) { | 7375 if (options.enableAsserts) { |
| 7362 var err = world.corelib.types.$index('AssertError'); | 7376 var err = world.corelib.types.$index('AssertError'); |
| 7363 err.markUsed(); | 7377 err.markUsed(); |
| 7364 this.parent.genMethod(err.getConstructor('')); | 7378 this.parent.genMethod(err.getConstructor('')); |
| 7365 this.parent.genMethod(err.members.$index('toString')); | 7379 this.parent.genMethod(err.members.$index('toString')); |
| 7366 var span = node.test.span; | 7380 var span = node.test.span; |
| 7367 var line = span.file.getLine(span.start); | 7381 var line = span.file.getLine(span.start); |
| 7368 var column = span.file.getColumn(line, span.start); | 7382 var column = span.file.getColumn(line, span.start); |
| 7369 this.writer.writeln(('\$assert(' + test.code + ', "' + MethodGenerator._esca
peString(span.get$text()) + '",') + (' "' + span.file.filename + '", ' + (line +
1) + ', ' + (column + 1) + ');')); | 7383 this.writer.writeln(('\$assert(' + test.code + ', "' + MethodGenerator._esca
peString(span.get$text()) + '",') + (' "' + span.file.filename + '", ' + (line +
1) + ', ' + (column + 1) + ');')); |
| 7370 } | 7384 } |
| 7385 return false; |
| 7371 } | 7386 } |
| 7372 MethodGenerator.prototype.visitBreakStatement = function(node) { | 7387 MethodGenerator.prototype.visitBreakStatement = function(node) { |
| 7373 if (node.label == null) { | 7388 if (node.label == null) { |
| 7374 this.writer.writeln('break;'); | 7389 this.writer.writeln('break;'); |
| 7375 } | 7390 } |
| 7376 else { | 7391 else { |
| 7377 this.writer.writeln(('break ' + node.label.name + ';')); | 7392 this.writer.writeln(('break ' + node.label.name + ';')); |
| 7378 } | 7393 } |
| 7394 return true; |
| 7379 } | 7395 } |
| 7380 MethodGenerator.prototype.visitContinueStatement = function(node) { | 7396 MethodGenerator.prototype.visitContinueStatement = function(node) { |
| 7381 if (node.label == null) { | 7397 if (node.label == null) { |
| 7382 this.writer.writeln('continue;'); | 7398 this.writer.writeln('continue;'); |
| 7383 } | 7399 } |
| 7384 else { | 7400 else { |
| 7385 this.writer.writeln(('continue ' + node.label.name + ';')); | 7401 this.writer.writeln(('continue ' + node.label.name + ';')); |
| 7386 } | 7402 } |
| 7403 return true; |
| 7387 } | 7404 } |
| 7388 MethodGenerator.prototype.visitIfStatement = function(node) { | 7405 MethodGenerator.prototype.visitIfStatement = function(node) { |
| 7389 var test = this.visitBool(node.test); | 7406 var test = this.visitBool(node.test); |
| 7390 this.writer.write(('if (' + test.code + ') ')); | 7407 this.writer.write(('if (' + test.code + ') ')); |
| 7391 node.trueBranch.visit(this); | 7408 var exit1 = node.trueBranch.visit(this); |
| 7392 if (node.falseBranch != null) { | 7409 if (node.falseBranch != null) { |
| 7393 this.writer.write('else '); | 7410 this.writer.write('else '); |
| 7394 node.falseBranch.visit(this); | 7411 if (node.falseBranch.visit(this) && exit1) { |
| 7412 return true; |
| 7413 } |
| 7395 } | 7414 } |
| 7415 return false; |
| 7396 } | 7416 } |
| 7397 MethodGenerator.prototype.visitWhileStatement = function(node) { | 7417 MethodGenerator.prototype.visitWhileStatement = function(node) { |
| 7398 var test = this.visitBool(node.test); | 7418 var test = this.visitBool(node.test); |
| 7399 this.writer.write(('while (' + test.code + ') ')); | 7419 this.writer.write(('while (' + test.code + ') ')); |
| 7400 this._pushBlock(true); | 7420 this._pushBlock(true); |
| 7401 node.body.visit(this); | 7421 node.body.visit(this); |
| 7402 this._popBlock(); | 7422 this._popBlock(); |
| 7423 return false; |
| 7403 } | 7424 } |
| 7404 MethodGenerator.prototype.visitDoStatement = function(node) { | 7425 MethodGenerator.prototype.visitDoStatement = function(node) { |
| 7405 this.writer.write('do '); | 7426 this.writer.write('do '); |
| 7406 this._pushBlock(true); | 7427 this._pushBlock(true); |
| 7407 node.body.visit(this); | 7428 node.body.visit(this); |
| 7408 this._popBlock(); | 7429 this._popBlock(); |
| 7409 var test = this.visitBool(node.test); | 7430 var test = this.visitBool(node.test); |
| 7410 this.writer.writeln(('while (' + test.code + ')')); | 7431 this.writer.writeln(('while (' + test.code + ')')); |
| 7432 return false; |
| 7411 } | 7433 } |
| 7412 MethodGenerator.prototype.visitForStatement = function(node) { | 7434 MethodGenerator.prototype.visitForStatement = function(node) { |
| 7413 this._pushBlock(false); | 7435 this._pushBlock(false); |
| 7414 this.writer.write('for ('); | 7436 this.writer.write('for ('); |
| 7415 if (node.init != null) node.init.visit(this); | 7437 if (node.init != null) node.init.visit(this); |
| 7416 else this.writer.write(';'); | 7438 else this.writer.write(';'); |
| 7417 if (node.test != null) { | 7439 if (node.test != null) { |
| 7418 var test = this.visitBool(node.test); | 7440 var test = this.visitBool(node.test); |
| 7419 this.writer.write((' ' + test.code + '; ')); | 7441 this.writer.write((' ' + test.code + '; ')); |
| 7420 } | 7442 } |
| 7421 else { | 7443 else { |
| 7422 this.writer.write('; '); | 7444 this.writer.write('; '); |
| 7423 } | 7445 } |
| 7424 var needsComma = false; | 7446 var needsComma = false; |
| 7425 var $list = node.step; | 7447 var $list = node.step; |
| 7426 for (var $i = 0;$i < $list.length; $i++) { | 7448 for (var $i = 0;$i < $list.length; $i++) { |
| 7427 var s = $list.$index($i); | 7449 var s = $list.$index($i); |
| 7428 if (needsComma) this.writer.write(', '); | 7450 if (needsComma) this.writer.write(', '); |
| 7429 var sv = this.visitVoid(s); | 7451 var sv = this.visitVoid(s); |
| 7430 this.writer.write(sv.code); | 7452 this.writer.write(sv.code); |
| 7431 needsComma = true; | 7453 needsComma = true; |
| 7432 } | 7454 } |
| 7433 this.writer.write(') '); | 7455 this.writer.write(') '); |
| 7434 this._pushBlock(true); | 7456 this._pushBlock(true); |
| 7435 node.body.visit(this); | 7457 node.body.visit(this); |
| 7436 this._popBlock(); | 7458 this._popBlock(); |
| 7437 this._popBlock(); | 7459 this._popBlock(); |
| 7460 return false; |
| 7438 } | 7461 } |
| 7439 MethodGenerator.prototype.visitForInStatement = function(node) { | 7462 MethodGenerator.prototype.visitForInStatement = function(node) { |
| 7440 var itemType = this.method.resolveType(node.item.type); | 7463 var itemType = this.method.resolveType(node.item.type); |
| 7441 var itemName = node.item.name.name; | 7464 var itemName = node.item.name.name; |
| 7442 var list = node.list.visit(this); | 7465 var list = node.list.visit(this); |
| 7443 this._pushBlock(true); | 7466 this._pushBlock(true); |
| 7444 var item = this._scope.create(itemName, itemType, node.item.name); | 7467 var item = this._scope.create(itemName, itemType, node.item.name); |
| 7445 var listVar = list; | 7468 var listVar = list; |
| 7446 if (list.needsTemp) { | 7469 if (list.needsTemp) { |
| 7447 listVar = this._scope.create('\$list', list.type, null); | 7470 listVar = this._scope.create('\$list', list.type, null); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 7460 var iterator = list.invoke(this.parent, 'iterator', node.list, Arguments.get
$EMPTY()); | 7483 var iterator = list.invoke(this.parent, 'iterator', node.list, Arguments.get
$EMPTY()); |
| 7461 var tmpi = this._scope.create('\$i', iterator.type, null); | 7484 var tmpi = this._scope.create('\$i', iterator.type, null); |
| 7462 var hasNext = tmpi.invoke(this.parent, 'hasNext', node.list, Arguments.get$E
MPTY()); | 7485 var hasNext = tmpi.invoke(this.parent, 'hasNext', node.list, Arguments.get$E
MPTY()); |
| 7463 var next = tmpi.invoke(this.parent, 'next', node.list, Arguments.get$EMPTY()
); | 7486 var next = tmpi.invoke(this.parent, 'next', node.list, Arguments.get$EMPTY()
); |
| 7464 this.writer.enterBlock(('for (var ' + tmpi.code + ' = ' + iterator.code + ';
' + hasNext.code + '; ) {')); | 7487 this.writer.enterBlock(('for (var ' + tmpi.code + ' = ' + iterator.code + ';
' + hasNext.code + '; ) {')); |
| 7465 this.writer.writeln(('var ' + item.code + ' = ' + next.code + ';')); | 7488 this.writer.writeln(('var ' + item.code + ' = ' + next.code + ';')); |
| 7466 } | 7489 } |
| 7467 this.visitStatementsInBlock(node.body); | 7490 this.visitStatementsInBlock(node.body); |
| 7468 this.writer.exitBlock('}'); | 7491 this.writer.exitBlock('}'); |
| 7469 this._popBlock(); | 7492 this._popBlock(); |
| 7493 return false; |
| 7470 } | 7494 } |
| 7471 MethodGenerator.prototype.visitTryStatement = function(node) { | 7495 MethodGenerator.prototype.visitTryStatement = function(node) { |
| 7472 this.writer.enterBlock('try {'); | 7496 this.writer.enterBlock('try {'); |
| 7473 this._pushBlock(false); | 7497 this._pushBlock(false); |
| 7474 this.visitStatementsInBlock(node.body); | 7498 this.visitStatementsInBlock(node.body); |
| 7475 this._popBlock(); | 7499 this._popBlock(); |
| 7476 if (node.catches.length == 1) { | 7500 if (node.catches.length == 1) { |
| 7477 var catch_ = node.catches.$index(0); | 7501 var catch_ = node.catches.$index(0); |
| 7478 this._pushBlock(false); | 7502 this._pushBlock(false); |
| 7479 var ex = this._scope.declare(catch_.exception); | 7503 var ex = this._scope.declare(catch_.exception); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7538 } | 7562 } |
| 7539 this._popBlock(); | 7563 this._popBlock(); |
| 7540 } | 7564 } |
| 7541 if (node.finallyBlock != null) { | 7565 if (node.finallyBlock != null) { |
| 7542 this.writer.nextBlock('} finally {'); | 7566 this.writer.nextBlock('} finally {'); |
| 7543 this._pushBlock(false); | 7567 this._pushBlock(false); |
| 7544 this.visitStatementsInBlock(node.finallyBlock); | 7568 this.visitStatementsInBlock(node.finallyBlock); |
| 7545 this._popBlock(); | 7569 this._popBlock(); |
| 7546 } | 7570 } |
| 7547 this.writer.exitBlock('}'); | 7571 this.writer.exitBlock('}'); |
| 7572 return false; |
| 7548 } | 7573 } |
| 7549 MethodGenerator.prototype.visitSwitchStatement = function(node) { | 7574 MethodGenerator.prototype.visitSwitchStatement = function(node) { |
| 7550 var test = this.visitValue(node.test); | 7575 var test = this.visitValue(node.test); |
| 7551 this.writer.enterBlock(('switch (' + test.code + ') {')); | 7576 this.writer.enterBlock(('switch (' + test.code + ') {')); |
| 7552 var $list = node.cases; | 7577 var $list = node.cases; |
| 7553 for (var $i = 0;$i < $list.length; $i++) { | 7578 for (var $i = 0;$i < $list.length; $i++) { |
| 7554 var case_ = $list.$index($i); | 7579 var case_ = $list.$index($i); |
| 7555 if (case_.label != null) { | 7580 if (case_.label != null) { |
| 7556 world.error('unimplemented: labeled case statement', case_.get$span()); | 7581 world.error('unimplemented: labeled case statement', case_.get$span()); |
| 7557 } | 7582 } |
| 7558 this._pushBlock(false); | 7583 this._pushBlock(false); |
| 7559 for (var i = 0; | 7584 for (var i = 0; |
| 7560 i < case_.cases.length; i++) { | 7585 i < case_.cases.length; i++) { |
| 7561 var expr = case_.cases.$index(i); | 7586 var expr = case_.cases.$index(i); |
| 7562 if (expr == null) { | 7587 if (expr == null) { |
| 7563 if (i < case_.cases.length - 1) { | 7588 if (i < case_.cases.length - 1) { |
| 7564 world.error('default clause must be the last case', case_.get$span()); | 7589 world.error('default clause must be the last case', case_.get$span()); |
| 7565 } | 7590 } |
| 7566 this.writer.writeln('default:'); | 7591 this.writer.writeln('default:'); |
| 7567 } | 7592 } |
| 7568 else { | 7593 else { |
| 7569 var value = this.visitValue(expr); | 7594 var value = this.visitValue(expr); |
| 7570 this.writer.writeln(('case ' + value.code + ':')); | 7595 this.writer.writeln(('case ' + value.code + ':')); |
| 7571 } | 7596 } |
| 7572 } | 7597 } |
| 7573 this.writer.enterBlock(''); | 7598 this.writer.enterBlock(''); |
| 7574 var $list0 = case_.statements; | 7599 var caseExits = this._visitAllStatements(case_.statements, false); |
| 7575 for (var $i0 = case_.statements.iterator(); $i0.hasNext(); ) { | 7600 if ($ne(case_, node.cases.$index(node.cases.length - 1)) && !caseExits) { |
| 7576 var stmt = $i0.next(); | |
| 7577 stmt.visit(this); | |
| 7578 } | |
| 7579 if ($ne(case_, node.cases.$index(node.cases.length - 1))) { | |
| 7580 var span = case_.statements.$index(case_.statements.length - 1).get$span()
; | 7601 var span = case_.statements.$index(case_.statements.length - 1).get$span()
; |
| 7602 this.writer.writeln(('\$throw(new FallThroughError("' + span.file.filename
+ '",') + (' ' + span.file.getLine(span.start) + '))')); |
| 7581 } | 7603 } |
| 7582 this.writer.exitBlock(''); | 7604 this.writer.exitBlock(''); |
| 7583 this._popBlock(); | 7605 this._popBlock(); |
| 7584 } | 7606 } |
| 7585 this.writer.exitBlock('}'); | 7607 this.writer.exitBlock('}'); |
| 7608 return false; |
| 7609 } |
| 7610 MethodGenerator.prototype._visitAllStatements = function(statementList, exits) { |
| 7611 for (var i = 0; |
| 7612 i < statementList.length; i++) { |
| 7613 var stmt = statementList.$index(i); |
| 7614 exits = stmt.visit(this); |
| 7615 if ($ne(stmt, statementList.$index(statementList.length - 1)) && exits) { |
| 7616 world.warning('unreachable code', statementList.$index(i + 1).get$span()); |
| 7617 } |
| 7618 } |
| 7619 return exits; |
| 7586 } | 7620 } |
| 7587 MethodGenerator.prototype.visitBlockStatement = function(node) { | 7621 MethodGenerator.prototype.visitBlockStatement = function(node) { |
| 7588 this._pushBlock(false); | 7622 this._pushBlock(false); |
| 7589 this.writer.enterBlock('{'); | 7623 this.writer.enterBlock('{'); |
| 7590 var $list = node.body; | 7624 var exits = this._visitAllStatements(node.body, false); |
| 7591 for (var $i = 0;$i < $list.length; $i++) { | |
| 7592 var stmt = $list.$index($i); | |
| 7593 stmt.visit(this); | |
| 7594 } | |
| 7595 this.writer.exitBlock('}'); | 7625 this.writer.exitBlock('}'); |
| 7596 this._popBlock(); | 7626 this._popBlock(); |
| 7627 return exits; |
| 7597 } | 7628 } |
| 7598 MethodGenerator.prototype.visitLabeledStatement = function(node) { | 7629 MethodGenerator.prototype.visitLabeledStatement = function(node) { |
| 7599 this.writer.writeln(('' + node.name.name + ':')); | 7630 this.writer.writeln(('' + node.name.name + ':')); |
| 7600 node.body.visit(this); | 7631 node.body.visit(this); |
| 7632 return false; |
| 7601 } | 7633 } |
| 7602 MethodGenerator.prototype.visitExpressionStatement = function(node) { | 7634 MethodGenerator.prototype.visitExpressionStatement = function(node) { |
| 7603 if ((node.body instanceof VarExpression) || (node.body instanceof ThisExpressi
on)) { | 7635 if ((node.body instanceof VarExpression) || (node.body instanceof ThisExpressi
on)) { |
| 7604 world.warning('variable used as statement', node.span); | 7636 world.warning('variable used as statement', node.span); |
| 7605 } | 7637 } |
| 7606 var value = this.visitVoid(node.body); | 7638 var value = this.visitVoid(node.body); |
| 7607 this.writer.writeln(('' + value.code + ';')); | 7639 this.writer.writeln(('' + value.code + ';')); |
| 7640 return false; |
| 7608 } | 7641 } |
| 7609 MethodGenerator.prototype.visitEmptyStatement = function(node) { | 7642 MethodGenerator.prototype.visitEmptyStatement = function(node) { |
| 7610 this.writer.writeln(';'); | 7643 this.writer.writeln(';'); |
| 7644 return false; |
| 7611 } | 7645 } |
| 7612 MethodGenerator.prototype._checkNonStatic = function(node) { | 7646 MethodGenerator.prototype._checkNonStatic = function(node) { |
| 7613 if (this.method.get$isStatic()) { | 7647 if (this.method.get$isStatic()) { |
| 7614 world.warning('not allowed in static method', node.span); | 7648 world.warning('not allowed in static method', node.span); |
| 7615 } | 7649 } |
| 7616 } | 7650 } |
| 7617 MethodGenerator.prototype._makeSuperValue = function(node) { | 7651 MethodGenerator.prototype._makeSuperValue = function(node) { |
| 7618 var parentType = this.method.declaringType.get$parent(); | 7652 var parentType = this.method.declaringType.get$parent(); |
| 7619 this._checkNonStatic(node); | 7653 this._checkNonStatic(node); |
| 7620 if (parentType == null) { | 7654 if (parentType == null) { |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7747 } | 7781 } |
| 7748 if (x.code == 'null' || y.code == 'null') { | 7782 if (x.code == 'null' || y.code == 'null') { |
| 7749 var op = node.op.toString().substring(0, 2); | 7783 var op = node.op.toString().substring(0, 2); |
| 7750 return new Value(null, ('' + x.code + ' ' + op + ' ' + y.code + ''), false
, true, false); | 7784 return new Value(null, ('' + x.code + ' ' + op + ' ' + y.code + ''), false
, true, false); |
| 7751 } | 7785 } |
| 7752 else { | 7786 else { |
| 7753 return new Value(null, ('' + x.code + ' ' + node.op + ' ' + y.code + ''),
false, true, false); | 7787 return new Value(null, ('' + x.code + ' ' + node.op + ' ' + y.code + ''),
false, true, false); |
| 7754 } | 7788 } |
| 7755 } | 7789 } |
| 7756 var assignKind = TokenKind.kindFromAssign(node.op.kind); | 7790 var assignKind = TokenKind.kindFromAssign(node.op.kind); |
| 7757 if (assignKind == -1) { | 7791 if (assignKind == -1.000000/*-1*/) { |
| 7758 var x = this.visitValue(node.x); | 7792 var x = this.visitValue(node.x); |
| 7759 var y = this.visitValue(node.y); | 7793 var y = this.visitValue(node.y); |
| 7760 var name = TokenKind.binaryMethodName(node.op.kind); | 7794 var name = TokenKind.binaryMethodName(node.op.kind); |
| 7761 if (node.op.kind == 49/*TokenKind.NE*/) { | 7795 if (node.op.kind == 49/*TokenKind.NE*/) { |
| 7762 name = '\$ne'; | 7796 name = '\$ne'; |
| 7763 } | 7797 } |
| 7764 if (name == null) { | 7798 if (name == null) { |
| 7765 world.internalError(('unimplemented binary op ' + node.op + ''), node.span
); | 7799 world.internalError(('unimplemented binary op ' + node.op + ''), node.span
); |
| 7766 return; | 7800 return; |
| 7767 } | 7801 } |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8053 var value = EvaluatedValue.EvaluatedValue$factory(mapImplType, code, code, n
ode.span); | 8087 var value = EvaluatedValue.EvaluatedValue$factory(mapImplType, code, code, n
ode.span); |
| 8054 return this.parent.globalForConst(value, argValues); | 8088 return this.parent.globalForConst(value, argValues); |
| 8055 } | 8089 } |
| 8056 return new Value(mapImplType, code, false, true, false); | 8090 return new Value(mapImplType, code, false, true, false); |
| 8057 } | 8091 } |
| 8058 MethodGenerator.prototype.visitConditionalExpression = function(node) { | 8092 MethodGenerator.prototype.visitConditionalExpression = function(node) { |
| 8059 var test = this.visitBool(node.test); | 8093 var test = this.visitBool(node.test); |
| 8060 var trueBranch = this.visitValue(node.trueBranch); | 8094 var trueBranch = this.visitValue(node.trueBranch); |
| 8061 var falseBranch = this.visitValue(node.falseBranch); | 8095 var falseBranch = this.visitValue(node.falseBranch); |
| 8062 var code = ('' + test.code + ' ? ' + trueBranch.code + ' : ' + falseBranch.cod
e + ''); | 8096 var code = ('' + test.code + ' ? ' + trueBranch.code + ' : ' + falseBranch.cod
e + ''); |
| 8063 return new Value(lang_Type.union(trueBranch.type, falseBranch.type), code, fal
se, true, false); | 8097 return new Value(Type.union(trueBranch.type, falseBranch.type), code, false, t
rue, false); |
| 8064 } | 8098 } |
| 8065 MethodGenerator.prototype.visitIsExpression = function(node) { | 8099 MethodGenerator.prototype.visitIsExpression = function(node) { |
| 8066 var value = this.visitValue(node.x); | 8100 var value = this.visitValue(node.x); |
| 8067 var type = this.method.resolveType(node.type); | 8101 var type = this.method.resolveType(node.type); |
| 8068 return this._isTest(value, type, node.span, node.isTrue, false); | 8102 return this._isTest(value, type, node.span, node.isTrue, false); |
| 8069 } | 8103 } |
| 8070 MethodGenerator.prototype.visitParenExpression = function(node) { | 8104 MethodGenerator.prototype.visitParenExpression = function(node) { |
| 8071 var body = this.visitValue(node.body); | 8105 var body = this.visitValue(node.body); |
| 8072 if (body.get$isConst()) { | 8106 if (body.get$isConst()) { |
| 8073 return EvaluatedValue.EvaluatedValue$factory(body.type, body.get$actualValue
(), ('(' + body.canonicalCode + ')'), node.span); | 8107 return EvaluatedValue.EvaluatedValue$factory(body.type, body.get$actualValue
(), ('(' + body.canonicalCode + ')'), node.span); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8189 Arguments.prototype.getName = function(i) { | 8223 Arguments.prototype.getName = function(i) { |
| 8190 return this.nodes.$index(i).label.name; | 8224 return this.nodes.$index(i).label.name; |
| 8191 } | 8225 } |
| 8192 Arguments.prototype.getIndexOfName = function(name) { | 8226 Arguments.prototype.getIndexOfName = function(name) { |
| 8193 for (var i = this.get$bareCount(); | 8227 for (var i = this.get$bareCount(); |
| 8194 i < this.get$length(); i++) { | 8228 i < this.get$length(); i++) { |
| 8195 if (this.getName(i) == name) { | 8229 if (this.getName(i) == name) { |
| 8196 return i; | 8230 return i; |
| 8197 } | 8231 } |
| 8198 } | 8232 } |
| 8199 return -1; | 8233 return -1.000000/*-1*/; |
| 8200 } | 8234 } |
| 8201 Arguments.prototype.getValue = function(name) { | 8235 Arguments.prototype.getValue = function(name) { |
| 8202 var i = this.getIndexOfName(name); | 8236 var i = this.getIndexOfName(name); |
| 8203 return i >= 0 ? this.values.$index(i) : null; | 8237 return i >= 0 ? this.values.$index(i) : null; |
| 8204 } | 8238 } |
| 8205 Arguments.prototype.get$bareCount = function() { | 8239 Arguments.prototype.get$bareCount = function() { |
| 8206 if (this._bareCount == null) { | 8240 if (this._bareCount == null) { |
| 8207 this._bareCount = this.get$length(); | 8241 this._bareCount = this.get$length(); |
| 8208 if (this.nodes != null) { | 8242 if (this.nodes != null) { |
| 8209 for (var i = 0; | 8243 for (var i = 0; |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8448 this.sources = []; | 8482 this.sources = []; |
| 8449 this.addSource(this.library.baseSource); | 8483 this.addSource(this.library.baseSource); |
| 8450 } | 8484 } |
| 8451 LibraryVisitor.prototype.get$library = function() { return this.library; }; | 8485 LibraryVisitor.prototype.get$library = function() { return this.library; }; |
| 8452 LibraryVisitor.prototype.addSourceFromName = function(name) { | 8486 LibraryVisitor.prototype.addSourceFromName = function(name) { |
| 8453 var source = world.readFile(this.library.makeFullPath(name)); | 8487 var source = world.readFile(this.library.makeFullPath(name)); |
| 8454 this.sources.add(source); | 8488 this.sources.add(source); |
| 8455 } | 8489 } |
| 8456 LibraryVisitor.prototype.addSource = function(source) { | 8490 LibraryVisitor.prototype.addSource = function(source) { |
| 8457 this.library.sources.add(source); | 8491 this.library.sources.add(source); |
| 8458 var parser = new lang_Parser(source, options.dietParse, 0); | 8492 var parser = new Parser(source, options.dietParse, 0); |
| 8459 var unit = parser.compilationUnit(); | 8493 var unit = parser.compilationUnit(); |
| 8460 for (var $i = 0;$i < unit.length; $i++) { | 8494 for (var $i = 0;$i < unit.length; $i++) { |
| 8461 var def = unit.$index($i); | 8495 var def = unit.$index($i); |
| 8462 def.visit(this); | 8496 def.visit(this); |
| 8463 } | 8497 } |
| 8464 var newSources = this.sources; | 8498 var newSources = this.sources; |
| 8465 this.sources = []; | 8499 this.sources = []; |
| 8466 for (var $i = newSources.iterator(); $i.hasNext(); ) { | 8500 for (var $i = newSources.iterator(); $i.hasNext(); ) { |
| 8467 var source0 = $i.next(); | 8501 var source0 = $i.next(); |
| 8468 this.addSource(source0); | 8502 this.addSource(source0); |
| (...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9656 var arg = $list.$index($i); | 9690 var arg = $list.$index($i); |
| 9657 argsCode.add(arg.code); | 9691 argsCode.add(arg.code); |
| 9658 } | 9692 } |
| 9659 return new Value(returnType, ('' + target.code + '.' + this.name + '(' + Strin
gs.join(argsCode, ", ") + ')'), false, true, false); | 9693 return new Value(returnType, ('' + target.code + '.' + this.name + '(' + Strin
gs.join(argsCode, ", ") + ')'), false, true, false); |
| 9660 } | 9694 } |
| 9661 MemberSet.prototype.invokeOnVar = function(node, target, args) { | 9695 MemberSet.prototype.invokeOnVar = function(node, target, args) { |
| 9662 return this.getVarMember(node, args).invoke(node, target, args); | 9696 return this.getVarMember(node, args).invoke(node, target, args); |
| 9663 } | 9697 } |
| 9664 MemberSet.prototype._tryUnion = function(x, y, node) { | 9698 MemberSet.prototype._tryUnion = function(x, y, node) { |
| 9665 if (x == null) return y; | 9699 if (x == null) return y; |
| 9666 var type = lang_Type.union(x.type, y.type); | 9700 var type = Type.union(x.type, y.type); |
| 9667 if (x.code == y.code) { | 9701 if (x.code == y.code) { |
| 9668 if ($eq(type, x.type)) { | 9702 if ($eq(type, x.type)) { |
| 9669 return x; | 9703 return x; |
| 9670 } | 9704 } |
| 9671 else if (x.get$isConst() || y.get$isConst()) { | 9705 else if (x.get$isConst() || y.get$isConst()) { |
| 9672 world.internalError("unexpected: union of const values "); | 9706 world.internalError("unexpected: union of const values "); |
| 9673 } | 9707 } |
| 9674 else { | 9708 else { |
| 9675 return new Value(type, x.code, x.isSuper && y.isSuper, x.needsTemp || y.ne
edsTemp, x.isType && y.isType); | 9709 return new Value(type, x.code, x.isSuper && y.isSuper, x.needsTemp || y.ne
edsTemp, x.isType && y.isType); |
| 9676 } | 9710 } |
| 9677 } | 9711 } |
| 9678 else { | 9712 else { |
| 9679 return new Value(type, null, false, true, false); | 9713 return new Value(type, null, false, true, false); |
| 9680 } | 9714 } |
| 9681 } | 9715 } |
| 9682 MemberSet.prototype.getVarMember = function(node, args) { | 9716 MemberSet.prototype.getVarMember = function(node, args) { |
| 9683 if (world.objectType.varStubs == null) { | 9717 if (world.objectType.varStubs == null) { |
| 9684 world.objectType.varStubs = $map([]); | 9718 world.objectType.varStubs = $map([]); |
| 9685 } | 9719 } |
| 9686 var stubName = _getCallStubName(this.name, args); | 9720 var stubName = _getCallStubName(this.name, args); |
| 9687 var stub = world.objectType.varStubs.$index(stubName); | 9721 var stub = world.objectType.varStubs.$index(stubName); |
| 9688 if (stub == null) { | 9722 if (stub == null) { |
| 9689 var targets = this.members.filter((function (m) { | 9723 var targets = this.members.filter((function (m) { |
| 9690 return m.canInvoke(args); | 9724 return m.canInvoke(args); |
| 9691 }) | 9725 }) |
| 9692 ); | 9726 ); |
| 9693 var returnType = reduce(map(targets, (function (t) { | 9727 var returnType = reduce(map(targets, (function (t) { |
| 9694 return t.get$returnType(); | 9728 return t.get$returnType(); |
| 9695 }) | 9729 }) |
| 9696 ), lang_Type.union); | 9730 ), Type.union); |
| 9697 stub = new VarMethodSet(stubName, targets, args, returnType); | 9731 stub = new VarMethodSet(stubName, targets, args, returnType); |
| 9698 world.objectType.varStubs.$setindex(stubName, stub); | 9732 world.objectType.varStubs.$setindex(stubName, stub); |
| 9699 } | 9733 } |
| 9700 return stub; | 9734 return stub; |
| 9701 } | 9735 } |
| 9702 // ********** Code for FactoryMap ************** | 9736 // ********** Code for FactoryMap ************** |
| 9703 function FactoryMap() { | 9737 function FactoryMap() { |
| 9704 this.factories = $map([]); | 9738 this.factories = $map([]); |
| 9705 // Initializers done | 9739 // Initializers done |
| 9706 } | 9740 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 9721 FactoryMap.prototype.forEach = function(f) { | 9755 FactoryMap.prototype.forEach = function(f) { |
| 9722 this.factories.forEach((function (_, constructors) { | 9756 this.factories.forEach((function (_, constructors) { |
| 9723 constructors.forEach((function (_0, member) { | 9757 constructors.forEach((function (_0, member) { |
| 9724 f(member); | 9758 f(member); |
| 9725 }) | 9759 }) |
| 9726 ); | 9760 ); |
| 9727 }) | 9761 }) |
| 9728 ); | 9762 ); |
| 9729 } | 9763 } |
| 9730 $defineMethod(FactoryMap, "forEach$1", FactoryMap.prototype.forEach); | 9764 $defineMethod(FactoryMap, "forEach$1", FactoryMap.prototype.forEach); |
| 9731 // ********** Code for lang_Token ************** | 9765 // ********** Code for Token ************** |
| 9732 function lang_Token(kind, source, start, end) { | 9766 function Token(kind, source, start, end) { |
| 9733 this.kind = kind; | 9767 this.kind = kind; |
| 9734 this.source = source; | 9768 this.source = source; |
| 9735 this.start = start; | 9769 this.start = start; |
| 9736 this.end = end; | 9770 this.end = end; |
| 9737 // Initializers done | 9771 // Initializers done |
| 9738 } | 9772 } |
| 9739 lang_Token.prototype.get$text = function() { | 9773 Token.prototype.get$text = function() { |
| 9740 return this.source.get$text().substring(this.start, this.end); | 9774 return this.source.get$text().substring(this.start, this.end); |
| 9741 } | 9775 } |
| 9742 lang_Token.prototype.toString = function() { | 9776 Token.prototype.toString = function() { |
| 9743 var kindText = TokenKind.kindToString(this.kind); | 9777 var kindText = TokenKind.kindToString(this.kind); |
| 9744 var actualText = this.get$text(); | 9778 var actualText = this.get$text(); |
| 9745 if ($ne(kindText, actualText)) { | 9779 if ($ne(kindText, actualText)) { |
| 9746 if (actualText.length > 10) { | 9780 if (actualText.length > 10) { |
| 9747 actualText = actualText.substring(0, 8) + '...'; | 9781 actualText = actualText.substring(0, 8) + '...'; |
| 9748 } | 9782 } |
| 9749 return ('' + kindText + '(' + actualText + ')'); | 9783 return ('' + kindText + '(' + actualText + ')'); |
| 9750 } | 9784 } |
| 9751 else { | 9785 else { |
| 9752 return kindText; | 9786 return kindText; |
| 9753 } | 9787 } |
| 9754 } | 9788 } |
| 9755 lang_Token.prototype.get$span = function() { | 9789 Token.prototype.get$span = function() { |
| 9756 return new SourceSpan(this.source, this.start, this.end); | 9790 return new SourceSpan(this.source, this.start, this.end); |
| 9757 } | 9791 } |
| 9758 // ********** Code for SourceFile ************** | 9792 // ********** Code for SourceFile ************** |
| 9759 function SourceFile(filename, _text) { | 9793 function SourceFile(filename, _text) { |
| 9760 this.filename = filename; | 9794 this.filename = filename; |
| 9761 this._text = _text; | 9795 this._text = _text; |
| 9762 // Initializers done | 9796 // Initializers done |
| 9763 } | 9797 } |
| 9764 SourceFile.prototype.get$text = function() { | 9798 SourceFile.prototype.get$text = function() { |
| 9765 return this._text; | 9799 return this._text; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9845 var d = this.start - other.start; | 9879 var d = this.start - other.start; |
| 9846 return d == 0 ? (this.end - other.end) : d; | 9880 return d == 0 ? (this.end - other.end) : d; |
| 9847 } | 9881 } |
| 9848 return this.file.compareTo(other.file); | 9882 return this.file.compareTo(other.file); |
| 9849 } | 9883 } |
| 9850 // ********** Code for InterpStack ************** | 9884 // ********** Code for InterpStack ************** |
| 9851 function InterpStack(previous, quote, isMultiline) { | 9885 function InterpStack(previous, quote, isMultiline) { |
| 9852 this.previous = previous; | 9886 this.previous = previous; |
| 9853 this.quote = quote; | 9887 this.quote = quote; |
| 9854 this.isMultiline = isMultiline; | 9888 this.isMultiline = isMultiline; |
| 9855 this.depth = -1; | 9889 this.depth = -1.000000/*-1*/; |
| 9856 // Initializers done | 9890 // Initializers done |
| 9857 } | 9891 } |
| 9858 InterpStack.prototype.pop = function() { | 9892 InterpStack.prototype.pop = function() { |
| 9859 return this.previous; | 9893 return this.previous; |
| 9860 } | 9894 } |
| 9861 InterpStack.push = function(stack, quote, isMultiline) { | 9895 InterpStack.push = function(stack, quote, isMultiline) { |
| 9862 var newStack = new InterpStack(stack, quote, isMultiline); | 9896 var newStack = new InterpStack(stack, quote, isMultiline); |
| 9863 if (stack != null) newStack.previous = stack; | 9897 if (stack != null) newStack.previous = stack; |
| 9864 return newStack; | 9898 return newStack; |
| 9865 } | 9899 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 9896 } | 9930 } |
| 9897 else { | 9931 else { |
| 9898 return false; | 9932 return false; |
| 9899 } | 9933 } |
| 9900 } | 9934 } |
| 9901 else { | 9935 else { |
| 9902 return false; | 9936 return false; |
| 9903 } | 9937 } |
| 9904 } | 9938 } |
| 9905 TokenizerBase.prototype._finishToken = function(kind) { | 9939 TokenizerBase.prototype._finishToken = function(kind) { |
| 9906 return new lang_Token(kind, this._source, this._startIndex, this._lang_index); | 9940 return new Token(kind, this._source, this._startIndex, this._lang_index); |
| 9907 } | 9941 } |
| 9908 TokenizerBase.prototype._errorToken = function() { | 9942 TokenizerBase.prototype._errorToken = function() { |
| 9909 return this._finishToken(64/*TokenKind.ERROR*/); | 9943 return this._finishToken(64/*TokenKind.ERROR*/); |
| 9910 } | 9944 } |
| 9911 TokenizerBase.prototype.finishWhitespace = function() { | 9945 TokenizerBase.prototype.finishWhitespace = function() { |
| 9912 while (this._lang_index < this._text.length) { | 9946 while (this._lang_index < this._text.length) { |
| 9913 if (!TokenizerHelpers.isWhitespace(this._text.charCodeAt(this._lang_index++)
)) { | 9947 if (!TokenizerHelpers.isWhitespace(this._text.charCodeAt(this._lang_index++)
)) { |
| 9914 this._lang_index--; | 9948 this._lang_index--; |
| 9915 return this.next(); | 9949 return this.next(); |
| 9916 } | 9950 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10034 else if (ch == 92) { | 10068 else if (ch == 92) { |
| 10035 if (!this.eatEscapeSequence()) { | 10069 if (!this.eatEscapeSequence()) { |
| 10036 return this._errorToken(); | 10070 return this._errorToken(); |
| 10037 } | 10071 } |
| 10038 } | 10072 } |
| 10039 } | 10073 } |
| 10040 } | 10074 } |
| 10041 TokenizerBase.prototype._finishOpenBrace = function() { | 10075 TokenizerBase.prototype._finishOpenBrace = function() { |
| 10042 var $0; | 10076 var $0; |
| 10043 if (this._interpStack != null) { | 10077 if (this._interpStack != null) { |
| 10044 if (this._interpStack.depth == -1) { | 10078 if (this._interpStack.depth == -1.000000/*-1*/) { |
| 10045 this._interpStack.depth = 1; | 10079 this._interpStack.depth = 1; |
| 10046 } | 10080 } |
| 10047 else { | 10081 else { |
| 10048 ($0 = this._interpStack).depth = $0.depth + 1; | 10082 ($0 = this._interpStack).depth = $0.depth + 1; |
| 10049 } | 10083 } |
| 10050 } | 10084 } |
| 10051 return this._finishToken(6/*TokenKind.LBRACE*/); | 10085 return this._finishToken(6/*TokenKind.LBRACE*/); |
| 10052 } | 10086 } |
| 10053 TokenizerBase.prototype._finishCloseBrace = function() { | 10087 TokenizerBase.prototype._finishCloseBrace = function() { |
| 10054 var $0; | 10088 var $0; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10148 else { | 10182 else { |
| 10149 return false; | 10183 return false; |
| 10150 } | 10184 } |
| 10151 } | 10185 } |
| 10152 | 10186 |
| 10153 default: | 10187 default: |
| 10154 | 10188 |
| 10155 return true; | 10189 return true; |
| 10156 | 10190 |
| 10157 } | 10191 } |
| 10158 var n = lang_Parser.parseHex(hex); | 10192 var n = Parser.parseHex(hex); |
| 10159 return n < 0xD800 || n > 0xDFFF && n <= 0x10FFFF; | 10193 return n < 0xD800 || n > 0xDFFF && n <= 0x10FFFF; |
| 10160 } | 10194 } |
| 10161 TokenizerBase.prototype.finishDot = function() { | 10195 TokenizerBase.prototype.finishDot = function() { |
| 10162 if (TokenizerHelpers.isDigit(this._peekChar())) { | 10196 if (TokenizerHelpers.isDigit(this._peekChar())) { |
| 10163 this.eatDigits(); | 10197 this.eatDigits(); |
| 10164 return this.finishNumberExtra(); | 10198 return this.finishNumberExtra(); |
| 10165 } | 10199 } |
| 10166 else { | 10200 else { |
| 10167 return this._finishToken(14/*TokenKind.DOT*/); | 10201 return this._finishToken(14/*TokenKind.DOT*/); |
| 10168 } | 10202 } |
| 10169 } | 10203 } |
| 10170 TokenizerBase.prototype.finishIdentifier = function() { | 10204 TokenizerBase.prototype.finishIdentifier = function() { |
| 10171 while (this._lang_index < this._text.length) { | 10205 while (this._lang_index < this._text.length) { |
| 10172 if (!TokenizerHelpers.isIdentifierPart(this._text.charCodeAt(this._lang_inde
x++))) { | 10206 if (!TokenizerHelpers.isIdentifierPart(this._text.charCodeAt(this._lang_inde
x++))) { |
| 10173 this._lang_index--; | 10207 this._lang_index--; |
| 10174 break; | 10208 break; |
| 10175 } | 10209 } |
| 10176 } | 10210 } |
| 10177 var kind = this.getIdentifierKind(); | 10211 var kind = this.getIdentifierKind(); |
| 10178 if (this._interpStack != null && this._interpStack.depth == -1) { | 10212 if (this._interpStack != null && this._interpStack.depth == -1.000000/*-1*/) { |
| 10179 this._interpStack.depth = 0; | 10213 this._interpStack.depth = 0; |
| 10180 } | 10214 } |
| 10181 if (kind == 69/*TokenKind.IDENTIFIER*/) { | 10215 if (kind == 69/*TokenKind.IDENTIFIER*/) { |
| 10182 return this._finishToken(69/*TokenKind.IDENTIFIER*/); | 10216 return this._finishToken(69/*TokenKind.IDENTIFIER*/); |
| 10183 } | 10217 } |
| 10184 else { | 10218 else { |
| 10185 return this._finishToken(kind); | 10219 return this._finishToken(kind); |
| 10186 } | 10220 } |
| 10187 } | 10221 } |
| 10188 // ********** Code for Tokenizer ************** | 10222 // ********** Code for Tokenizer ************** |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11339 case 55/*TokenKind.GTE*/: | 11373 case 55/*TokenKind.GTE*/: |
| 11340 | 11374 |
| 11341 return 10; | 11375 return 10; |
| 11342 | 11376 |
| 11343 case 101/*TokenKind.IS*/: | 11377 case 101/*TokenKind.IS*/: |
| 11344 | 11378 |
| 11345 return 10; | 11379 return 10; |
| 11346 | 11380 |
| 11347 default: | 11381 default: |
| 11348 | 11382 |
| 11349 return -1; | 11383 return -1.000000/*-1*/; |
| 11350 | 11384 |
| 11351 } | 11385 } |
| 11352 } | 11386 } |
| 11353 TokenKind.rawOperatorFromMethod = function(name) { | 11387 TokenKind.rawOperatorFromMethod = function(name) { |
| 11354 switch (name) { | 11388 switch (name) { |
| 11355 case '\$bit_not': | 11389 case '\$bit_not': |
| 11356 | 11390 |
| 11357 return '~'; | 11391 return '~'; |
| 11358 | 11392 |
| 11359 case '\$bit_or': | 11393 case '\$bit_or': |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11518 | 11552 |
| 11519 case 57/*TokenKind.SETINDEX*/: | 11553 case 57/*TokenKind.SETINDEX*/: |
| 11520 | 11554 |
| 11521 return '\$setindex'; | 11555 return '\$setindex'; |
| 11522 | 11556 |
| 11523 } | 11557 } |
| 11524 } | 11558 } |
| 11525 TokenKind.kindFromAssign = function(kind) { | 11559 TokenKind.kindFromAssign = function(kind) { |
| 11526 if (kind == 20/*TokenKind.ASSIGN*/) return 0; | 11560 if (kind == 20/*TokenKind.ASSIGN*/) return 0; |
| 11527 if (kind > 20/*TokenKind.ASSIGN*/ && kind <= 32/*TokenKind.ASSIGN_MOD*/) { | 11561 if (kind > 20/*TokenKind.ASSIGN*/ && kind <= 32/*TokenKind.ASSIGN_MOD*/) { |
| 11528 return kind + (15)/*(ADD - ASSIGN_ADD)*/; | 11562 return kind + (15.000000)/*(ADD - ASSIGN_ADD)*/; |
| 11529 } | 11563 } |
| 11530 return -1; | 11564 return -1.000000/*-1*/; |
| 11531 } | 11565 } |
| 11532 // ********** Code for lang_Parser ************** | 11566 // ********** Code for Parser ************** |
| 11533 function lang_Parser(source, diet, startOffset) { | 11567 function Parser(source, diet, startOffset) { |
| 11534 this.source = source; | 11568 this.source = source; |
| 11535 this.diet = diet; | 11569 this.diet = diet; |
| 11536 // Initializers done | 11570 // Initializers done |
| 11537 this.tokenizer = new Tokenizer(this.source, true, startOffset); | 11571 this.tokenizer = new Tokenizer(this.source, true, startOffset); |
| 11538 this._peekToken = this.tokenizer.next(); | 11572 this._peekToken = this.tokenizer.next(); |
| 11539 this._previousToken = null; | 11573 this._previousToken = null; |
| 11540 this._inInitializers = false; | 11574 this._inInitializers = false; |
| 11541 } | 11575 } |
| 11542 lang_Parser.prototype.isPrematureEndOfFile = function() { | 11576 Parser.prototype.isPrematureEndOfFile = function() { |
| 11543 if (this._maybeEat(1/*TokenKind.END_OF_FILE*/)) { | 11577 if (this._maybeEat(1/*TokenKind.END_OF_FILE*/)) { |
| 11544 this._lang_error('unexpected end of file', this._peekToken.get$span()); | 11578 this._lang_error('unexpected end of file', this._peekToken.get$span()); |
| 11545 return true; | 11579 return true; |
| 11546 } | 11580 } |
| 11547 else { | 11581 else { |
| 11548 return false; | 11582 return false; |
| 11549 } | 11583 } |
| 11550 } | 11584 } |
| 11551 lang_Parser.prototype._peek = function() { | 11585 Parser.prototype._peek = function() { |
| 11552 return this._peekToken.kind; | 11586 return this._peekToken.kind; |
| 11553 } | 11587 } |
| 11554 lang_Parser.prototype._lang_next = function() { | 11588 Parser.prototype._lang_next = function() { |
| 11555 this._previousToken = this._peekToken; | 11589 this._previousToken = this._peekToken; |
| 11556 this._peekToken = this.tokenizer.next(); | 11590 this._peekToken = this.tokenizer.next(); |
| 11557 return this._previousToken; | 11591 return this._previousToken; |
| 11558 } | 11592 } |
| 11559 lang_Parser.prototype._peekKind = function(kind) { | 11593 Parser.prototype._peekKind = function(kind) { |
| 11560 return this._peekToken.kind == kind; | 11594 return this._peekToken.kind == kind; |
| 11561 } | 11595 } |
| 11562 lang_Parser.prototype._peekIdentifier = function() { | 11596 Parser.prototype._peekIdentifier = function() { |
| 11563 return TokenKind.isIdentifier(this._peekToken.kind); | 11597 return TokenKind.isIdentifier(this._peekToken.kind); |
| 11564 } | 11598 } |
| 11565 lang_Parser.prototype._maybeEat = function(kind) { | 11599 Parser.prototype._maybeEat = function(kind) { |
| 11566 if (this._peekToken.kind == kind) { | 11600 if (this._peekToken.kind == kind) { |
| 11567 this._previousToken = this._peekToken; | 11601 this._previousToken = this._peekToken; |
| 11568 this._peekToken = this.tokenizer.next(); | 11602 this._peekToken = this.tokenizer.next(); |
| 11569 return true; | 11603 return true; |
| 11570 } | 11604 } |
| 11571 else { | 11605 else { |
| 11572 return false; | 11606 return false; |
| 11573 } | 11607 } |
| 11574 } | 11608 } |
| 11575 lang_Parser.prototype._eat = function(kind) { | 11609 Parser.prototype._eat = function(kind) { |
| 11576 if (!this._maybeEat(kind)) { | 11610 if (!this._maybeEat(kind)) { |
| 11577 this._errorExpected(TokenKind.kindToString(kind)); | 11611 this._errorExpected(TokenKind.kindToString(kind)); |
| 11578 } | 11612 } |
| 11579 } | 11613 } |
| 11580 lang_Parser.prototype._eatSemicolon = function() { | 11614 Parser.prototype._eatSemicolon = function() { |
| 11581 this._eat(10/*TokenKind.SEMICOLON*/); | 11615 this._eat(10/*TokenKind.SEMICOLON*/); |
| 11582 } | 11616 } |
| 11583 lang_Parser.prototype._errorExpected = function(expected) { | 11617 Parser.prototype._errorExpected = function(expected) { |
| 11584 var tok = this._lang_next(); | 11618 var tok = this._lang_next(); |
| 11585 var message = ('expected ' + expected + ', but found ' + tok + ''); | 11619 var message = ('expected ' + expected + ', but found ' + tok + ''); |
| 11586 this._lang_error(message, tok.get$span()); | 11620 this._lang_error(message, tok.get$span()); |
| 11587 } | 11621 } |
| 11588 lang_Parser.prototype._lang_error = function(message, location) { | 11622 Parser.prototype._lang_error = function(message, location) { |
| 11589 if (location == null) { | 11623 if (location == null) { |
| 11590 location = this._peekToken.get$span(); | 11624 location = this._peekToken.get$span(); |
| 11591 } | 11625 } |
| 11592 world.fatal(message, location); | 11626 world.fatal(message, location); |
| 11593 } | 11627 } |
| 11594 lang_Parser.prototype._skipBlock = function() { | 11628 Parser.prototype._skipBlock = function() { |
| 11595 var depth = 1; | 11629 var depth = 1; |
| 11596 this._eat(6/*TokenKind.LBRACE*/); | 11630 this._eat(6/*TokenKind.LBRACE*/); |
| 11597 while (true) { | 11631 while (true) { |
| 11598 var tok = this._lang_next(); | 11632 var tok = this._lang_next(); |
| 11599 if (tok.kind == 6/*TokenKind.LBRACE*/) { | 11633 if (tok.kind == 6/*TokenKind.LBRACE*/) { |
| 11600 depth += 1; | 11634 depth += 1; |
| 11601 } | 11635 } |
| 11602 else if (tok.kind == 7/*TokenKind.RBRACE*/) { | 11636 else if (tok.kind == 7/*TokenKind.RBRACE*/) { |
| 11603 depth -= 1; | 11637 depth -= 1; |
| 11604 if (depth == 0) return; | 11638 if (depth == 0) return; |
| 11605 } | 11639 } |
| 11606 else if (tok.kind == 1/*TokenKind.END_OF_FILE*/) { | 11640 else if (tok.kind == 1/*TokenKind.END_OF_FILE*/) { |
| 11607 this._lang_error('unexpected end of file during diet parse', tok.get$span(
)); | 11641 this._lang_error('unexpected end of file during diet parse', tok.get$span(
)); |
| 11608 return; | 11642 return; |
| 11609 } | 11643 } |
| 11610 } | 11644 } |
| 11611 } | 11645 } |
| 11612 lang_Parser.prototype._makeSpan = function(start) { | 11646 Parser.prototype._makeSpan = function(start) { |
| 11613 return new SourceSpan(this.source, start, this._previousToken.end); | 11647 return new SourceSpan(this.source, start, this._previousToken.end); |
| 11614 } | 11648 } |
| 11615 lang_Parser.prototype.compilationUnit = function() { | 11649 Parser.prototype.compilationUnit = function() { |
| 11616 var ret = []; | 11650 var ret = []; |
| 11617 this._maybeEat(13/*TokenKind.HASHBANG*/); | 11651 this._maybeEat(13/*TokenKind.HASHBANG*/); |
| 11618 while (this._peekKind(12/*TokenKind.HASH*/)) { | 11652 while (this._peekKind(12/*TokenKind.HASH*/)) { |
| 11619 ret.add(this.directive()); | 11653 ret.add(this.directive()); |
| 11620 } | 11654 } |
| 11621 while (!this._maybeEat(1/*TokenKind.END_OF_FILE*/)) { | 11655 while (!this._maybeEat(1/*TokenKind.END_OF_FILE*/)) { |
| 11622 ret.add(this.topLevelDefinition()); | 11656 ret.add(this.topLevelDefinition()); |
| 11623 } | 11657 } |
| 11624 return ret; | 11658 return ret; |
| 11625 } | 11659 } |
| 11626 lang_Parser.prototype.directive = function() { | 11660 Parser.prototype.directive = function() { |
| 11627 var start = this._peekToken.start; | 11661 var start = this._peekToken.start; |
| 11628 this._eat(12/*TokenKind.HASH*/); | 11662 this._eat(12/*TokenKind.HASH*/); |
| 11629 var name = this.identifier(); | 11663 var name = this.identifier(); |
| 11630 var args = this.arguments(); | 11664 var args = this.arguments(); |
| 11631 this._eatSemicolon(); | 11665 this._eatSemicolon(); |
| 11632 return new DirectiveDefinition(name, args, this._makeSpan(start)); | 11666 return new DirectiveDefinition(name, args, this._makeSpan(start)); |
| 11633 } | 11667 } |
| 11634 lang_Parser.prototype.topLevelDefinition = function() { | 11668 Parser.prototype.topLevelDefinition = function() { |
| 11635 switch (this._peek()) { | 11669 switch (this._peek()) { |
| 11636 case 72/*TokenKind.CLASS*/: | 11670 case 72/*TokenKind.CLASS*/: |
| 11637 | 11671 |
| 11638 return this.classDefinition(72/*TokenKind.CLASS*/); | 11672 return this.classDefinition(72/*TokenKind.CLASS*/); |
| 11639 | 11673 |
| 11640 case 78/*TokenKind.INTERFACE*/: | 11674 case 78/*TokenKind.INTERFACE*/: |
| 11641 | 11675 |
| 11642 return this.classDefinition(78/*TokenKind.INTERFACE*/); | 11676 return this.classDefinition(78/*TokenKind.INTERFACE*/); |
| 11643 | 11677 |
| 11644 case 86/*TokenKind.TYPEDEF*/: | 11678 case 86/*TokenKind.TYPEDEF*/: |
| 11645 | 11679 |
| 11646 return this.functionTypeAlias(); | 11680 return this.functionTypeAlias(); |
| 11647 | 11681 |
| 11648 default: | 11682 default: |
| 11649 | 11683 |
| 11650 return this.declaration(); | 11684 return this.declaration(); |
| 11651 | 11685 |
| 11652 } | 11686 } |
| 11653 } | 11687 } |
| 11654 lang_Parser.prototype.classDefinition = function(kind) { | 11688 Parser.prototype.classDefinition = function(kind) { |
| 11655 var start = this._peekToken.start; | 11689 var start = this._peekToken.start; |
| 11656 this._eat(kind); | 11690 this._eat(kind); |
| 11657 var name = this.identifier(); | 11691 var name = this.identifier(); |
| 11658 var typeParams = null; | 11692 var typeParams = null; |
| 11659 if (this._peekKind(52/*TokenKind.LT*/)) { | 11693 if (this._peekKind(52/*TokenKind.LT*/)) { |
| 11660 typeParams = this.typeParameters(); | 11694 typeParams = this.typeParameters(); |
| 11661 } | 11695 } |
| 11662 var _extends = null; | 11696 var _extends = null; |
| 11663 if (this._maybeEat(73/*TokenKind.EXTENDS*/)) { | 11697 if (this._maybeEat(73/*TokenKind.EXTENDS*/)) { |
| 11664 _extends = this.typeList(); | 11698 _extends = this.typeList(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 11680 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) { | 11714 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) { |
| 11681 if (this.isPrematureEndOfFile()) break; | 11715 if (this.isPrematureEndOfFile()) break; |
| 11682 body.add(this.declaration()); | 11716 body.add(this.declaration()); |
| 11683 } | 11717 } |
| 11684 } | 11718 } |
| 11685 else { | 11719 else { |
| 11686 this._errorExpected('block starting with "{" or ";"'); | 11720 this._errorExpected('block starting with "{" or ";"'); |
| 11687 } | 11721 } |
| 11688 return new TypeDefinition(kind == 72/*TokenKind.CLASS*/, name, typeParams, _ex
tends, _implements, _native, _factory, body, this._makeSpan(start)); | 11722 return new TypeDefinition(kind == 72/*TokenKind.CLASS*/, name, typeParams, _ex
tends, _implements, _native, _factory, body, this._makeSpan(start)); |
| 11689 } | 11723 } |
| 11690 lang_Parser.prototype.functionTypeAlias = function() { | 11724 Parser.prototype.functionTypeAlias = function() { |
| 11691 var start = this._peekToken.start; | 11725 var start = this._peekToken.start; |
| 11692 this._eat(86/*TokenKind.TYPEDEF*/); | 11726 this._eat(86/*TokenKind.TYPEDEF*/); |
| 11693 var di = this.declaredIdentifier(false); | 11727 var di = this.declaredIdentifier(false); |
| 11694 var typeParams = null; | 11728 var typeParams = null; |
| 11695 if (this._peekKind(52/*TokenKind.LT*/)) { | 11729 if (this._peekKind(52/*TokenKind.LT*/)) { |
| 11696 typeParams = this.typeParameters(); | 11730 typeParams = this.typeParameters(); |
| 11697 } | 11731 } |
| 11698 var formals = this.formalParameterList(); | 11732 var formals = this.formalParameterList(); |
| 11699 this._eatSemicolon(); | 11733 this._eatSemicolon(); |
| 11700 var func = new FunctionDefinition(null, di.type, di.get$name(), formals, null,
null, this._makeSpan(start)); | 11734 var func = new FunctionDefinition(null, di.type, di.get$name(), formals, null,
null, this._makeSpan(start)); |
| 11701 return new FunctionTypeDefinition(func, typeParams, this._makeSpan(start)); | 11735 return new FunctionTypeDefinition(func, typeParams, this._makeSpan(start)); |
| 11702 } | 11736 } |
| 11703 lang_Parser.prototype.initializers = function() { | 11737 Parser.prototype.initializers = function() { |
| 11704 this._inInitializers = true; | 11738 this._inInitializers = true; |
| 11705 var ret = []; | 11739 var ret = []; |
| 11706 do { | 11740 do { |
| 11707 ret.add(this.expression()); | 11741 ret.add(this.expression()); |
| 11708 } | 11742 } |
| 11709 while (this._maybeEat(11/*TokenKind.COMMA*/)) | 11743 while (this._maybeEat(11/*TokenKind.COMMA*/)) |
| 11710 this._inInitializers = false; | 11744 this._inInitializers = false; |
| 11711 return ret; | 11745 return ret; |
| 11712 } | 11746 } |
| 11713 lang_Parser.prototype.functionBody = function(inExpression) { | 11747 Parser.prototype.functionBody = function(inExpression) { |
| 11714 var start = this._peekToken.start; | 11748 var start = this._peekToken.start; |
| 11715 if (this._maybeEat(9/*TokenKind.ARROW*/)) { | 11749 if (this._maybeEat(9/*TokenKind.ARROW*/)) { |
| 11716 var expr = this.expression(); | 11750 var expr = this.expression(); |
| 11717 if (!inExpression) { | 11751 if (!inExpression) { |
| 11718 this._eatSemicolon(); | 11752 this._eatSemicolon(); |
| 11719 } | 11753 } |
| 11720 return new ReturnStatement(expr, this._makeSpan(start)); | 11754 return new ReturnStatement(expr, this._makeSpan(start)); |
| 11721 } | 11755 } |
| 11722 else if (this._peekKind(6/*TokenKind.LBRACE*/)) { | 11756 else if (this._peekKind(6/*TokenKind.LBRACE*/)) { |
| 11723 if (this.diet) { | 11757 if (this.diet) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 11738 this._eatSemicolon(); | 11772 this._eatSemicolon(); |
| 11739 return new NativeStatement(nativeBody, this._makeSpan(start)); | 11773 return new NativeStatement(nativeBody, this._makeSpan(start)); |
| 11740 } | 11774 } |
| 11741 else { | 11775 else { |
| 11742 return this.functionBody(inExpression); | 11776 return this.functionBody(inExpression); |
| 11743 } | 11777 } |
| 11744 } | 11778 } |
| 11745 } | 11779 } |
| 11746 this._lang_error('Expected function body (neither { nor => found)'); | 11780 this._lang_error('Expected function body (neither { nor => found)'); |
| 11747 } | 11781 } |
| 11748 lang_Parser.prototype.finishField = function(start, modifiers, type, name, value
) { | 11782 Parser.prototype.finishField = function(start, modifiers, type, name, value) { |
| 11749 var names = [name]; | 11783 var names = [name]; |
| 11750 var values = [value]; | 11784 var values = [value]; |
| 11751 while (this._maybeEat(11/*TokenKind.COMMA*/)) { | 11785 while (this._maybeEat(11/*TokenKind.COMMA*/)) { |
| 11752 names.add(this.identifier()); | 11786 names.add(this.identifier()); |
| 11753 if (this._maybeEat(20/*TokenKind.ASSIGN*/)) { | 11787 if (this._maybeEat(20/*TokenKind.ASSIGN*/)) { |
| 11754 values.add(this.expression()); | 11788 values.add(this.expression()); |
| 11755 } | 11789 } |
| 11756 else { | 11790 else { |
| 11757 values.add(null); | 11791 values.add(null); |
| 11758 } | 11792 } |
| 11759 } | 11793 } |
| 11760 this._eatSemicolon(); | 11794 this._eatSemicolon(); |
| 11761 return new VariableDefinition(modifiers, type, names, values, this._makeSpan(s
tart)); | 11795 return new VariableDefinition(modifiers, type, names, values, this._makeSpan(s
tart)); |
| 11762 } | 11796 } |
| 11763 lang_Parser.prototype.finishDefinition = function(start, modifiers, di) { | 11797 Parser.prototype.finishDefinition = function(start, modifiers, di) { |
| 11764 switch (this._peek()) { | 11798 switch (this._peek()) { |
| 11765 case 2/*TokenKind.LPAREN*/: | 11799 case 2/*TokenKind.LPAREN*/: |
| 11766 | 11800 |
| 11767 var formals = this.formalParameterList(); | 11801 var formals = this.formalParameterList(); |
| 11768 var inits = null; | 11802 var inits = null; |
| 11769 if (this._maybeEat(8/*TokenKind.COLON*/)) { | 11803 if (this._maybeEat(8/*TokenKind.COLON*/)) { |
| 11770 inits = this.initializers(); | 11804 inits = this.initializers(); |
| 11771 } | 11805 } |
| 11772 var body = this.functionBody(false); | 11806 var body = this.functionBody(false); |
| 11773 if (di.get$name() == null) { | 11807 if (di.get$name() == null) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 11786 | 11820 |
| 11787 return this.finishField(start, modifiers, di.type, di.get$name(), null); | 11821 return this.finishField(start, modifiers, di.type, di.get$name(), null); |
| 11788 | 11822 |
| 11789 default: | 11823 default: |
| 11790 | 11824 |
| 11791 this._errorExpected('declaration'); | 11825 this._errorExpected('declaration'); |
| 11792 return null; | 11826 return null; |
| 11793 | 11827 |
| 11794 } | 11828 } |
| 11795 } | 11829 } |
| 11796 lang_Parser.prototype.declaration = function() { | 11830 Parser.prototype.declaration = function() { |
| 11797 var start = this._peekToken.start; | 11831 var start = this._peekToken.start; |
| 11798 if (this._peekKind(74/*TokenKind.FACTORY*/)) { | 11832 if (this._peekKind(74/*TokenKind.FACTORY*/)) { |
| 11799 return this.factoryConstructorDeclaration(); | 11833 return this.factoryConstructorDeclaration(); |
| 11800 } | 11834 } |
| 11801 var modifiers = this._readModifiers(); | 11835 var modifiers = this._readModifiers(); |
| 11802 return this.finishDefinition(start, modifiers, this.declaredIdentifier(true)); | 11836 return this.finishDefinition(start, modifiers, this.declaredIdentifier(true)); |
| 11803 } | 11837 } |
| 11804 lang_Parser.prototype.factoryConstructorDeclaration = function() { | 11838 Parser.prototype.factoryConstructorDeclaration = function() { |
| 11805 var start = this._peekToken.start; | 11839 var start = this._peekToken.start; |
| 11806 var factoryToken = this._lang_next(); | 11840 var factoryToken = this._lang_next(); |
| 11807 var names = [this.identifier()]; | 11841 var names = [this.identifier()]; |
| 11808 while (this._maybeEat(14/*TokenKind.DOT*/)) { | 11842 while (this._maybeEat(14/*TokenKind.DOT*/)) { |
| 11809 names.add(this.identifier()); | 11843 names.add(this.identifier()); |
| 11810 } | 11844 } |
| 11811 var typeParams = null; | 11845 var typeParams = null; |
| 11812 if (this._peekKind(52/*TokenKind.LT*/)) { | 11846 if (this._peekKind(52/*TokenKind.LT*/)) { |
| 11813 typeParams = this.typeParameters(); | 11847 typeParams = this.typeParameters(); |
| 11814 } | 11848 } |
| 11815 var name = null; | 11849 var name = null; |
| 11816 var type = null; | 11850 var type = null; |
| 11817 if (this._maybeEat(14/*TokenKind.DOT*/)) { | 11851 if (this._maybeEat(14/*TokenKind.DOT*/)) { |
| 11818 name = this.identifier(); | 11852 name = this.identifier(); |
| 11819 } | 11853 } |
| 11820 else if (typeParams == null) { | 11854 else if (typeParams == null) { |
| 11821 if (names.length > 1) { | 11855 if (names.length > 1) { |
| 11822 name = names.removeLast(); | 11856 name = names.removeLast(); |
| 11823 } | 11857 } |
| 11824 else { | 11858 else { |
| 11825 name = new lang_Identifier('', names.$index(0).get$span()); | 11859 name = new Identifier('', names.$index(0).get$span()); |
| 11826 } | 11860 } |
| 11827 } | 11861 } |
| 11828 else { | 11862 else { |
| 11829 name = new lang_Identifier('', names.$index(0).get$span()); | 11863 name = new Identifier('', names.$index(0).get$span()); |
| 11830 } | 11864 } |
| 11831 if (names.length > 1) { | 11865 if (names.length > 1) { |
| 11832 this._lang_error('unsupported qualified name for factory', names.$index(0).g
et$span()); | 11866 this._lang_error('unsupported qualified name for factory', names.$index(0).g
et$span()); |
| 11833 } | 11867 } |
| 11834 type = new NameTypeReference(false, names.$index(0), null, names.$index(0).get
$span()); | 11868 type = new NameTypeReference(false, names.$index(0), null, names.$index(0).get
$span()); |
| 11835 var di = new DeclaredIdentifier(type, name, this._makeSpan(start)); | 11869 var di = new DeclaredIdentifier(type, name, this._makeSpan(start)); |
| 11836 return this.finishDefinition(start, [factoryToken], di); | 11870 return this.finishDefinition(start, [factoryToken], di); |
| 11837 } | 11871 } |
| 11838 lang_Parser.prototype.statement = function() { | 11872 Parser.prototype.statement = function() { |
| 11839 switch (this._peek()) { | 11873 switch (this._peek()) { |
| 11840 case 87/*TokenKind.BREAK*/: | 11874 case 87/*TokenKind.BREAK*/: |
| 11841 | 11875 |
| 11842 return this.breakStatement(); | 11876 return this.breakStatement(); |
| 11843 | 11877 |
| 11844 case 91/*TokenKind.CONTINUE*/: | 11878 case 91/*TokenKind.CONTINUE*/: |
| 11845 | 11879 |
| 11846 return this.continueStatement(); | 11880 return this.continueStatement(); |
| 11847 | 11881 |
| 11848 case 104/*TokenKind.RETURN*/: | 11882 case 104/*TokenKind.RETURN*/: |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11896 case 111/*TokenKind.VAR*/: | 11930 case 111/*TokenKind.VAR*/: |
| 11897 | 11931 |
| 11898 return this.declaration(); | 11932 return this.declaration(); |
| 11899 | 11933 |
| 11900 default: | 11934 default: |
| 11901 | 11935 |
| 11902 return this.finishExpressionAsStatement(this.expression()); | 11936 return this.finishExpressionAsStatement(this.expression()); |
| 11903 | 11937 |
| 11904 } | 11938 } |
| 11905 } | 11939 } |
| 11906 lang_Parser.prototype.finishExpressionAsStatement = function(expr) { | 11940 Parser.prototype.finishExpressionAsStatement = function(expr) { |
| 11907 var start = expr.get$span().start; | 11941 var start = expr.get$span().start; |
| 11908 if (this._maybeEat(8/*TokenKind.COLON*/)) { | 11942 if (this._maybeEat(8/*TokenKind.COLON*/)) { |
| 11909 var label = this._makeLabel(expr); | 11943 var label = this._makeLabel(expr); |
| 11910 return new LabeledStatement(label, this.statement(), this._makeSpan(start)); | 11944 return new LabeledStatement(label, this.statement(), this._makeSpan(start)); |
| 11911 } | 11945 } |
| 11912 if ((expr instanceof LambdaExpression)) { | 11946 if ((expr instanceof LambdaExpression)) { |
| 11913 if (!(expr.func.body instanceof BlockStatement)) { | 11947 if (!(expr.func.body instanceof BlockStatement)) { |
| 11914 this._eatSemicolon(); | 11948 this._eatSemicolon(); |
| 11915 expr.func.span = this._makeSpan(start); | 11949 expr.func.span = this._makeSpan(start); |
| 11916 } | 11950 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 11933 var gt = this._finishTypeArguments(baseType, 0, typeArgs); | 11967 var gt = this._finishTypeArguments(baseType, 0, typeArgs); |
| 11934 var name = this.identifier(); | 11968 var name = this.identifier(); |
| 11935 var value = null; | 11969 var value = null; |
| 11936 if (this._maybeEat(20/*TokenKind.ASSIGN*/)) { | 11970 if (this._maybeEat(20/*TokenKind.ASSIGN*/)) { |
| 11937 value = this.expression(); | 11971 value = this.expression(); |
| 11938 } | 11972 } |
| 11939 return this.finishField(expr.get$span().start, null, gt, name, value); | 11973 return this.finishField(expr.get$span().start, null, gt, name, value); |
| 11940 } | 11974 } |
| 11941 else { | 11975 else { |
| 11942 this._eatSemicolon(); | 11976 this._eatSemicolon(); |
| 11943 return new lang_ExpressionStatement(expr, this._makeSpan(expr.get$span().sta
rt)); | 11977 return new ExpressionStatement(expr, this._makeSpan(expr.get$span().start)); |
| 11944 } | 11978 } |
| 11945 } | 11979 } |
| 11946 lang_Parser.prototype.testCondition = function() { | 11980 Parser.prototype.testCondition = function() { |
| 11947 this._eat(2/*TokenKind.LPAREN*/); | 11981 this._eat(2/*TokenKind.LPAREN*/); |
| 11948 var ret = this.expression(); | 11982 var ret = this.expression(); |
| 11949 this._eat(3/*TokenKind.RPAREN*/); | 11983 this._eat(3/*TokenKind.RPAREN*/); |
| 11950 return ret; | 11984 return ret; |
| 11951 } | 11985 } |
| 11952 lang_Parser.prototype.block = function() { | 11986 Parser.prototype.block = function() { |
| 11953 var start = this._peekToken.start; | 11987 var start = this._peekToken.start; |
| 11954 this._eat(6/*TokenKind.LBRACE*/); | 11988 this._eat(6/*TokenKind.LBRACE*/); |
| 11955 var stmts = []; | 11989 var stmts = []; |
| 11956 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) { | 11990 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) { |
| 11957 if (this.isPrematureEndOfFile()) break; | 11991 if (this.isPrematureEndOfFile()) break; |
| 11958 stmts.add(this.statement()); | 11992 stmts.add(this.statement()); |
| 11959 } | 11993 } |
| 11960 return new BlockStatement(stmts, this._makeSpan(start)); | 11994 return new BlockStatement(stmts, this._makeSpan(start)); |
| 11961 } | 11995 } |
| 11962 lang_Parser.prototype.emptyStatement = function() { | 11996 Parser.prototype.emptyStatement = function() { |
| 11963 var start = this._peekToken.start; | 11997 var start = this._peekToken.start; |
| 11964 this._eat(10/*TokenKind.SEMICOLON*/); | 11998 this._eat(10/*TokenKind.SEMICOLON*/); |
| 11965 return new EmptyStatement(this._makeSpan(start)); | 11999 return new EmptyStatement(this._makeSpan(start)); |
| 11966 } | 12000 } |
| 11967 lang_Parser.prototype.ifStatement = function() { | 12001 Parser.prototype.ifStatement = function() { |
| 11968 var start = this._peekToken.start; | 12002 var start = this._peekToken.start; |
| 11969 this._eat(99/*TokenKind.IF*/); | 12003 this._eat(99/*TokenKind.IF*/); |
| 11970 var test = this.testCondition(); | 12004 var test = this.testCondition(); |
| 11971 var trueBranch = this.statement(); | 12005 var trueBranch = this.statement(); |
| 11972 var falseBranch = null; | 12006 var falseBranch = null; |
| 11973 if (this._maybeEat(94/*TokenKind.ELSE*/)) { | 12007 if (this._maybeEat(94/*TokenKind.ELSE*/)) { |
| 11974 falseBranch = this.statement(); | 12008 falseBranch = this.statement(); |
| 11975 } | 12009 } |
| 11976 return new IfStatement(test, trueBranch, falseBranch, this._makeSpan(start)); | 12010 return new IfStatement(test, trueBranch, falseBranch, this._makeSpan(start)); |
| 11977 } | 12011 } |
| 11978 lang_Parser.prototype.whileStatement = function() { | 12012 Parser.prototype.whileStatement = function() { |
| 11979 var start = this._peekToken.start; | 12013 var start = this._peekToken.start; |
| 11980 this._eat(113/*TokenKind.WHILE*/); | 12014 this._eat(113/*TokenKind.WHILE*/); |
| 11981 var test = this.testCondition(); | 12015 var test = this.testCondition(); |
| 11982 var body = this.statement(); | 12016 var body = this.statement(); |
| 11983 return new WhileStatement(test, body, this._makeSpan(start)); | 12017 return new WhileStatement(test, body, this._makeSpan(start)); |
| 11984 } | 12018 } |
| 11985 lang_Parser.prototype.doStatement = function() { | 12019 Parser.prototype.doStatement = function() { |
| 11986 var start = this._peekToken.start; | 12020 var start = this._peekToken.start; |
| 11987 this._eat(93/*TokenKind.DO*/); | 12021 this._eat(93/*TokenKind.DO*/); |
| 11988 var body = this.statement(); | 12022 var body = this.statement(); |
| 11989 this._eat(113/*TokenKind.WHILE*/); | 12023 this._eat(113/*TokenKind.WHILE*/); |
| 11990 var test = this.testCondition(); | 12024 var test = this.testCondition(); |
| 11991 this._eatSemicolon(); | 12025 this._eatSemicolon(); |
| 11992 return new DoStatement(body, test, this._makeSpan(start)); | 12026 return new DoStatement(body, test, this._makeSpan(start)); |
| 11993 } | 12027 } |
| 11994 lang_Parser.prototype.forStatement = function() { | 12028 Parser.prototype.forStatement = function() { |
| 11995 var start = this._peekToken.start; | 12029 var start = this._peekToken.start; |
| 11996 this._eat(98/*TokenKind.FOR*/); | 12030 this._eat(98/*TokenKind.FOR*/); |
| 11997 this._eat(2/*TokenKind.LPAREN*/); | 12031 this._eat(2/*TokenKind.LPAREN*/); |
| 11998 var init = this.forInitializerStatement(start); | 12032 var init = this.forInitializerStatement(start); |
| 11999 if ((init instanceof ForInStatement)) { | 12033 if ((init instanceof ForInStatement)) { |
| 12000 return init; | 12034 return init; |
| 12001 } | 12035 } |
| 12002 var test = null; | 12036 var test = null; |
| 12003 if (!this._maybeEat(10/*TokenKind.SEMICOLON*/)) { | 12037 if (!this._maybeEat(10/*TokenKind.SEMICOLON*/)) { |
| 12004 test = this.expression(); | 12038 test = this.expression(); |
| 12005 this._eatSemicolon(); | 12039 this._eatSemicolon(); |
| 12006 } | 12040 } |
| 12007 var step = []; | 12041 var step = []; |
| 12008 if (!this._maybeEat(3/*TokenKind.RPAREN*/)) { | 12042 if (!this._maybeEat(3/*TokenKind.RPAREN*/)) { |
| 12009 step.add(this.expression()); | 12043 step.add(this.expression()); |
| 12010 while (this._maybeEat(11/*TokenKind.COMMA*/)) { | 12044 while (this._maybeEat(11/*TokenKind.COMMA*/)) { |
| 12011 step.add(this.expression()); | 12045 step.add(this.expression()); |
| 12012 } | 12046 } |
| 12013 this._eat(3/*TokenKind.RPAREN*/); | 12047 this._eat(3/*TokenKind.RPAREN*/); |
| 12014 } | 12048 } |
| 12015 var body = this.statement(); | 12049 var body = this.statement(); |
| 12016 return new ForStatement(init, test, step, body, this._makeSpan(start)); | 12050 return new ForStatement(init, test, step, body, this._makeSpan(start)); |
| 12017 } | 12051 } |
| 12018 lang_Parser.prototype.forInitializerStatement = function(start) { | 12052 Parser.prototype.forInitializerStatement = function(start) { |
| 12019 if (this._maybeEat(10/*TokenKind.SEMICOLON*/)) { | 12053 if (this._maybeEat(10/*TokenKind.SEMICOLON*/)) { |
| 12020 return null; | 12054 return null; |
| 12021 } | 12055 } |
| 12022 else { | 12056 else { |
| 12023 var init = this.expression(); | 12057 var init = this.expression(); |
| 12024 if (this._peekKind(11/*TokenKind.COMMA*/) && this._isBin(init, 52/*TokenKind
.LT*/)) { | 12058 if (this._peekKind(11/*TokenKind.COMMA*/) && this._isBin(init, 52/*TokenKind
.LT*/)) { |
| 12025 this._eat(11/*TokenKind.COMMA*/); | 12059 this._eat(11/*TokenKind.COMMA*/); |
| 12026 var baseType = this._makeType(init.x); | 12060 var baseType = this._makeType(init.x); |
| 12027 var typeArgs = [this._makeType(init.y)]; | 12061 var typeArgs = [this._makeType(init.y)]; |
| 12028 var gt = this._finishTypeArguments(baseType, 0, typeArgs); | 12062 var gt = this._finishTypeArguments(baseType, 0, typeArgs); |
| 12029 var name = this.identifier(); | 12063 var name = this.identifier(); |
| 12030 init = new DeclaredIdentifier(gt, name, this._makeSpan(init.get$span().sta
rt)); | 12064 init = new DeclaredIdentifier(gt, name, this._makeSpan(init.get$span().sta
rt)); |
| 12031 } | 12065 } |
| 12032 if (this._maybeEat(100/*TokenKind.IN*/)) { | 12066 if (this._maybeEat(100/*TokenKind.IN*/)) { |
| 12033 return this._finishForIn(start, this._makeDeclaredIdentifier(init)); | 12067 return this._finishForIn(start, this._makeDeclaredIdentifier(init)); |
| 12034 } | 12068 } |
| 12035 else { | 12069 else { |
| 12036 return this.finishExpressionAsStatement(init); | 12070 return this.finishExpressionAsStatement(init); |
| 12037 } | 12071 } |
| 12038 } | 12072 } |
| 12039 } | 12073 } |
| 12040 lang_Parser.prototype._finishForIn = function(start, di) { | 12074 Parser.prototype._finishForIn = function(start, di) { |
| 12041 var expr = this.expression(); | 12075 var expr = this.expression(); |
| 12042 this._eat(3/*TokenKind.RPAREN*/); | 12076 this._eat(3/*TokenKind.RPAREN*/); |
| 12043 var body = this.statement(); | 12077 var body = this.statement(); |
| 12044 return new ForInStatement(di, expr, body, this._makeSpan(start)); | 12078 return new ForInStatement(di, expr, body, this._makeSpan(start)); |
| 12045 } | 12079 } |
| 12046 lang_Parser.prototype.tryStatement = function() { | 12080 Parser.prototype.tryStatement = function() { |
| 12047 var start = this._peekToken.start; | 12081 var start = this._peekToken.start; |
| 12048 this._eat(110/*TokenKind.TRY*/); | 12082 this._eat(110/*TokenKind.TRY*/); |
| 12049 var body = this.block(); | 12083 var body = this.block(); |
| 12050 var catches = []; | 12084 var catches = []; |
| 12051 while (this._peekKind(89/*TokenKind.CATCH*/)) { | 12085 while (this._peekKind(89/*TokenKind.CATCH*/)) { |
| 12052 catches.add(this.catchNode()); | 12086 catches.add(this.catchNode()); |
| 12053 } | 12087 } |
| 12054 var finallyBlock = null; | 12088 var finallyBlock = null; |
| 12055 if (this._maybeEat(97/*TokenKind.FINALLY*/)) { | 12089 if (this._maybeEat(97/*TokenKind.FINALLY*/)) { |
| 12056 finallyBlock = this.block(); | 12090 finallyBlock = this.block(); |
| 12057 } | 12091 } |
| 12058 return new TryStatement(body, catches, finallyBlock, this._makeSpan(start)); | 12092 return new TryStatement(body, catches, finallyBlock, this._makeSpan(start)); |
| 12059 } | 12093 } |
| 12060 lang_Parser.prototype.catchNode = function() { | 12094 Parser.prototype.catchNode = function() { |
| 12061 var start = this._peekToken.start; | 12095 var start = this._peekToken.start; |
| 12062 this._eat(89/*TokenKind.CATCH*/); | 12096 this._eat(89/*TokenKind.CATCH*/); |
| 12063 this._eat(2/*TokenKind.LPAREN*/); | 12097 this._eat(2/*TokenKind.LPAREN*/); |
| 12064 var exc = this.declaredIdentifier(false); | 12098 var exc = this.declaredIdentifier(false); |
| 12065 var trace = null; | 12099 var trace = null; |
| 12066 if (this._maybeEat(11/*TokenKind.COMMA*/)) { | 12100 if (this._maybeEat(11/*TokenKind.COMMA*/)) { |
| 12067 trace = this.declaredIdentifier(false); | 12101 trace = this.declaredIdentifier(false); |
| 12068 } | 12102 } |
| 12069 this._eat(3/*TokenKind.RPAREN*/); | 12103 this._eat(3/*TokenKind.RPAREN*/); |
| 12070 var body = this.block(); | 12104 var body = this.block(); |
| 12071 return new CatchNode(exc, trace, body, this._makeSpan(start)); | 12105 return new CatchNode(exc, trace, body, this._makeSpan(start)); |
| 12072 } | 12106 } |
| 12073 lang_Parser.prototype.switchStatement = function() { | 12107 Parser.prototype.switchStatement = function() { |
| 12074 var start = this._peekToken.start; | 12108 var start = this._peekToken.start; |
| 12075 this._eat(106/*TokenKind.SWITCH*/); | 12109 this._eat(106/*TokenKind.SWITCH*/); |
| 12076 var test = this.testCondition(); | 12110 var test = this.testCondition(); |
| 12077 var cases = []; | 12111 var cases = []; |
| 12078 this._eat(6/*TokenKind.LBRACE*/); | 12112 this._eat(6/*TokenKind.LBRACE*/); |
| 12079 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) { | 12113 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) { |
| 12080 cases.add(this.caseNode()); | 12114 cases.add(this.caseNode()); |
| 12081 } | 12115 } |
| 12082 return new SwitchStatement(test, cases, this._makeSpan(start)); | 12116 return new SwitchStatement(test, cases, this._makeSpan(start)); |
| 12083 } | 12117 } |
| 12084 lang_Parser.prototype._peekCaseEnd = function() { | 12118 Parser.prototype._peekCaseEnd = function() { |
| 12085 var kind = this._peek(); | 12119 var kind = this._peek(); |
| 12086 return $eq(kind, 7/*TokenKind.RBRACE*/) || $eq(kind, 88/*TokenKind.CASE*/) ||
$eq(kind, 92/*TokenKind.DEFAULT*/); | 12120 return $eq(kind, 7/*TokenKind.RBRACE*/) || $eq(kind, 88/*TokenKind.CASE*/) ||
$eq(kind, 92/*TokenKind.DEFAULT*/); |
| 12087 } | 12121 } |
| 12088 lang_Parser.prototype.caseNode = function() { | 12122 Parser.prototype.caseNode = function() { |
| 12089 var start = this._peekToken.start; | 12123 var start = this._peekToken.start; |
| 12090 var label = null; | 12124 var label = null; |
| 12091 if (this._peekIdentifier()) { | 12125 if (this._peekIdentifier()) { |
| 12126 label = this.identifier(); |
| 12092 this._eat(8/*TokenKind.COLON*/); | 12127 this._eat(8/*TokenKind.COLON*/); |
| 12093 label = this.identifier(); | |
| 12094 } | 12128 } |
| 12095 var cases = []; | 12129 var cases = []; |
| 12096 while (true) { | 12130 while (true) { |
| 12097 if (this._maybeEat(88/*TokenKind.CASE*/)) { | 12131 if (this._maybeEat(88/*TokenKind.CASE*/)) { |
| 12098 cases.add(this.expression()); | 12132 cases.add(this.expression()); |
| 12099 this._eat(8/*TokenKind.COLON*/); | 12133 this._eat(8/*TokenKind.COLON*/); |
| 12100 } | 12134 } |
| 12101 else if (this._maybeEat(92/*TokenKind.DEFAULT*/)) { | 12135 else if (this._maybeEat(92/*TokenKind.DEFAULT*/)) { |
| 12102 cases.add(null); | 12136 cases.add(null); |
| 12103 this._eat(8/*TokenKind.COLON*/); | 12137 this._eat(8/*TokenKind.COLON*/); |
| 12104 } | 12138 } |
| 12105 else { | 12139 else { |
| 12106 break; | 12140 break; |
| 12107 } | 12141 } |
| 12108 } | 12142 } |
| 12109 if (cases.length == 0) { | 12143 if (cases.length == 0) { |
| 12110 this._lang_error('case or default'); | 12144 this._lang_error('case or default'); |
| 12111 } | 12145 } |
| 12112 var stmts = []; | 12146 var stmts = []; |
| 12113 while (!this._peekCaseEnd()) { | 12147 while (!this._peekCaseEnd()) { |
| 12114 if (this.isPrematureEndOfFile()) break; | 12148 if (this.isPrematureEndOfFile()) break; |
| 12115 stmts.add(this.statement()); | 12149 stmts.add(this.statement()); |
| 12116 } | 12150 } |
| 12117 return new CaseNode(label, cases, stmts, this._makeSpan(start)); | 12151 return new CaseNode(label, cases, stmts, this._makeSpan(start)); |
| 12118 } | 12152 } |
| 12119 lang_Parser.prototype.returnStatement = function() { | 12153 Parser.prototype.returnStatement = function() { |
| 12120 var start = this._peekToken.start; | 12154 var start = this._peekToken.start; |
| 12121 this._eat(104/*TokenKind.RETURN*/); | 12155 this._eat(104/*TokenKind.RETURN*/); |
| 12122 var expr; | 12156 var expr; |
| 12123 if (this._maybeEat(10/*TokenKind.SEMICOLON*/)) { | 12157 if (this._maybeEat(10/*TokenKind.SEMICOLON*/)) { |
| 12124 expr = null; | 12158 expr = null; |
| 12125 } | 12159 } |
| 12126 else { | 12160 else { |
| 12127 expr = this.expression(); | 12161 expr = this.expression(); |
| 12128 this._eatSemicolon(); | 12162 this._eatSemicolon(); |
| 12129 } | 12163 } |
| 12130 return new ReturnStatement(expr, this._makeSpan(start)); | 12164 return new ReturnStatement(expr, this._makeSpan(start)); |
| 12131 } | 12165 } |
| 12132 lang_Parser.prototype.throwStatement = function() { | 12166 Parser.prototype.throwStatement = function() { |
| 12133 var start = this._peekToken.start; | 12167 var start = this._peekToken.start; |
| 12134 this._eat(108/*TokenKind.THROW*/); | 12168 this._eat(108/*TokenKind.THROW*/); |
| 12135 var expr; | 12169 var expr; |
| 12136 if (this._maybeEat(10/*TokenKind.SEMICOLON*/)) { | 12170 if (this._maybeEat(10/*TokenKind.SEMICOLON*/)) { |
| 12137 expr = null; | 12171 expr = null; |
| 12138 } | 12172 } |
| 12139 else { | 12173 else { |
| 12140 expr = this.expression(); | 12174 expr = this.expression(); |
| 12141 this._eatSemicolon(); | 12175 this._eatSemicolon(); |
| 12142 } | 12176 } |
| 12143 return new ThrowStatement(expr, this._makeSpan(start)); | 12177 return new ThrowStatement(expr, this._makeSpan(start)); |
| 12144 } | 12178 } |
| 12145 lang_Parser.prototype.assertStatement = function() { | 12179 Parser.prototype.assertStatement = function() { |
| 12146 var start = this._peekToken.start; | 12180 var start = this._peekToken.start; |
| 12147 this._eat(71/*TokenKind.ASSERT*/); | 12181 this._eat(71/*TokenKind.ASSERT*/); |
| 12148 this._eat(2/*TokenKind.LPAREN*/); | 12182 this._eat(2/*TokenKind.LPAREN*/); |
| 12149 var expr = this.expression(); | 12183 var expr = this.expression(); |
| 12150 this._eat(3/*TokenKind.RPAREN*/); | 12184 this._eat(3/*TokenKind.RPAREN*/); |
| 12151 this._eatSemicolon(); | 12185 this._eatSemicolon(); |
| 12152 return new AssertStatement(expr, this._makeSpan(start)); | 12186 return new AssertStatement(expr, this._makeSpan(start)); |
| 12153 } | 12187 } |
| 12154 lang_Parser.prototype.breakStatement = function() { | 12188 Parser.prototype.breakStatement = function() { |
| 12155 var start = this._peekToken.start; | 12189 var start = this._peekToken.start; |
| 12156 this._eat(87/*TokenKind.BREAK*/); | 12190 this._eat(87/*TokenKind.BREAK*/); |
| 12157 var name = null; | 12191 var name = null; |
| 12158 if (this._peekIdentifier()) { | 12192 if (this._peekIdentifier()) { |
| 12159 name = this.identifier(); | 12193 name = this.identifier(); |
| 12160 } | 12194 } |
| 12161 this._eatSemicolon(); | 12195 this._eatSemicolon(); |
| 12162 return new BreakStatement(name, this._makeSpan(start)); | 12196 return new BreakStatement(name, this._makeSpan(start)); |
| 12163 } | 12197 } |
| 12164 lang_Parser.prototype.continueStatement = function() { | 12198 Parser.prototype.continueStatement = function() { |
| 12165 var start = this._peekToken.start; | 12199 var start = this._peekToken.start; |
| 12166 this._eat(91/*TokenKind.CONTINUE*/); | 12200 this._eat(91/*TokenKind.CONTINUE*/); |
| 12167 var name = null; | 12201 var name = null; |
| 12168 if (this._peekIdentifier()) { | 12202 if (this._peekIdentifier()) { |
| 12169 name = this.identifier(); | 12203 name = this.identifier(); |
| 12170 } | 12204 } |
| 12171 this._eatSemicolon(); | 12205 this._eatSemicolon(); |
| 12172 return new ContinueStatement(name, this._makeSpan(start)); | 12206 return new ContinueStatement(name, this._makeSpan(start)); |
| 12173 } | 12207 } |
| 12174 lang_Parser.prototype.expression = function() { | 12208 Parser.prototype.expression = function() { |
| 12175 return this.infixExpression(0); | 12209 return this.infixExpression(0); |
| 12176 } | 12210 } |
| 12177 lang_Parser.prototype._makeType = function(expr) { | 12211 Parser.prototype._makeType = function(expr) { |
| 12178 if ((expr instanceof VarExpression)) { | 12212 if ((expr instanceof VarExpression)) { |
| 12179 return new NameTypeReference(false, expr.get$name(), null, expr.get$span()); | 12213 return new NameTypeReference(false, expr.get$name(), null, expr.get$span()); |
| 12180 } | 12214 } |
| 12181 else if ((expr instanceof DotExpression)) { | 12215 else if ((expr instanceof DotExpression)) { |
| 12182 var type = this._makeType(expr.self); | 12216 var type = this._makeType(expr.self); |
| 12183 if (type.names == null) { | 12217 if (type.names == null) { |
| 12184 type.names = [expr.get$name()]; | 12218 type.names = [expr.get$name()]; |
| 12185 } | 12219 } |
| 12186 else { | 12220 else { |
| 12187 type.names.add(expr.get$name()); | 12221 type.names.add(expr.get$name()); |
| 12188 } | 12222 } |
| 12189 type.span = expr.get$span(); | 12223 type.span = expr.get$span(); |
| 12190 return type; | 12224 return type; |
| 12191 } | 12225 } |
| 12192 else { | 12226 else { |
| 12193 this._lang_error('expected type reference'); | 12227 this._lang_error('expected type reference'); |
| 12194 return null; | 12228 return null; |
| 12195 } | 12229 } |
| 12196 } | 12230 } |
| 12197 lang_Parser.prototype.infixExpression = function(precedence) { | 12231 Parser.prototype.infixExpression = function(precedence) { |
| 12198 return this.finishInfixExpression(this.unaryExpression(), precedence); | 12232 return this.finishInfixExpression(this.unaryExpression(), precedence); |
| 12199 } | 12233 } |
| 12200 lang_Parser.prototype._finishDeclaredId = function(type) { | 12234 Parser.prototype._finishDeclaredId = function(type) { |
| 12201 var name = this.identifier(); | 12235 var name = this.identifier(); |
| 12202 return this.finishPostfixExpression(new DeclaredIdentifier(type, name, this._m
akeSpan(type.get$span().start))); | 12236 return this.finishPostfixExpression(new DeclaredIdentifier(type, name, this._m
akeSpan(type.get$span().start))); |
| 12203 } | 12237 } |
| 12204 lang_Parser.prototype._fixAsType = function(x) { | 12238 Parser.prototype._fixAsType = function(x) { |
| 12205 if (this._maybeEat(53/*TokenKind.GT*/)) { | 12239 if (this._maybeEat(53/*TokenKind.GT*/)) { |
| 12206 var base = this._makeType(x.x); | 12240 var base = this._makeType(x.x); |
| 12207 var typeParam = this._makeType(x.y); | 12241 var typeParam = this._makeType(x.y); |
| 12208 var type = new GenericTypeReference(base, [typeParam], 0, this._makeSpan(x.s
pan.start)); | 12242 var type = new GenericTypeReference(base, [typeParam], 0, this._makeSpan(x.s
pan.start)); |
| 12209 return this._finishDeclaredId(type); | 12243 return this._finishDeclaredId(type); |
| 12210 } | 12244 } |
| 12211 else { | 12245 else { |
| 12212 var base = this._makeType(x.x); | 12246 var base = this._makeType(x.x); |
| 12213 var paramBase = this._makeType(x.y); | 12247 var paramBase = this._makeType(x.y); |
| 12214 var firstParam = this.addTypeArguments(paramBase, 1); | 12248 var firstParam = this.addTypeArguments(paramBase, 1); |
| 12215 var type; | 12249 var type; |
| 12216 if (firstParam.depth <= 0) { | 12250 if (firstParam.depth <= 0) { |
| 12217 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp
an.start)); | 12251 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp
an.start)); |
| 12218 } | 12252 } |
| 12219 else if (this._maybeEat(11/*TokenKind.COMMA*/)) { | 12253 else if (this._maybeEat(11/*TokenKind.COMMA*/)) { |
| 12220 type = this._finishTypeArguments(base, 0, [firstParam]); | 12254 type = this._finishTypeArguments(base, 0, [firstParam]); |
| 12221 } | 12255 } |
| 12222 else { | 12256 else { |
| 12223 this._eat(53/*TokenKind.GT*/); | 12257 this._eat(53/*TokenKind.GT*/); |
| 12224 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp
an.start)); | 12258 type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.sp
an.start)); |
| 12225 } | 12259 } |
| 12226 return this._finishDeclaredId(type); | 12260 return this._finishDeclaredId(type); |
| 12227 } | 12261 } |
| 12228 } | 12262 } |
| 12229 lang_Parser.prototype.finishInfixExpression = function(x, precedence) { | 12263 Parser.prototype.finishInfixExpression = function(x, precedence) { |
| 12230 while (true) { | 12264 while (true) { |
| 12231 var kind = this._peek(); | 12265 var kind = this._peek(); |
| 12232 var prec = TokenKind.infixPrecedence(this._peek()); | 12266 var prec = TokenKind.infixPrecedence(this._peek()); |
| 12233 if (prec >= precedence) { | 12267 if (prec >= precedence) { |
| 12234 if (kind == 52/*TokenKind.LT*/ || kind == 53/*TokenKind.GT*/) { | 12268 if (kind == 52/*TokenKind.LT*/ || kind == 53/*TokenKind.GT*/) { |
| 12235 if (this._isBin(x, 52/*TokenKind.LT*/)) { | 12269 if (this._isBin(x, 52/*TokenKind.LT*/)) { |
| 12236 return this._fixAsType(x); | 12270 return this._fixAsType(x); |
| 12237 } | 12271 } |
| 12238 } | 12272 } |
| 12239 var op = this._lang_next(); | 12273 var op = this._lang_next(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 12252 else { | 12286 else { |
| 12253 x = new BinaryExpression(op, x, y, this._makeSpan(x.span.start)); | 12287 x = new BinaryExpression(op, x, y, this._makeSpan(x.span.start)); |
| 12254 } | 12288 } |
| 12255 } | 12289 } |
| 12256 else { | 12290 else { |
| 12257 break; | 12291 break; |
| 12258 } | 12292 } |
| 12259 } | 12293 } |
| 12260 return x; | 12294 return x; |
| 12261 } | 12295 } |
| 12262 lang_Parser.prototype._isPrefixUnaryOperator = function(kind) { | 12296 Parser.prototype._isPrefixUnaryOperator = function(kind) { |
| 12263 switch (kind) { | 12297 switch (kind) { |
| 12264 case 42/*TokenKind.ADD*/: | 12298 case 42/*TokenKind.ADD*/: |
| 12265 case 43/*TokenKind.SUB*/: | 12299 case 43/*TokenKind.SUB*/: |
| 12266 case 19/*TokenKind.NOT*/: | 12300 case 19/*TokenKind.NOT*/: |
| 12267 case 18/*TokenKind.BIT_NOT*/: | 12301 case 18/*TokenKind.BIT_NOT*/: |
| 12268 case 16/*TokenKind.INCR*/: | 12302 case 16/*TokenKind.INCR*/: |
| 12269 case 17/*TokenKind.DECR*/: | 12303 case 17/*TokenKind.DECR*/: |
| 12270 | 12304 |
| 12271 return true; | 12305 return true; |
| 12272 | 12306 |
| 12273 default: | 12307 default: |
| 12274 | 12308 |
| 12275 return false; | 12309 return false; |
| 12276 | 12310 |
| 12277 } | 12311 } |
| 12278 } | 12312 } |
| 12279 lang_Parser.prototype.unaryExpression = function() { | 12313 Parser.prototype.unaryExpression = function() { |
| 12280 var start = this._peekToken.start; | 12314 var start = this._peekToken.start; |
| 12281 if (this._isPrefixUnaryOperator(this._peek())) { | 12315 if (this._isPrefixUnaryOperator(this._peek())) { |
| 12282 var tok = this._lang_next(); | 12316 var tok = this._lang_next(); |
| 12283 var expr = this.unaryExpression(); | 12317 var expr = this.unaryExpression(); |
| 12284 return new UnaryExpression(tok, expr, this._makeSpan(start)); | 12318 return new UnaryExpression(tok, expr, this._makeSpan(start)); |
| 12285 } | 12319 } |
| 12286 return this.finishPostfixExpression(this.primary()); | 12320 return this.finishPostfixExpression(this.primary()); |
| 12287 } | 12321 } |
| 12288 lang_Parser.prototype.argument = function() { | 12322 Parser.prototype.argument = function() { |
| 12289 var start = this._peekToken.start; | 12323 var start = this._peekToken.start; |
| 12290 var expr; | 12324 var expr; |
| 12291 var label = null; | 12325 var label = null; |
| 12292 if (this._maybeEat(15/*TokenKind.ELLIPSIS*/)) { | 12326 if (this._maybeEat(15/*TokenKind.ELLIPSIS*/)) { |
| 12293 label = new lang_Identifier('...', this._makeSpan(start)); | 12327 label = new Identifier('...', this._makeSpan(start)); |
| 12294 } | 12328 } |
| 12295 expr = this.expression(); | 12329 expr = this.expression(); |
| 12296 if (label == null && this._maybeEat(8/*TokenKind.COLON*/)) { | 12330 if (label == null && this._maybeEat(8/*TokenKind.COLON*/)) { |
| 12297 label = this._makeLabel(expr); | 12331 label = this._makeLabel(expr); |
| 12298 expr = this.expression(); | 12332 expr = this.expression(); |
| 12299 } | 12333 } |
| 12300 return new ArgumentNode(label, expr, this._makeSpan(start)); | 12334 return new ArgumentNode(label, expr, this._makeSpan(start)); |
| 12301 } | 12335 } |
| 12302 lang_Parser.prototype.arguments = function() { | 12336 Parser.prototype.arguments = function() { |
| 12303 var args = []; | 12337 var args = []; |
| 12304 this._eat(2/*TokenKind.LPAREN*/); | 12338 this._eat(2/*TokenKind.LPAREN*/); |
| 12305 if (!this._maybeEat(3/*TokenKind.RPAREN*/)) { | 12339 if (!this._maybeEat(3/*TokenKind.RPAREN*/)) { |
| 12306 do { | 12340 do { |
| 12307 args.add(this.argument()); | 12341 args.add(this.argument()); |
| 12308 } | 12342 } |
| 12309 while (this._maybeEat(11/*TokenKind.COMMA*/)) | 12343 while (this._maybeEat(11/*TokenKind.COMMA*/)) |
| 12310 this._eat(3/*TokenKind.RPAREN*/); | 12344 this._eat(3/*TokenKind.RPAREN*/); |
| 12311 } | 12345 } |
| 12312 return args; | 12346 return args; |
| 12313 } | 12347 } |
| 12314 lang_Parser.prototype.get$arguments = function() { | 12348 Parser.prototype.get$arguments = function() { |
| 12315 return lang_Parser.prototype.arguments.bind(this); | 12349 return Parser.prototype.arguments.bind(this); |
| 12316 } | 12350 } |
| 12317 lang_Parser.prototype.finishPostfixExpression = function(expr) { | 12351 Parser.prototype.finishPostfixExpression = function(expr) { |
| 12318 switch (this._peek()) { | 12352 switch (this._peek()) { |
| 12319 case 2/*TokenKind.LPAREN*/: | 12353 case 2/*TokenKind.LPAREN*/: |
| 12320 | 12354 |
| 12321 return this.finishPostfixExpression(new CallExpression(expr, this.argument
s(), this._makeSpan(expr.get$span().start))); | 12355 return this.finishPostfixExpression(new CallExpression(expr, this.argument
s(), this._makeSpan(expr.get$span().start))); |
| 12322 | 12356 |
| 12323 case 4/*TokenKind.LBRACK*/: | 12357 case 4/*TokenKind.LBRACK*/: |
| 12324 | 12358 |
| 12325 this._eat(4/*TokenKind.LBRACK*/); | 12359 this._eat(4/*TokenKind.LBRACK*/); |
| 12326 var index = this.expression(); | 12360 var index = this.expression(); |
| 12327 this._eat(5/*TokenKind.RBRACK*/); | 12361 this._eat(5/*TokenKind.RBRACK*/); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 12351 | 12385 |
| 12352 if (this._peekIdentifier()) { | 12386 if (this._peekIdentifier()) { |
| 12353 return this.finishPostfixExpression(new DeclaredIdentifier(this._makeTyp
e(expr), this.identifier(), this._makeSpan(expr.get$span().start))); | 12387 return this.finishPostfixExpression(new DeclaredIdentifier(this._makeTyp
e(expr), this.identifier(), this._makeSpan(expr.get$span().start))); |
| 12354 } | 12388 } |
| 12355 else { | 12389 else { |
| 12356 return expr; | 12390 return expr; |
| 12357 } | 12391 } |
| 12358 | 12392 |
| 12359 } | 12393 } |
| 12360 } | 12394 } |
| 12361 lang_Parser.prototype._isBin = function(expr, kind) { | 12395 Parser.prototype._isBin = function(expr, kind) { |
| 12362 return (expr instanceof BinaryExpression) && expr.op.kind == kind; | 12396 return (expr instanceof BinaryExpression) && expr.op.kind == kind; |
| 12363 } | 12397 } |
| 12364 lang_Parser.prototype._boolTypeRef = function(span) { | 12398 Parser.prototype._boolTypeRef = function(span) { |
| 12365 return new TypeReference(span, world.boolType); | 12399 return new TypeReference(span, world.boolType); |
| 12366 } | 12400 } |
| 12367 lang_Parser.prototype._numTypeRef = function(span) { | 12401 Parser.prototype._numTypeRef = function(span) { |
| 12368 return new TypeReference(span, world.numType); | 12402 return new TypeReference(span, world.numType); |
| 12369 } | 12403 } |
| 12370 lang_Parser.prototype._stringTypeRef = function(span) { | 12404 Parser.prototype._stringTypeRef = function(span) { |
| 12371 return new TypeReference(span, world.stringType); | 12405 return new TypeReference(span, world.stringType); |
| 12372 } | 12406 } |
| 12373 lang_Parser.prototype.primary = function() { | 12407 Parser.prototype.primary = function() { |
| 12374 var start = this._peekToken.start; | 12408 var start = this._peekToken.start; |
| 12375 switch (this._peek()) { | 12409 switch (this._peek()) { |
| 12376 case 107/*TokenKind.THIS*/: | 12410 case 107/*TokenKind.THIS*/: |
| 12377 | 12411 |
| 12378 this._eat(107/*TokenKind.THIS*/); | 12412 this._eat(107/*TokenKind.THIS*/); |
| 12379 return new ThisExpression(this._makeSpan(start)); | 12413 return new ThisExpression(this._makeSpan(start)); |
| 12380 | 12414 |
| 12381 case 105/*TokenKind.SUPER*/: | 12415 case 105/*TokenKind.SUPER*/: |
| 12382 | 12416 |
| 12383 this._eat(105/*TokenKind.SUPER*/); | 12417 this._eat(105/*TokenKind.SUPER*/); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12428 return new LiteralExpression(true, this._boolTypeRef(this._makeSpan(start)
), 'true', this._makeSpan(start)); | 12462 return new LiteralExpression(true, this._boolTypeRef(this._makeSpan(start)
), 'true', this._makeSpan(start)); |
| 12429 | 12463 |
| 12430 case 95/*TokenKind.FALSE*/: | 12464 case 95/*TokenKind.FALSE*/: |
| 12431 | 12465 |
| 12432 this._eat(95/*TokenKind.FALSE*/); | 12466 this._eat(95/*TokenKind.FALSE*/); |
| 12433 return new LiteralExpression(false, this._boolTypeRef(this._makeSpan(start
)), 'false', this._makeSpan(start)); | 12467 return new LiteralExpression(false, this._boolTypeRef(this._makeSpan(start
)), 'false', this._makeSpan(start)); |
| 12434 | 12468 |
| 12435 case 61/*TokenKind.HEX_NUMBER*/: | 12469 case 61/*TokenKind.HEX_NUMBER*/: |
| 12436 | 12470 |
| 12437 var t = this._lang_next(); | 12471 var t = this._lang_next(); |
| 12438 return new LiteralExpression(lang_Parser.parseHex(t.get$text().substring(2
)), this._numTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start)
); | 12472 return new LiteralExpression(Parser.parseHex(t.get$text().substring(2)), t
his._numTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start)); |
| 12439 | 12473 |
| 12440 case 60/*TokenKind.NUMBER*/: | 12474 case 60/*TokenKind.NUMBER*/: |
| 12441 | 12475 |
| 12442 var t = this._lang_next(); | 12476 var t = this._lang_next(); |
| 12443 return new LiteralExpression(Math.parseDouble(t.get$text()), this._numType
Ref(this._makeSpan(start)), t.get$text(), this._makeSpan(start)); | 12477 return new LiteralExpression(Math.parseDouble(t.get$text()), this._numType
Ref(this._makeSpan(start)), t.get$text(), this._makeSpan(start)); |
| 12444 | 12478 |
| 12445 case 58/*TokenKind.STRING*/: | 12479 case 58/*TokenKind.STRING*/: |
| 12446 | 12480 |
| 12447 return this.stringLiteralExpr(); | 12481 return this.stringLiteralExpr(); |
| 12448 | 12482 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 12462 | 12496 |
| 12463 default: | 12497 default: |
| 12464 | 12498 |
| 12465 if (!this._peekIdentifier()) { | 12499 if (!this._peekIdentifier()) { |
| 12466 this._errorExpected('expression'); | 12500 this._errorExpected('expression'); |
| 12467 } | 12501 } |
| 12468 return new VarExpression(this.identifier(), this._makeSpan(start)); | 12502 return new VarExpression(this.identifier(), this._makeSpan(start)); |
| 12469 | 12503 |
| 12470 } | 12504 } |
| 12471 } | 12505 } |
| 12472 lang_Parser.prototype.stringInterpolation = function() { | 12506 Parser.prototype.stringInterpolation = function() { |
| 12473 var start = this._peekToken.start; | 12507 var start = this._peekToken.start; |
| 12474 var lits = []; | 12508 var lits = []; |
| 12475 var startQuote = null, endQuote = null; | 12509 var startQuote = null, endQuote = null; |
| 12476 while (this._peekKind(65/*TokenKind.INCOMPLETE_STRING*/)) { | 12510 while (this._peekKind(65/*TokenKind.INCOMPLETE_STRING*/)) { |
| 12477 var token = this._lang_next(); | 12511 var token = this._lang_next(); |
| 12478 var text = token.get$text(); | 12512 var text = token.get$text(); |
| 12479 if (startQuote == null) { | 12513 if (startQuote == null) { |
| 12480 if (isMultilineString(text)) { | 12514 if (isMultilineString(text)) { |
| 12481 endQuote = text.substring(0, 3); | 12515 endQuote = text.substring(0, 3); |
| 12482 startQuote = endQuote + '\n'; | 12516 startQuote = endQuote + '\n'; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 12501 } | 12535 } |
| 12502 var tok = this._lang_next(); | 12536 var tok = this._lang_next(); |
| 12503 if (tok.kind != 58/*TokenKind.STRING*/) { | 12537 if (tok.kind != 58/*TokenKind.STRING*/) { |
| 12504 this._errorExpected('interpolated string'); | 12538 this._errorExpected('interpolated string'); |
| 12505 } | 12539 } |
| 12506 var text = startQuote + tok.get$text(); | 12540 var text = startQuote + tok.get$text(); |
| 12507 lits.add(this.makeStringLiteral(text, tok.get$span())); | 12541 lits.add(this.makeStringLiteral(text, tok.get$span())); |
| 12508 var span = this._makeSpan(start); | 12542 var span = this._makeSpan(start); |
| 12509 return new LiteralExpression(lits, this._stringTypeRef(span), '\$\$\$', span); | 12543 return new LiteralExpression(lits, this._stringTypeRef(span), '\$\$\$', span); |
| 12510 } | 12544 } |
| 12511 lang_Parser.prototype.makeStringLiteral = function(text, span) { | 12545 Parser.prototype.makeStringLiteral = function(text, span) { |
| 12512 return new LiteralExpression(text, this._stringTypeRef(span), text, span); | 12546 return new LiteralExpression(text, this._stringTypeRef(span), text, span); |
| 12513 } | 12547 } |
| 12514 lang_Parser.prototype.stringLiteralExpr = function() { | 12548 Parser.prototype.stringLiteralExpr = function() { |
| 12515 var token = this._lang_next(); | 12549 var token = this._lang_next(); |
| 12516 return this.makeStringLiteral(token.get$text(), token.get$span()); | 12550 return this.makeStringLiteral(token.get$text(), token.get$span()); |
| 12517 } | 12551 } |
| 12518 lang_Parser.prototype.maybeStringLiteral = function() { | 12552 Parser.prototype.maybeStringLiteral = function() { |
| 12519 var kind = this._peek(); | 12553 var kind = this._peek(); |
| 12520 if ($eq(kind, 58/*TokenKind.STRING*/)) { | 12554 if ($eq(kind, 58/*TokenKind.STRING*/)) { |
| 12521 return parseStringLiteral(this._lang_next().get$text()); | 12555 return parseStringLiteral(this._lang_next().get$text()); |
| 12522 } | 12556 } |
| 12523 else if ($eq(kind, 59/*TokenKind.STRING_PART*/)) { | 12557 else if ($eq(kind, 59/*TokenKind.STRING_PART*/)) { |
| 12524 this._lang_next(); | 12558 this._lang_next(); |
| 12525 this._errorExpected('string literal, but found interpolated string start'); | 12559 this._errorExpected('string literal, but found interpolated string start'); |
| 12526 } | 12560 } |
| 12527 else if ($eq(kind, 65/*TokenKind.INCOMPLETE_STRING*/)) { | 12561 else if ($eq(kind, 65/*TokenKind.INCOMPLETE_STRING*/)) { |
| 12528 this._lang_next(); | 12562 this._lang_next(); |
| 12529 this._errorExpected('string literal, but found incomplete string'); | 12563 this._errorExpected('string literal, but found incomplete string'); |
| 12530 } | 12564 } |
| 12531 return null; | 12565 return null; |
| 12532 } | 12566 } |
| 12533 lang_Parser.prototype._parenOrLambda = function() { | 12567 Parser.prototype._parenOrLambda = function() { |
| 12534 var start = this._peekToken.start; | 12568 var start = this._peekToken.start; |
| 12535 var args = this.arguments(); | 12569 var args = this.arguments(); |
| 12536 if (!this._inInitializers && (this._peekKind(9/*TokenKind.ARROW*/) || this._pe
ekKind(6/*TokenKind.LBRACE*/))) { | 12570 if (!this._inInitializers && (this._peekKind(9/*TokenKind.ARROW*/) || this._pe
ekKind(6/*TokenKind.LBRACE*/))) { |
| 12537 var body = this.functionBody(true); | 12571 var body = this.functionBody(true); |
| 12538 var formals = this._makeFormals(args); | 12572 var formals = this._makeFormals(args); |
| 12539 var func = new FunctionDefinition(null, null, null, formals, null, body, thi
s._makeSpan(start)); | 12573 var func = new FunctionDefinition(null, null, null, formals, null, body, thi
s._makeSpan(start)); |
| 12540 return new LambdaExpression(func, func.get$span()); | 12574 return new LambdaExpression(func, func.get$span()); |
| 12541 } | 12575 } |
| 12542 else { | 12576 else { |
| 12543 if (args.length == 1) { | 12577 if (args.length == 1) { |
| 12544 return new ParenExpression(args.$index(0).get$value(), this._makeSpan(star
t)); | 12578 return new ParenExpression(args.$index(0).get$value(), this._makeSpan(star
t)); |
| 12545 } | 12579 } |
| 12546 else { | 12580 else { |
| 12547 this._lang_error('unexpected comma expression'); | 12581 this._lang_error('unexpected comma expression'); |
| 12548 return args.$index(0).get$value(); | 12582 return args.$index(0).get$value(); |
| 12549 } | 12583 } |
| 12550 } | 12584 } |
| 12551 } | 12585 } |
| 12552 lang_Parser.prototype._typeAsIdentifier = function(type) { | 12586 Parser.prototype._typeAsIdentifier = function(type) { |
| 12553 return type.get$name(); | 12587 return type.get$name(); |
| 12554 } | 12588 } |
| 12555 lang_Parser.prototype._specialIdentifier = function(includeOperators) { | 12589 Parser.prototype._specialIdentifier = function(includeOperators) { |
| 12556 var start = this._peekToken.start; | 12590 var start = this._peekToken.start; |
| 12557 var name; | 12591 var name; |
| 12558 switch (this._peek()) { | 12592 switch (this._peek()) { |
| 12559 case 15/*TokenKind.ELLIPSIS*/: | 12593 case 15/*TokenKind.ELLIPSIS*/: |
| 12560 | 12594 |
| 12561 this._eat(15/*TokenKind.ELLIPSIS*/); | 12595 this._eat(15/*TokenKind.ELLIPSIS*/); |
| 12562 this._lang_error('rest no longer supported', this._previousToken); | 12596 this._lang_error('rest no longer supported', this._previousToken); |
| 12563 name = this.identifier().get$name(); | 12597 name = this.identifier().get$name(); |
| 12564 break; | 12598 break; |
| 12565 | 12599 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12612 this._lang_next(); | 12646 this._lang_next(); |
| 12613 } | 12647 } |
| 12614 } | 12648 } |
| 12615 break; | 12649 break; |
| 12616 | 12650 |
| 12617 default: | 12651 default: |
| 12618 | 12652 |
| 12619 return null; | 12653 return null; |
| 12620 | 12654 |
| 12621 } | 12655 } |
| 12622 return new lang_Identifier(name, this._makeSpan(start)); | 12656 return new Identifier(name, this._makeSpan(start)); |
| 12623 } | 12657 } |
| 12624 lang_Parser.prototype.declaredIdentifier = function(includeOperators) { | 12658 Parser.prototype.declaredIdentifier = function(includeOperators) { |
| 12625 var start = this._peekToken.start; | 12659 var start = this._peekToken.start; |
| 12626 var myType = null; | 12660 var myType = null; |
| 12627 var name = this._specialIdentifier(includeOperators); | 12661 var name = this._specialIdentifier(includeOperators); |
| 12628 if (name == null) { | 12662 if (name == null) { |
| 12629 myType = this.type(0); | 12663 myType = this.type(0); |
| 12630 name = this._specialIdentifier(includeOperators); | 12664 name = this._specialIdentifier(includeOperators); |
| 12631 if (name == null) { | 12665 if (name == null) { |
| 12632 if (this._peekIdentifier()) { | 12666 if (this._peekIdentifier()) { |
| 12633 name = this.identifier(); | 12667 name = this.identifier(); |
| 12634 } | 12668 } |
| 12635 else if ((myType instanceof NameTypeReference) && myType.names == null) { | 12669 else if ((myType instanceof NameTypeReference) && myType.names == null) { |
| 12636 name = this._typeAsIdentifier(myType); | 12670 name = this._typeAsIdentifier(myType); |
| 12637 myType = null; | 12671 myType = null; |
| 12638 } | 12672 } |
| 12639 else { | 12673 else { |
| 12640 } | 12674 } |
| 12641 } | 12675 } |
| 12642 } | 12676 } |
| 12643 return new DeclaredIdentifier(myType, name, this._makeSpan(start)); | 12677 return new DeclaredIdentifier(myType, name, this._makeSpan(start)); |
| 12644 } | 12678 } |
| 12645 lang_Parser._hexDigit = function(c) { | 12679 Parser._hexDigit = function(c) { |
| 12646 if (c >= 48 && c <= 57) { | 12680 if (c >= 48 && c <= 57) { |
| 12647 return c - 48; | 12681 return c - 48; |
| 12648 } | 12682 } |
| 12649 else if (c >= 97 && c <= 102) { | 12683 else if (c >= 97 && c <= 102) { |
| 12650 return c - 87; | 12684 return c - 87; |
| 12651 } | 12685 } |
| 12652 else if (c >= 65 && c <= 70) { | 12686 else if (c >= 65 && c <= 70) { |
| 12653 return c - 55; | 12687 return c - 55; |
| 12654 } | 12688 } |
| 12655 else { | 12689 else { |
| 12656 return -1; | 12690 return -1.000000/*-1*/; |
| 12657 } | 12691 } |
| 12658 } | 12692 } |
| 12659 lang_Parser.parseHex = function(hex) { | 12693 Parser.parseHex = function(hex) { |
| 12660 var result = 0; | 12694 var result = 0; |
| 12661 for (var i = 0; | 12695 for (var i = 0; |
| 12662 i < hex.length; i++) { | 12696 i < hex.length; i++) { |
| 12663 var digit = lang_Parser._hexDigit(hex.charCodeAt(i)); | 12697 var digit = Parser._hexDigit(hex.charCodeAt(i)); |
| 12664 result = (result << 4) + digit; | 12698 result = (result << 4) + digit; |
| 12665 } | 12699 } |
| 12666 return result; | 12700 return result; |
| 12667 } | 12701 } |
| 12668 lang_Parser.prototype.finishNewExpression = function(start, isConst) { | 12702 Parser.prototype.finishNewExpression = function(start, isConst) { |
| 12669 var type = this.type(0); | 12703 var type = this.type(0); |
| 12670 var name = null; | 12704 var name = null; |
| 12671 if (this._maybeEat(14/*TokenKind.DOT*/)) { | 12705 if (this._maybeEat(14/*TokenKind.DOT*/)) { |
| 12672 name = this.identifier(); | 12706 name = this.identifier(); |
| 12673 } | 12707 } |
| 12674 var args = this.arguments(); | 12708 var args = this.arguments(); |
| 12675 return new lang_NewExpression(isConst, type, name, args, this._makeSpan(start)
); | 12709 return new NewExpression(isConst, type, name, args, this._makeSpan(start)); |
| 12676 } | 12710 } |
| 12677 lang_Parser.prototype.finishListLiteral = function(start, isConst, type) { | 12711 Parser.prototype.finishListLiteral = function(start, isConst, type) { |
| 12678 if (this._maybeEat(56/*TokenKind.INDEX*/)) { | 12712 if (this._maybeEat(56/*TokenKind.INDEX*/)) { |
| 12679 return new ListExpression(isConst, type, [], this._makeSpan(start)); | 12713 return new ListExpression(isConst, type, [], this._makeSpan(start)); |
| 12680 } | 12714 } |
| 12681 var values = []; | 12715 var values = []; |
| 12682 this._eat(4/*TokenKind.LBRACK*/); | 12716 this._eat(4/*TokenKind.LBRACK*/); |
| 12683 while (!this._maybeEat(5/*TokenKind.RBRACK*/)) { | 12717 while (!this._maybeEat(5/*TokenKind.RBRACK*/)) { |
| 12684 if (this.isPrematureEndOfFile()) break; | 12718 if (this.isPrematureEndOfFile()) break; |
| 12685 values.add(this.expression()); | 12719 values.add(this.expression()); |
| 12686 if (!this._maybeEat(11/*TokenKind.COMMA*/)) { | 12720 if (!this._maybeEat(11/*TokenKind.COMMA*/)) { |
| 12687 this._eat(5/*TokenKind.RBRACK*/); | 12721 this._eat(5/*TokenKind.RBRACK*/); |
| 12688 break; | 12722 break; |
| 12689 } | 12723 } |
| 12690 } | 12724 } |
| 12691 return new ListExpression(isConst, type, values, this._makeSpan(start)); | 12725 return new ListExpression(isConst, type, values, this._makeSpan(start)); |
| 12692 } | 12726 } |
| 12693 lang_Parser.prototype.finishMapLiteral = function(start, isConst, type) { | 12727 Parser.prototype.finishMapLiteral = function(start, isConst, type) { |
| 12694 var items = []; | 12728 var items = []; |
| 12695 this._eat(6/*TokenKind.LBRACE*/); | 12729 this._eat(6/*TokenKind.LBRACE*/); |
| 12696 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) { | 12730 while (!this._maybeEat(7/*TokenKind.RBRACE*/)) { |
| 12697 if (this.isPrematureEndOfFile()) break; | 12731 if (this.isPrematureEndOfFile()) break; |
| 12698 items.add(this.expression()); | 12732 items.add(this.expression()); |
| 12699 this._eat(8/*TokenKind.COLON*/); | 12733 this._eat(8/*TokenKind.COLON*/); |
| 12700 items.add(this.expression()); | 12734 items.add(this.expression()); |
| 12701 if (!this._maybeEat(11/*TokenKind.COMMA*/)) { | 12735 if (!this._maybeEat(11/*TokenKind.COMMA*/)) { |
| 12702 this._eat(7/*TokenKind.RBRACE*/); | 12736 this._eat(7/*TokenKind.RBRACE*/); |
| 12703 break; | 12737 break; |
| 12704 } | 12738 } |
| 12705 } | 12739 } |
| 12706 return new MapExpression(isConst, type, items, this._makeSpan(start)); | 12740 return new MapExpression(isConst, type, items, this._makeSpan(start)); |
| 12707 } | 12741 } |
| 12708 lang_Parser.prototype.finishTypedLiteral = function(start, isConst) { | 12742 Parser.prototype.finishTypedLiteral = function(start, isConst) { |
| 12709 var span = this._makeSpan(start); | 12743 var span = this._makeSpan(start); |
| 12710 var typeToBeNamedLater = new NameTypeReference(false, null, null, span); | 12744 var typeToBeNamedLater = new NameTypeReference(false, null, null, span); |
| 12711 var genericType = this.addTypeArguments(typeToBeNamedLater, 0); | 12745 var genericType = this.addTypeArguments(typeToBeNamedLater, 0); |
| 12712 if (this._peekKind(4/*TokenKind.LBRACK*/) || this._peekKind(56/*TokenKind.INDE
X*/)) { | 12746 if (this._peekKind(4/*TokenKind.LBRACK*/) || this._peekKind(56/*TokenKind.INDE
X*/)) { |
| 12713 return this.finishListLiteral(start, isConst, genericType); | 12747 return this.finishListLiteral(start, isConst, genericType); |
| 12714 } | 12748 } |
| 12715 else if (this._peekKind(6/*TokenKind.LBRACE*/)) { | 12749 else if (this._peekKind(6/*TokenKind.LBRACE*/)) { |
| 12716 return this.finishMapLiteral(start, isConst, genericType); | 12750 return this.finishMapLiteral(start, isConst, genericType); |
| 12717 } | 12751 } |
| 12718 else { | 12752 else { |
| 12719 this._errorExpected('array or map literal'); | 12753 this._errorExpected('array or map literal'); |
| 12720 } | 12754 } |
| 12721 } | 12755 } |
| 12722 lang_Parser.prototype._readModifiers = function() { | 12756 Parser.prototype._readModifiers = function() { |
| 12723 var modifiers = null; | 12757 var modifiers = null; |
| 12724 while (true) { | 12758 while (true) { |
| 12725 switch (this._peek()) { | 12759 switch (this._peek()) { |
| 12726 case 85/*TokenKind.STATIC*/: | 12760 case 85/*TokenKind.STATIC*/: |
| 12727 case 96/*TokenKind.FINAL*/: | 12761 case 96/*TokenKind.FINAL*/: |
| 12728 case 90/*TokenKind.CONST*/: | 12762 case 90/*TokenKind.CONST*/: |
| 12729 case 70/*TokenKind.ABSTRACT*/: | 12763 case 70/*TokenKind.ABSTRACT*/: |
| 12730 case 74/*TokenKind.FACTORY*/: | 12764 case 74/*TokenKind.FACTORY*/: |
| 12731 | 12765 |
| 12732 if (modifiers == null) modifiers = []; | 12766 if (modifiers == null) modifiers = []; |
| 12733 modifiers.add(this._lang_next()); | 12767 modifiers.add(this._lang_next()); |
| 12734 break; | 12768 break; |
| 12735 | 12769 |
| 12736 default: | 12770 default: |
| 12737 | 12771 |
| 12738 return modifiers; | 12772 return modifiers; |
| 12739 | 12773 |
| 12740 } | 12774 } |
| 12741 } | 12775 } |
| 12742 return null; | 12776 return null; |
| 12743 } | 12777 } |
| 12744 lang_Parser.prototype.typeParameter = function() { | 12778 Parser.prototype.typeParameter = function() { |
| 12745 var start = this._peekToken.start; | 12779 var start = this._peekToken.start; |
| 12746 var name = this.identifier(); | 12780 var name = this.identifier(); |
| 12747 var myType = null; | 12781 var myType = null; |
| 12748 if (this._maybeEat(73/*TokenKind.EXTENDS*/)) { | 12782 if (this._maybeEat(73/*TokenKind.EXTENDS*/)) { |
| 12749 myType = this.type(1); | 12783 myType = this.type(1); |
| 12750 } | 12784 } |
| 12751 return new TypeParameter(name, myType, this._makeSpan(start)); | 12785 return new TypeParameter(name, myType, this._makeSpan(start)); |
| 12752 } | 12786 } |
| 12753 lang_Parser.prototype.typeParameters = function() { | 12787 Parser.prototype.typeParameters = function() { |
| 12754 this._eat(52/*TokenKind.LT*/); | 12788 this._eat(52/*TokenKind.LT*/); |
| 12755 var closed = false; | 12789 var closed = false; |
| 12756 var ret = []; | 12790 var ret = []; |
| 12757 do { | 12791 do { |
| 12758 var tp = this.typeParameter(); | 12792 var tp = this.typeParameter(); |
| 12759 ret.add(tp); | 12793 ret.add(tp); |
| 12760 if ((tp.extendsType instanceof GenericTypeReference) && tp.extendsType.depth
== 0) { | 12794 if ((tp.extendsType instanceof GenericTypeReference) && tp.extendsType.depth
== 0) { |
| 12761 closed = true; | 12795 closed = true; |
| 12762 break; | 12796 break; |
| 12763 } | 12797 } |
| 12764 } | 12798 } |
| 12765 while (this._maybeEat(11/*TokenKind.COMMA*/)) | 12799 while (this._maybeEat(11/*TokenKind.COMMA*/)) |
| 12766 if (!closed) { | 12800 if (!closed) { |
| 12767 this._eat(53/*TokenKind.GT*/); | 12801 this._eat(53/*TokenKind.GT*/); |
| 12768 } | 12802 } |
| 12769 return ret; | 12803 return ret; |
| 12770 } | 12804 } |
| 12771 lang_Parser.prototype.get$typeParameters = function() { | 12805 Parser.prototype.get$typeParameters = function() { |
| 12772 return lang_Parser.prototype.typeParameters.bind(this); | 12806 return Parser.prototype.typeParameters.bind(this); |
| 12773 } | 12807 } |
| 12774 lang_Parser.prototype._eatClosingAngle = function(depth) { | 12808 Parser.prototype._eatClosingAngle = function(depth) { |
| 12775 if (this._maybeEat(53/*TokenKind.GT*/)) { | 12809 if (this._maybeEat(53/*TokenKind.GT*/)) { |
| 12776 return depth; | 12810 return depth; |
| 12777 } | 12811 } |
| 12778 else if (depth > 0 && this._maybeEat(40/*TokenKind.SAR*/)) { | 12812 else if (depth > 0 && this._maybeEat(40/*TokenKind.SAR*/)) { |
| 12779 return depth - 1; | 12813 return depth - 1; |
| 12780 } | 12814 } |
| 12781 else if (depth > 1 && this._maybeEat(41/*TokenKind.SHR*/)) { | 12815 else if (depth > 1 && this._maybeEat(41/*TokenKind.SHR*/)) { |
| 12782 return depth - 2; | 12816 return depth - 2; |
| 12783 } | 12817 } |
| 12784 else { | 12818 else { |
| 12785 this._errorExpected('>'); | 12819 this._errorExpected('>'); |
| 12786 return depth; | 12820 return depth; |
| 12787 } | 12821 } |
| 12788 } | 12822 } |
| 12789 lang_Parser.prototype.addTypeArguments = function(baseType, depth) { | 12823 Parser.prototype.addTypeArguments = function(baseType, depth) { |
| 12790 this._eat(52/*TokenKind.LT*/); | 12824 this._eat(52/*TokenKind.LT*/); |
| 12791 return this._finishTypeArguments(baseType, depth, []); | 12825 return this._finishTypeArguments(baseType, depth, []); |
| 12792 } | 12826 } |
| 12793 lang_Parser.prototype._finishTypeArguments = function(baseType, depth, types) { | 12827 Parser.prototype._finishTypeArguments = function(baseType, depth, types) { |
| 12794 var delta = -1; | 12828 var delta = -1.000000/*-1*/; |
| 12795 do { | 12829 do { |
| 12796 var myType = this.type(depth + 1); | 12830 var myType = this.type(depth + 1); |
| 12797 types.add(myType); | 12831 types.add(myType); |
| 12798 if ((myType instanceof GenericTypeReference) && myType.depth <= depth) { | 12832 if ((myType instanceof GenericTypeReference) && myType.depth <= depth) { |
| 12799 delta = depth - myType.depth; | 12833 delta = depth - myType.depth; |
| 12800 break; | 12834 break; |
| 12801 } | 12835 } |
| 12802 } | 12836 } |
| 12803 while (this._maybeEat(11/*TokenKind.COMMA*/)) | 12837 while (this._maybeEat(11/*TokenKind.COMMA*/)) |
| 12804 if (delta >= 0) { | 12838 if (delta >= 0) { |
| 12805 depth = depth - delta; | 12839 depth = depth - delta; |
| 12806 } | 12840 } |
| 12807 else { | 12841 else { |
| 12808 depth = this._eatClosingAngle(depth); | 12842 depth = this._eatClosingAngle(depth); |
| 12809 } | 12843 } |
| 12810 var span = this._makeSpan(baseType.span.start); | 12844 var span = this._makeSpan(baseType.span.start); |
| 12811 return new GenericTypeReference(baseType, types, depth, span); | 12845 return new GenericTypeReference(baseType, types, depth, span); |
| 12812 } | 12846 } |
| 12813 lang_Parser.prototype.typeList = function() { | 12847 Parser.prototype.typeList = function() { |
| 12814 var types = []; | 12848 var types = []; |
| 12815 do { | 12849 do { |
| 12816 types.add(this.type(0)); | 12850 types.add(this.type(0)); |
| 12817 } | 12851 } |
| 12818 while (this._maybeEat(11/*TokenKind.COMMA*/)) | 12852 while (this._maybeEat(11/*TokenKind.COMMA*/)) |
| 12819 return types; | 12853 return types; |
| 12820 } | 12854 } |
| 12821 lang_Parser.prototype.type = function(depth) { | 12855 Parser.prototype.type = function(depth) { |
| 12822 var start = this._peekToken.start; | 12856 var start = this._peekToken.start; |
| 12823 var name; | 12857 var name; |
| 12824 var names = null; | 12858 var names = null; |
| 12825 var typeArgs = null; | 12859 var typeArgs = null; |
| 12826 var isFinal = false; | 12860 var isFinal = false; |
| 12827 switch (this._peek()) { | 12861 switch (this._peek()) { |
| 12828 case 112/*TokenKind.VOID*/: | 12862 case 112/*TokenKind.VOID*/: |
| 12829 | 12863 |
| 12830 return new TypeReference(this._lang_next().get$span(), world.voidType); | 12864 return new TypeReference(this._lang_next().get$span(), world.voidType); |
| 12831 | 12865 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 12851 names.add(this.identifier()); | 12885 names.add(this.identifier()); |
| 12852 } | 12886 } |
| 12853 var typeRef = new NameTypeReference(isFinal, name, names, this._makeSpan(start
)); | 12887 var typeRef = new NameTypeReference(isFinal, name, names, this._makeSpan(start
)); |
| 12854 if (this._peekKind(52/*TokenKind.LT*/)) { | 12888 if (this._peekKind(52/*TokenKind.LT*/)) { |
| 12855 return this.addTypeArguments(typeRef, depth); | 12889 return this.addTypeArguments(typeRef, depth); |
| 12856 } | 12890 } |
| 12857 else { | 12891 else { |
| 12858 return typeRef; | 12892 return typeRef; |
| 12859 } | 12893 } |
| 12860 } | 12894 } |
| 12861 lang_Parser.prototype.formalParameter = function(inOptionalBlock) { | 12895 Parser.prototype.formalParameter = function(inOptionalBlock) { |
| 12862 var start = this._peekToken.start; | 12896 var start = this._peekToken.start; |
| 12863 var isThis = false; | 12897 var isThis = false; |
| 12864 var isRest = false; | 12898 var isRest = false; |
| 12865 var di = this.declaredIdentifier(false); | 12899 var di = this.declaredIdentifier(false); |
| 12866 var type = di.type; | 12900 var type = di.type; |
| 12867 var name = di.get$name(); | 12901 var name = di.get$name(); |
| 12868 var value = null; | 12902 var value = null; |
| 12869 if (this._maybeEat(20/*TokenKind.ASSIGN*/)) { | 12903 if (this._maybeEat(20/*TokenKind.ASSIGN*/)) { |
| 12870 if (!inOptionalBlock) { | 12904 if (!inOptionalBlock) { |
| 12871 this._lang_error('default values only allowed inside [optional] section'); | 12905 this._lang_error('default values only allowed inside [optional] section'); |
| 12872 } | 12906 } |
| 12873 value = this.expression(); | 12907 value = this.expression(); |
| 12874 } | 12908 } |
| 12875 else if (this._peekKind(2/*TokenKind.LPAREN*/)) { | 12909 else if (this._peekKind(2/*TokenKind.LPAREN*/)) { |
| 12876 var formals = this.formalParameterList(); | 12910 var formals = this.formalParameterList(); |
| 12877 var func = new FunctionDefinition(null, type, name, formals, null, null, thi
s._makeSpan(start)); | 12911 var func = new FunctionDefinition(null, type, name, formals, null, null, thi
s._makeSpan(start)); |
| 12878 type = new FunctionTypeReference(false, func, func.get$span()); | 12912 type = new FunctionTypeReference(false, func, func.get$span()); |
| 12879 } | 12913 } |
| 12880 if (inOptionalBlock && value == null) { | 12914 if (inOptionalBlock && value == null) { |
| 12881 value = new NullExpression(this._makeSpan(start)); | 12915 value = new NullExpression(this._makeSpan(start)); |
| 12882 } | 12916 } |
| 12883 return new FormalNode(isThis, isRest, type, name, value, this._makeSpan(start)
); | 12917 return new FormalNode(isThis, isRest, type, name, value, this._makeSpan(start)
); |
| 12884 } | 12918 } |
| 12885 lang_Parser.prototype.formalParameterList = function() { | 12919 Parser.prototype.formalParameterList = function() { |
| 12886 this._eat(2/*TokenKind.LPAREN*/); | 12920 this._eat(2/*TokenKind.LPAREN*/); |
| 12887 var formals = []; | 12921 var formals = []; |
| 12888 var inOptionalBlock = false; | 12922 var inOptionalBlock = false; |
| 12889 if (!this._maybeEat(3/*TokenKind.RPAREN*/)) { | 12923 if (!this._maybeEat(3/*TokenKind.RPAREN*/)) { |
| 12890 if (this._maybeEat(4/*TokenKind.LBRACK*/)) { | 12924 if (this._maybeEat(4/*TokenKind.LBRACK*/)) { |
| 12891 inOptionalBlock = true; | 12925 inOptionalBlock = true; |
| 12892 } | 12926 } |
| 12893 formals.add(this.formalParameter(inOptionalBlock)); | 12927 formals.add(this.formalParameter(inOptionalBlock)); |
| 12894 while (this._maybeEat(11/*TokenKind.COMMA*/)) { | 12928 while (this._maybeEat(11/*TokenKind.COMMA*/)) { |
| 12895 if (this._maybeEat(4/*TokenKind.LBRACK*/)) { | 12929 if (this._maybeEat(4/*TokenKind.LBRACK*/)) { |
| 12896 if (inOptionalBlock) { | 12930 if (inOptionalBlock) { |
| 12897 this._lang_error('already inside an optional block', this._previousTok
en.get$span()); | 12931 this._lang_error('already inside an optional block', this._previousTok
en.get$span()); |
| 12898 } | 12932 } |
| 12899 inOptionalBlock = true; | 12933 inOptionalBlock = true; |
| 12900 } | 12934 } |
| 12901 formals.add(this.formalParameter(inOptionalBlock)); | 12935 formals.add(this.formalParameter(inOptionalBlock)); |
| 12902 } | 12936 } |
| 12903 if (inOptionalBlock) { | 12937 if (inOptionalBlock) { |
| 12904 this._eat(5/*TokenKind.RBRACK*/); | 12938 this._eat(5/*TokenKind.RBRACK*/); |
| 12905 } | 12939 } |
| 12906 this._eat(3/*TokenKind.RPAREN*/); | 12940 this._eat(3/*TokenKind.RPAREN*/); |
| 12907 } | 12941 } |
| 12908 return formals; | 12942 return formals; |
| 12909 } | 12943 } |
| 12910 lang_Parser.prototype.identifier = function() { | 12944 Parser.prototype.identifier = function() { |
| 12911 var tok = this._lang_next(); | 12945 var tok = this._lang_next(); |
| 12912 if (!TokenKind.isIdentifier(tok.kind)) { | 12946 if (!TokenKind.isIdentifier(tok.kind)) { |
| 12913 this._lang_error(('expected identifier, but found ' + tok + ''), tok.get$spa
n()); | 12947 this._lang_error(('expected identifier, but found ' + tok + ''), tok.get$spa
n()); |
| 12914 } | 12948 } |
| 12915 return new lang_Identifier(tok.get$text(), this._makeSpan(tok.start)); | 12949 return new Identifier(tok.get$text(), this._makeSpan(tok.start)); |
| 12916 } | 12950 } |
| 12917 lang_Parser.prototype._makeFunction = function(expr, body) { | 12951 Parser.prototype._makeFunction = function(expr, body) { |
| 12918 var name, type; | 12952 var name, type; |
| 12919 if ((expr instanceof CallExpression)) { | 12953 if ((expr instanceof CallExpression)) { |
| 12920 if ((expr.target instanceof VarExpression)) { | 12954 if ((expr.target instanceof VarExpression)) { |
| 12921 name = expr.target.get$name(); | 12955 name = expr.target.get$name(); |
| 12922 type = null; | 12956 type = null; |
| 12923 } | 12957 } |
| 12924 else if ((expr.target instanceof DeclaredIdentifier)) { | 12958 else if ((expr.target instanceof DeclaredIdentifier)) { |
| 12925 name = expr.target.get$name(); | 12959 name = expr.target.get$name(); |
| 12926 type = expr.target.type; | 12960 type = expr.target.type; |
| 12927 } | 12961 } |
| 12928 else { | 12962 else { |
| 12929 this._lang_error('bad function'); | 12963 this._lang_error('bad function'); |
| 12930 } | 12964 } |
| 12931 var formals = this._makeFormals(expr.get$arguments()); | 12965 var formals = this._makeFormals(expr.get$arguments()); |
| 12932 var span = new SourceSpan(expr.get$span().file, expr.get$span().start, body.
get$span().end); | 12966 var span = new SourceSpan(expr.get$span().file, expr.get$span().start, body.
get$span().end); |
| 12933 var func = new FunctionDefinition(null, type, name, formals, null, body, spa
n); | 12967 var func = new FunctionDefinition(null, type, name, formals, null, body, spa
n); |
| 12934 return new LambdaExpression(func, func.get$span()); | 12968 return new LambdaExpression(func, func.get$span()); |
| 12935 } | 12969 } |
| 12936 else { | 12970 else { |
| 12937 this._lang_error('expected function'); | 12971 this._lang_error('expected function'); |
| 12938 } | 12972 } |
| 12939 } | 12973 } |
| 12940 lang_Parser.prototype._makeFormal = function(expr) { | 12974 Parser.prototype._makeFormal = function(expr) { |
| 12941 if ((expr instanceof VarExpression)) { | 12975 if ((expr instanceof VarExpression)) { |
| 12942 return new FormalNode(false, false, null, expr.get$name(), null, expr.get$sp
an()); | 12976 return new FormalNode(false, false, null, expr.get$name(), null, expr.get$sp
an()); |
| 12943 } | 12977 } |
| 12944 else if ((expr instanceof DeclaredIdentifier)) { | 12978 else if ((expr instanceof DeclaredIdentifier)) { |
| 12945 return new FormalNode(false, false, expr.type, expr.get$name(), null, expr.g
et$span()); | 12979 return new FormalNode(false, false, expr.type, expr.get$name(), null, expr.g
et$span()); |
| 12946 } | 12980 } |
| 12947 else if (this._isBin(expr, 20/*TokenKind.ASSIGN*/) && ((expr.x instanceof Decl
aredIdentifier))) { | 12981 else if (this._isBin(expr, 20/*TokenKind.ASSIGN*/) && ((expr.x instanceof Decl
aredIdentifier))) { |
| 12948 var di = expr.x; | 12982 var di = expr.x; |
| 12949 return new FormalNode(false, false, di.type, di.name, expr.y, expr.get$span(
)); | 12983 return new FormalNode(false, false, di.type, di.name, expr.y, expr.get$span(
)); |
| 12950 } | 12984 } |
| 12951 else if (this._isBin(expr, 52/*TokenKind.LT*/)) { | 12985 else if (this._isBin(expr, 52/*TokenKind.LT*/)) { |
| 12952 return null; | 12986 return null; |
| 12953 } | 12987 } |
| 12954 else if ((expr instanceof ListExpression)) { | 12988 else if ((expr instanceof ListExpression)) { |
| 12955 return this._makeFormalsFromList(expr); | 12989 return this._makeFormalsFromList(expr); |
| 12956 } | 12990 } |
| 12957 else { | 12991 else { |
| 12958 this._lang_error('expected formal', expr.get$span()); | 12992 this._lang_error('expected formal', expr.get$span()); |
| 12959 } | 12993 } |
| 12960 } | 12994 } |
| 12961 lang_Parser.prototype._makeFormalsFromList = function(expr) { | 12995 Parser.prototype._makeFormalsFromList = function(expr) { |
| 12962 if (expr.get$isConst()) { | 12996 if (expr.get$isConst()) { |
| 12963 this._lang_error('expected formal, but found "const"', expr.get$span()); | 12997 this._lang_error('expected formal, but found "const"', expr.get$span()); |
| 12964 } | 12998 } |
| 12965 else if ($ne(expr.type, null)) { | 12999 else if ($ne(expr.type, null)) { |
| 12966 this._lang_error('expected formal, but found generic type arguments', expr.t
ype.get$span()); | 13000 this._lang_error('expected formal, but found generic type arguments', expr.t
ype.get$span()); |
| 12967 } | 13001 } |
| 12968 return this._makeFormalsFromExpressions(expr.values, false); | 13002 return this._makeFormalsFromExpressions(expr.values, false); |
| 12969 } | 13003 } |
| 12970 lang_Parser.prototype._makeFormals = function(arguments) { | 13004 Parser.prototype._makeFormals = function(arguments) { |
| 12971 var expressions = []; | 13005 var expressions = []; |
| 12972 for (var i = 0; | 13006 for (var i = 0; |
| 12973 i < arguments.length; i++) { | 13007 i < arguments.length; i++) { |
| 12974 var arg = arguments.$index(i); | 13008 var arg = arguments.$index(i); |
| 12975 if (arg.label != null) { | 13009 if (arg.label != null) { |
| 12976 this._lang_error('expected formal, but found ":"'); | 13010 this._lang_error('expected formal, but found ":"'); |
| 12977 } | 13011 } |
| 12978 expressions.add(arg.get$value()); | 13012 expressions.add(arg.get$value()); |
| 12979 } | 13013 } |
| 12980 return this._makeFormalsFromExpressions(expressions, true); | 13014 return this._makeFormalsFromExpressions(expressions, true); |
| 12981 } | 13015 } |
| 12982 lang_Parser.prototype._makeFormalsFromExpressions = function(expressions, allowO
ptional) { | 13016 Parser.prototype._makeFormalsFromExpressions = function(expressions, allowOption
al) { |
| 12983 var formals = []; | 13017 var formals = []; |
| 12984 for (var i = 0; | 13018 for (var i = 0; |
| 12985 i < expressions.length; i++) { | 13019 i < expressions.length; i++) { |
| 12986 var formal = this._makeFormal(expressions.$index(i)); | 13020 var formal = this._makeFormal(expressions.$index(i)); |
| 12987 if (formal == null) { | 13021 if (formal == null) { |
| 12988 var baseType = this._makeType(expressions.$index(i).x); | 13022 var baseType = this._makeType(expressions.$index(i).x); |
| 12989 var typeParams = [this._makeType(expressions.$index(i).y)]; | 13023 var typeParams = [this._makeType(expressions.$index(i).y)]; |
| 12990 i++; | 13024 i++; |
| 12991 while (i < expressions.length) { | 13025 while (i < expressions.length) { |
| 12992 var expr = expressions.$index(i++); | 13026 var expr = expressions.$index(i++); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 13015 if (!allowOptional) { | 13049 if (!allowOptional) { |
| 13016 this._lang_error('unexpected nested optional formal', expressions.$index
(i).get$span()); | 13050 this._lang_error('unexpected nested optional formal', expressions.$index
(i).get$span()); |
| 13017 } | 13051 } |
| 13018 } | 13052 } |
| 13019 else { | 13053 else { |
| 13020 formals.add(formal); | 13054 formals.add(formal); |
| 13021 } | 13055 } |
| 13022 } | 13056 } |
| 13023 return formals; | 13057 return formals; |
| 13024 } | 13058 } |
| 13025 lang_Parser.prototype._makeDeclaredIdentifier = function(e) { | 13059 Parser.prototype._makeDeclaredIdentifier = function(e) { |
| 13026 if ((e instanceof VarExpression)) { | 13060 if ((e instanceof VarExpression)) { |
| 13027 return new DeclaredIdentifier(null, e.get$name(), e.get$span()); | 13061 return new DeclaredIdentifier(null, e.get$name(), e.get$span()); |
| 13028 } | 13062 } |
| 13029 else if ((e instanceof DeclaredIdentifier)) { | 13063 else if ((e instanceof DeclaredIdentifier)) { |
| 13030 return e; | 13064 return e; |
| 13031 } | 13065 } |
| 13032 else { | 13066 else { |
| 13033 this._lang_error('expected declared identifier'); | 13067 this._lang_error('expected declared identifier'); |
| 13034 return new DeclaredIdentifier(null, null, e.get$span()); | 13068 return new DeclaredIdentifier(null, null, e.get$span()); |
| 13035 } | 13069 } |
| 13036 } | 13070 } |
| 13037 lang_Parser.prototype._makeLabel = function(expr) { | 13071 Parser.prototype._makeLabel = function(expr) { |
| 13038 if ((expr instanceof VarExpression)) { | 13072 if ((expr instanceof VarExpression)) { |
| 13039 return expr.get$name(); | 13073 return expr.get$name(); |
| 13040 } | 13074 } |
| 13041 else { | 13075 else { |
| 13042 this._errorExpected('label'); | 13076 this._errorExpected('label'); |
| 13043 return null; | 13077 return null; |
| 13044 } | 13078 } |
| 13045 } | 13079 } |
| 13046 // ********** Code for lang_Node ************** | 13080 // ********** Code for Node ************** |
| 13047 function lang_Node(span) { | 13081 function Node(span) { |
| 13048 this.span = span; | 13082 this.span = span; |
| 13049 // Initializers done | 13083 // Initializers done |
| 13050 } | 13084 } |
| 13051 lang_Node.prototype.get$span = function() { return this.span; }; | 13085 Node.prototype.get$span = function() { return this.span; }; |
| 13052 lang_Node.prototype.set$span = function(value) { return this.span = value; }; | 13086 Node.prototype.set$span = function(value) { return this.span = value; }; |
| 13053 // ********** Code for Definition ************** | 13087 // ********** Code for Definition ************** |
| 13054 function Definition(span) { | 13088 function Definition(span) { |
| 13055 lang_Statement.call(this, span); | 13089 Statement.call(this, span); |
| 13056 // Initializers done | 13090 // Initializers done |
| 13057 } | 13091 } |
| 13058 $inherits(Definition, lang_Statement); | 13092 $inherits(Definition, Statement); |
| 13059 Definition.prototype.get$typeParameters = function() { | 13093 Definition.prototype.get$typeParameters = function() { |
| 13060 return null; | 13094 return null; |
| 13061 } | 13095 } |
| 13062 // ********** Code for lang_Statement ************** | 13096 // ********** Code for Statement ************** |
| 13063 function lang_Statement(span) { | 13097 function Statement(span) { |
| 13064 lang_Node.call(this, span); | 13098 Node.call(this, span); |
| 13065 // Initializers done | 13099 // Initializers done |
| 13066 } | 13100 } |
| 13067 $inherits(lang_Statement, lang_Node); | 13101 $inherits(Statement, Node); |
| 13068 // ********** Code for lang_Expression ************** | 13102 // ********** Code for Expression ************** |
| 13069 function lang_Expression(span) { | 13103 function Expression(span) { |
| 13070 lang_Node.call(this, span); | 13104 Node.call(this, span); |
| 13071 // Initializers done | 13105 // Initializers done |
| 13072 } | 13106 } |
| 13073 $inherits(lang_Expression, lang_Node); | 13107 $inherits(Expression, Node); |
| 13074 // ********** Code for TypeReference ************** | 13108 // ********** Code for TypeReference ************** |
| 13075 function TypeReference(span, type) { | 13109 function TypeReference(span, type) { |
| 13076 this.type = type; | 13110 this.type = type; |
| 13077 lang_Node.call(this, span); | 13111 Node.call(this, span); |
| 13078 // Initializers done | 13112 // Initializers done |
| 13079 } | 13113 } |
| 13080 $inherits(TypeReference, lang_Node); | 13114 $inherits(TypeReference, Node); |
| 13081 TypeReference.prototype.visit = function(visitor) { | 13115 TypeReference.prototype.visit = function(visitor) { |
| 13082 return visitor.visitTypeReference(this); | 13116 return visitor.visitTypeReference(this); |
| 13083 } | 13117 } |
| 13084 // ********** Code for TreeOutput ************** | 13118 // ********** Code for TreeOutput ************** |
| 13085 function TreeOutput() {} | 13119 function TreeOutput() {} |
| 13086 TreeOutput.prototype.write = function(s) { | 13120 TreeOutput.prototype.write = function(s) { |
| 13087 for (var i = 0; | 13121 for (var i = 0; |
| 13088 i < this.depth; i++) { | 13122 i < this.depth; i++) { |
| 13089 this.buf.add(' '); | 13123 this.buf.add(' '); |
| 13090 } | 13124 } |
| 13091 this.buf.add(s); | 13125 this.buf.add(s); |
| 13092 } | 13126 } |
| 13093 TreeOutput.prototype.writeln = function(s) { | 13127 TreeOutput.prototype.writeln = function(s) { |
| 13094 this.write(s); | 13128 this.write(s); |
| 13095 this.buf.add('\n'); | 13129 this.buf.add('\n'); |
| 13096 } | 13130 } |
| 13097 TreeOutput.prototype.heading = function(name, span) { | 13131 TreeOutput.prototype.heading = function(name, span) { |
| 13098 this.buf.add(name); | 13132 this.buf.add(name); |
| 13099 this.buf.add('\n'); | 13133 this.buf.add('\n'); |
| 13100 } | 13134 } |
| 13101 TreeOutput.prototype.toValue = function(value) { | 13135 TreeOutput.prototype.toValue = function(value) { |
| 13102 if (value == null) return 'null'; | 13136 if (value == null) return 'null'; |
| 13103 else if ((value instanceof lang_Identifier)) return value.get$name(); | 13137 else if ((value instanceof Identifier)) return value.get$name(); |
| 13104 else return value.toString(); | 13138 else return value.toString(); |
| 13105 } | 13139 } |
| 13106 TreeOutput.prototype.writeNode = function(label, node) { | 13140 TreeOutput.prototype.writeNode = function(label, node) { |
| 13107 this.write(label + ': '); | 13141 this.write(label + ': '); |
| 13108 this.depth += 1; | 13142 this.depth += 1; |
| 13109 if (node != null) node.visit(this.printer); | 13143 if (node != null) node.visit(this.printer); |
| 13110 else this.writeln('null'); | 13144 else this.writeln('null'); |
| 13111 this.depth -= 1; | 13145 this.depth -= 1; |
| 13112 } | 13146 } |
| 13113 TreeOutput.prototype.writeValue = function(label, value) { | 13147 TreeOutput.prototype.writeValue = function(label, value) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13224 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp
e; }; | 13258 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp
e; }; |
| 13225 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu
rnType = value; }; | 13259 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu
rnType = value; }; |
| 13226 FunctionDefinition.prototype.get$name = function() { return this.name; }; | 13260 FunctionDefinition.prototype.get$name = function() { return this.name; }; |
| 13227 FunctionDefinition.prototype.set$name = function(value) { return this.name = val
ue; }; | 13261 FunctionDefinition.prototype.set$name = function(value) { return this.name = val
ue; }; |
| 13228 FunctionDefinition.prototype.visit = function(visitor) { | 13262 FunctionDefinition.prototype.visit = function(visitor) { |
| 13229 return visitor.visitFunctionDefinition(this); | 13263 return visitor.visitFunctionDefinition(this); |
| 13230 } | 13264 } |
| 13231 // ********** Code for ReturnStatement ************** | 13265 // ********** Code for ReturnStatement ************** |
| 13232 function ReturnStatement(value, span) { | 13266 function ReturnStatement(value, span) { |
| 13233 this.value = value; | 13267 this.value = value; |
| 13234 lang_Statement.call(this, span); | 13268 Statement.call(this, span); |
| 13235 // Initializers done | 13269 // Initializers done |
| 13236 } | 13270 } |
| 13237 $inherits(ReturnStatement, lang_Statement); | 13271 $inherits(ReturnStatement, Statement); |
| 13238 ReturnStatement.prototype.get$value = function() { return this.value; }; | 13272 ReturnStatement.prototype.get$value = function() { return this.value; }; |
| 13239 ReturnStatement.prototype.set$value = function(value) { return this.value = valu
e; }; | 13273 ReturnStatement.prototype.set$value = function(value) { return this.value = valu
e; }; |
| 13240 ReturnStatement.prototype.visit = function(visitor) { | 13274 ReturnStatement.prototype.visit = function(visitor) { |
| 13241 return visitor.visitReturnStatement(this); | 13275 return visitor.visitReturnStatement(this); |
| 13242 } | 13276 } |
| 13243 // ********** Code for ThrowStatement ************** | 13277 // ********** Code for ThrowStatement ************** |
| 13244 function ThrowStatement(value, span) { | 13278 function ThrowStatement(value, span) { |
| 13245 this.value = value; | 13279 this.value = value; |
| 13246 lang_Statement.call(this, span); | 13280 Statement.call(this, span); |
| 13247 // Initializers done | 13281 // Initializers done |
| 13248 } | 13282 } |
| 13249 $inherits(ThrowStatement, lang_Statement); | 13283 $inherits(ThrowStatement, Statement); |
| 13250 ThrowStatement.prototype.get$value = function() { return this.value; }; | 13284 ThrowStatement.prototype.get$value = function() { return this.value; }; |
| 13251 ThrowStatement.prototype.set$value = function(value) { return this.value = value
; }; | 13285 ThrowStatement.prototype.set$value = function(value) { return this.value = value
; }; |
| 13252 ThrowStatement.prototype.visit = function(visitor) { | 13286 ThrowStatement.prototype.visit = function(visitor) { |
| 13253 return visitor.visitThrowStatement(this); | 13287 return visitor.visitThrowStatement(this); |
| 13254 } | 13288 } |
| 13255 // ********** Code for AssertStatement ************** | 13289 // ********** Code for AssertStatement ************** |
| 13256 function AssertStatement(test, span) { | 13290 function AssertStatement(test, span) { |
| 13257 this.test = test; | 13291 this.test = test; |
| 13258 lang_Statement.call(this, span); | 13292 Statement.call(this, span); |
| 13259 // Initializers done | 13293 // Initializers done |
| 13260 } | 13294 } |
| 13261 $inherits(AssertStatement, lang_Statement); | 13295 $inherits(AssertStatement, Statement); |
| 13262 AssertStatement.prototype.visit = function(visitor) { | 13296 AssertStatement.prototype.visit = function(visitor) { |
| 13263 return visitor.visitAssertStatement(this); | 13297 return visitor.visitAssertStatement(this); |
| 13264 } | 13298 } |
| 13265 // ********** Code for BreakStatement ************** | 13299 // ********** Code for BreakStatement ************** |
| 13266 function BreakStatement(label, span) { | 13300 function BreakStatement(label, span) { |
| 13267 this.label = label; | 13301 this.label = label; |
| 13268 lang_Statement.call(this, span); | 13302 Statement.call(this, span); |
| 13269 // Initializers done | 13303 // Initializers done |
| 13270 } | 13304 } |
| 13271 $inherits(BreakStatement, lang_Statement); | 13305 $inherits(BreakStatement, Statement); |
| 13272 BreakStatement.prototype.visit = function(visitor) { | 13306 BreakStatement.prototype.visit = function(visitor) { |
| 13273 return visitor.visitBreakStatement(this); | 13307 return visitor.visitBreakStatement(this); |
| 13274 } | 13308 } |
| 13275 // ********** Code for ContinueStatement ************** | 13309 // ********** Code for ContinueStatement ************** |
| 13276 function ContinueStatement(label, span) { | 13310 function ContinueStatement(label, span) { |
| 13277 this.label = label; | 13311 this.label = label; |
| 13278 lang_Statement.call(this, span); | 13312 Statement.call(this, span); |
| 13279 // Initializers done | 13313 // Initializers done |
| 13280 } | 13314 } |
| 13281 $inherits(ContinueStatement, lang_Statement); | 13315 $inherits(ContinueStatement, Statement); |
| 13282 ContinueStatement.prototype.visit = function(visitor) { | 13316 ContinueStatement.prototype.visit = function(visitor) { |
| 13283 return visitor.visitContinueStatement(this); | 13317 return visitor.visitContinueStatement(this); |
| 13284 } | 13318 } |
| 13285 // ********** Code for IfStatement ************** | 13319 // ********** Code for IfStatement ************** |
| 13286 function IfStatement(test, trueBranch, falseBranch, span) { | 13320 function IfStatement(test, trueBranch, falseBranch, span) { |
| 13287 this.test = test; | 13321 this.test = test; |
| 13288 this.trueBranch = trueBranch; | 13322 this.trueBranch = trueBranch; |
| 13289 this.falseBranch = falseBranch; | 13323 this.falseBranch = falseBranch; |
| 13290 lang_Statement.call(this, span); | 13324 Statement.call(this, span); |
| 13291 // Initializers done | 13325 // Initializers done |
| 13292 } | 13326 } |
| 13293 $inherits(IfStatement, lang_Statement); | 13327 $inherits(IfStatement, Statement); |
| 13294 IfStatement.prototype.visit = function(visitor) { | 13328 IfStatement.prototype.visit = function(visitor) { |
| 13295 return visitor.visitIfStatement(this); | 13329 return visitor.visitIfStatement(this); |
| 13296 } | 13330 } |
| 13297 // ********** Code for WhileStatement ************** | 13331 // ********** Code for WhileStatement ************** |
| 13298 function WhileStatement(test, body, span) { | 13332 function WhileStatement(test, body, span) { |
| 13299 this.test = test; | 13333 this.test = test; |
| 13300 this.body = body; | 13334 this.body = body; |
| 13301 lang_Statement.call(this, span); | 13335 Statement.call(this, span); |
| 13302 // Initializers done | 13336 // Initializers done |
| 13303 } | 13337 } |
| 13304 $inherits(WhileStatement, lang_Statement); | 13338 $inherits(WhileStatement, Statement); |
| 13305 WhileStatement.prototype.visit = function(visitor) { | 13339 WhileStatement.prototype.visit = function(visitor) { |
| 13306 return visitor.visitWhileStatement(this); | 13340 return visitor.visitWhileStatement(this); |
| 13307 } | 13341 } |
| 13308 // ********** Code for DoStatement ************** | 13342 // ********** Code for DoStatement ************** |
| 13309 function DoStatement(body, test, span) { | 13343 function DoStatement(body, test, span) { |
| 13310 this.body = body; | 13344 this.body = body; |
| 13311 this.test = test; | 13345 this.test = test; |
| 13312 lang_Statement.call(this, span); | 13346 Statement.call(this, span); |
| 13313 // Initializers done | 13347 // Initializers done |
| 13314 } | 13348 } |
| 13315 $inherits(DoStatement, lang_Statement); | 13349 $inherits(DoStatement, Statement); |
| 13316 DoStatement.prototype.visit = function(visitor) { | 13350 DoStatement.prototype.visit = function(visitor) { |
| 13317 return visitor.visitDoStatement(this); | 13351 return visitor.visitDoStatement(this); |
| 13318 } | 13352 } |
| 13319 // ********** Code for ForStatement ************** | 13353 // ********** Code for ForStatement ************** |
| 13320 function ForStatement(init, test, step, body, span) { | 13354 function ForStatement(init, test, step, body, span) { |
| 13321 this.init = init; | 13355 this.init = init; |
| 13322 this.test = test; | 13356 this.test = test; |
| 13323 this.step = step; | 13357 this.step = step; |
| 13324 this.body = body; | 13358 this.body = body; |
| 13325 lang_Statement.call(this, span); | 13359 Statement.call(this, span); |
| 13326 // Initializers done | 13360 // Initializers done |
| 13327 } | 13361 } |
| 13328 $inherits(ForStatement, lang_Statement); | 13362 $inherits(ForStatement, Statement); |
| 13329 ForStatement.prototype.visit = function(visitor) { | 13363 ForStatement.prototype.visit = function(visitor) { |
| 13330 return visitor.visitForStatement(this); | 13364 return visitor.visitForStatement(this); |
| 13331 } | 13365 } |
| 13332 // ********** Code for ForInStatement ************** | 13366 // ********** Code for ForInStatement ************** |
| 13333 function ForInStatement(item, list, body, span) { | 13367 function ForInStatement(item, list, body, span) { |
| 13334 this.item = item; | 13368 this.item = item; |
| 13335 this.list = list; | 13369 this.list = list; |
| 13336 this.body = body; | 13370 this.body = body; |
| 13337 lang_Statement.call(this, span); | 13371 Statement.call(this, span); |
| 13338 // Initializers done | 13372 // Initializers done |
| 13339 } | 13373 } |
| 13340 $inherits(ForInStatement, lang_Statement); | 13374 $inherits(ForInStatement, Statement); |
| 13341 ForInStatement.prototype.visit = function(visitor) { | 13375 ForInStatement.prototype.visit = function(visitor) { |
| 13342 return visitor.visitForInStatement(this); | 13376 return visitor.visitForInStatement(this); |
| 13343 } | 13377 } |
| 13344 // ********** Code for TryStatement ************** | 13378 // ********** Code for TryStatement ************** |
| 13345 function TryStatement(body, catches, finallyBlock, span) { | 13379 function TryStatement(body, catches, finallyBlock, span) { |
| 13346 this.body = body; | 13380 this.body = body; |
| 13347 this.catches = catches; | 13381 this.catches = catches; |
| 13348 this.finallyBlock = finallyBlock; | 13382 this.finallyBlock = finallyBlock; |
| 13349 lang_Statement.call(this, span); | 13383 Statement.call(this, span); |
| 13350 // Initializers done | 13384 // Initializers done |
| 13351 } | 13385 } |
| 13352 $inherits(TryStatement, lang_Statement); | 13386 $inherits(TryStatement, Statement); |
| 13353 TryStatement.prototype.visit = function(visitor) { | 13387 TryStatement.prototype.visit = function(visitor) { |
| 13354 return visitor.visitTryStatement(this); | 13388 return visitor.visitTryStatement(this); |
| 13355 } | 13389 } |
| 13356 // ********** Code for SwitchStatement ************** | 13390 // ********** Code for SwitchStatement ************** |
| 13357 function SwitchStatement(test, cases, span) { | 13391 function SwitchStatement(test, cases, span) { |
| 13358 this.test = test; | 13392 this.test = test; |
| 13359 this.cases = cases; | 13393 this.cases = cases; |
| 13360 lang_Statement.call(this, span); | 13394 Statement.call(this, span); |
| 13361 // Initializers done | 13395 // Initializers done |
| 13362 } | 13396 } |
| 13363 $inherits(SwitchStatement, lang_Statement); | 13397 $inherits(SwitchStatement, Statement); |
| 13364 SwitchStatement.prototype.visit = function(visitor) { | 13398 SwitchStatement.prototype.visit = function(visitor) { |
| 13365 return visitor.visitSwitchStatement(this); | 13399 return visitor.visitSwitchStatement(this); |
| 13366 } | 13400 } |
| 13367 // ********** Code for BlockStatement ************** | 13401 // ********** Code for BlockStatement ************** |
| 13368 function BlockStatement(body, span) { | 13402 function BlockStatement(body, span) { |
| 13369 this.body = body; | 13403 this.body = body; |
| 13370 lang_Statement.call(this, span); | 13404 Statement.call(this, span); |
| 13371 // Initializers done | 13405 // Initializers done |
| 13372 } | 13406 } |
| 13373 $inherits(BlockStatement, lang_Statement); | 13407 $inherits(BlockStatement, Statement); |
| 13374 BlockStatement.prototype.visit = function(visitor) { | 13408 BlockStatement.prototype.visit = function(visitor) { |
| 13375 return visitor.visitBlockStatement(this); | 13409 return visitor.visitBlockStatement(this); |
| 13376 } | 13410 } |
| 13377 // ********** Code for LabeledStatement ************** | 13411 // ********** Code for LabeledStatement ************** |
| 13378 function LabeledStatement(name, body, span) { | 13412 function LabeledStatement(name, body, span) { |
| 13379 this.name = name; | 13413 this.name = name; |
| 13380 this.body = body; | 13414 this.body = body; |
| 13381 lang_Statement.call(this, span); | 13415 Statement.call(this, span); |
| 13382 // Initializers done | 13416 // Initializers done |
| 13383 } | 13417 } |
| 13384 $inherits(LabeledStatement, lang_Statement); | 13418 $inherits(LabeledStatement, Statement); |
| 13385 LabeledStatement.prototype.get$name = function() { return this.name; }; | 13419 LabeledStatement.prototype.get$name = function() { return this.name; }; |
| 13386 LabeledStatement.prototype.set$name = function(value) { return this.name = value
; }; | 13420 LabeledStatement.prototype.set$name = function(value) { return this.name = value
; }; |
| 13387 LabeledStatement.prototype.visit = function(visitor) { | 13421 LabeledStatement.prototype.visit = function(visitor) { |
| 13388 return visitor.visitLabeledStatement(this); | 13422 return visitor.visitLabeledStatement(this); |
| 13389 } | 13423 } |
| 13390 // ********** Code for lang_ExpressionStatement ************** | 13424 // ********** Code for ExpressionStatement ************** |
| 13391 function lang_ExpressionStatement(body, span) { | 13425 function ExpressionStatement(body, span) { |
| 13392 this.body = body; | 13426 this.body = body; |
| 13393 lang_Statement.call(this, span); | 13427 Statement.call(this, span); |
| 13394 // Initializers done | 13428 // Initializers done |
| 13395 } | 13429 } |
| 13396 $inherits(lang_ExpressionStatement, lang_Statement); | 13430 $inherits(ExpressionStatement, Statement); |
| 13397 lang_ExpressionStatement.prototype.visit = function(visitor) { | 13431 ExpressionStatement.prototype.visit = function(visitor) { |
| 13398 return visitor.visitExpressionStatement(this); | 13432 return visitor.visitExpressionStatement(this); |
| 13399 } | 13433 } |
| 13400 // ********** Code for EmptyStatement ************** | 13434 // ********** Code for EmptyStatement ************** |
| 13401 function EmptyStatement(span) { | 13435 function EmptyStatement(span) { |
| 13402 lang_Statement.call(this, span); | 13436 Statement.call(this, span); |
| 13403 // Initializers done | 13437 // Initializers done |
| 13404 } | 13438 } |
| 13405 $inherits(EmptyStatement, lang_Statement); | 13439 $inherits(EmptyStatement, Statement); |
| 13406 EmptyStatement.prototype.visit = function(visitor) { | 13440 EmptyStatement.prototype.visit = function(visitor) { |
| 13407 return visitor.visitEmptyStatement(this); | 13441 return visitor.visitEmptyStatement(this); |
| 13408 } | 13442 } |
| 13409 // ********** Code for DietStatement ************** | 13443 // ********** Code for DietStatement ************** |
| 13410 function DietStatement(span) { | 13444 function DietStatement(span) { |
| 13411 lang_Statement.call(this, span); | 13445 Statement.call(this, span); |
| 13412 // Initializers done | 13446 // Initializers done |
| 13413 } | 13447 } |
| 13414 $inherits(DietStatement, lang_Statement); | 13448 $inherits(DietStatement, Statement); |
| 13415 DietStatement.prototype.visit = function(visitor) { | 13449 DietStatement.prototype.visit = function(visitor) { |
| 13416 return visitor.visitDietStatement(this); | 13450 return visitor.visitDietStatement(this); |
| 13417 } | 13451 } |
| 13418 // ********** Code for NativeStatement ************** | 13452 // ********** Code for NativeStatement ************** |
| 13419 function NativeStatement(body, span) { | 13453 function NativeStatement(body, span) { |
| 13420 this.body = body; | 13454 this.body = body; |
| 13421 lang_Statement.call(this, span); | 13455 Statement.call(this, span); |
| 13422 // Initializers done | 13456 // Initializers done |
| 13423 } | 13457 } |
| 13424 $inherits(NativeStatement, lang_Statement); | 13458 $inherits(NativeStatement, Statement); |
| 13425 NativeStatement.prototype.visit = function(visitor) { | 13459 NativeStatement.prototype.visit = function(visitor) { |
| 13426 return visitor.visitNativeStatement(this); | 13460 return visitor.visitNativeStatement(this); |
| 13427 } | 13461 } |
| 13428 // ********** Code for LambdaExpression ************** | 13462 // ********** Code for LambdaExpression ************** |
| 13429 function LambdaExpression(func, span) { | 13463 function LambdaExpression(func, span) { |
| 13430 this.func = func; | 13464 this.func = func; |
| 13431 lang_Expression.call(this, span); | 13465 Expression.call(this, span); |
| 13432 // Initializers done | 13466 // Initializers done |
| 13433 } | 13467 } |
| 13434 $inherits(LambdaExpression, lang_Expression); | 13468 $inherits(LambdaExpression, Expression); |
| 13435 LambdaExpression.prototype.visit = function(visitor) { | 13469 LambdaExpression.prototype.visit = function(visitor) { |
| 13436 return visitor.visitLambdaExpression(this); | 13470 return visitor.visitLambdaExpression(this); |
| 13437 } | 13471 } |
| 13438 // ********** Code for CallExpression ************** | 13472 // ********** Code for CallExpression ************** |
| 13439 function CallExpression(target, arguments, span) { | 13473 function CallExpression(target, arguments, span) { |
| 13440 this.target = target; | 13474 this.target = target; |
| 13441 this.arguments = arguments; | 13475 this.arguments = arguments; |
| 13442 lang_Expression.call(this, span); | 13476 Expression.call(this, span); |
| 13443 // Initializers done | 13477 // Initializers done |
| 13444 } | 13478 } |
| 13445 $inherits(CallExpression, lang_Expression); | 13479 $inherits(CallExpression, Expression); |
| 13446 CallExpression.prototype.get$arguments = function() { return this.arguments; }; | 13480 CallExpression.prototype.get$arguments = function() { return this.arguments; }; |
| 13447 CallExpression.prototype.set$arguments = function(value) { return this.arguments
= value; }; | 13481 CallExpression.prototype.set$arguments = function(value) { return this.arguments
= value; }; |
| 13448 CallExpression.prototype.visit = function(visitor) { | 13482 CallExpression.prototype.visit = function(visitor) { |
| 13449 return visitor.visitCallExpression(this); | 13483 return visitor.visitCallExpression(this); |
| 13450 } | 13484 } |
| 13451 // ********** Code for IndexExpression ************** | 13485 // ********** Code for IndexExpression ************** |
| 13452 function IndexExpression(target, index, span) { | 13486 function IndexExpression(target, index, span) { |
| 13453 this.target = target; | 13487 this.target = target; |
| 13454 this.index = index; | 13488 this.index = index; |
| 13455 lang_Expression.call(this, span); | 13489 Expression.call(this, span); |
| 13456 // Initializers done | 13490 // Initializers done |
| 13457 } | 13491 } |
| 13458 $inherits(IndexExpression, lang_Expression); | 13492 $inherits(IndexExpression, Expression); |
| 13459 IndexExpression.prototype.visit = function(visitor) { | 13493 IndexExpression.prototype.visit = function(visitor) { |
| 13460 return visitor.visitIndexExpression(this); | 13494 return visitor.visitIndexExpression(this); |
| 13461 } | 13495 } |
| 13462 // ********** Code for BinaryExpression ************** | 13496 // ********** Code for BinaryExpression ************** |
| 13463 function BinaryExpression(op, x, y, span) { | 13497 function BinaryExpression(op, x, y, span) { |
| 13464 this.op = op; | 13498 this.op = op; |
| 13465 this.x = x; | 13499 this.x = x; |
| 13466 this.y = y; | 13500 this.y = y; |
| 13467 lang_Expression.call(this, span); | 13501 Expression.call(this, span); |
| 13468 // Initializers done | 13502 // Initializers done |
| 13469 } | 13503 } |
| 13470 $inherits(BinaryExpression, lang_Expression); | 13504 $inherits(BinaryExpression, Expression); |
| 13471 BinaryExpression.prototype.visit = function(visitor) { | 13505 BinaryExpression.prototype.visit = function(visitor) { |
| 13472 return visitor.visitBinaryExpression(this); | 13506 return visitor.visitBinaryExpression(this); |
| 13473 } | 13507 } |
| 13474 // ********** Code for UnaryExpression ************** | 13508 // ********** Code for UnaryExpression ************** |
| 13475 function UnaryExpression(op, self, span) { | 13509 function UnaryExpression(op, self, span) { |
| 13476 this.op = op; | 13510 this.op = op; |
| 13477 this.self = self; | 13511 this.self = self; |
| 13478 lang_Expression.call(this, span); | 13512 Expression.call(this, span); |
| 13479 // Initializers done | 13513 // Initializers done |
| 13480 } | 13514 } |
| 13481 $inherits(UnaryExpression, lang_Expression); | 13515 $inherits(UnaryExpression, Expression); |
| 13482 UnaryExpression.prototype.visit = function(visitor) { | 13516 UnaryExpression.prototype.visit = function(visitor) { |
| 13483 return visitor.visitUnaryExpression(this); | 13517 return visitor.visitUnaryExpression(this); |
| 13484 } | 13518 } |
| 13485 // ********** Code for PostfixExpression ************** | 13519 // ********** Code for PostfixExpression ************** |
| 13486 function PostfixExpression(body, op, span) { | 13520 function PostfixExpression(body, op, span) { |
| 13487 this.body = body; | 13521 this.body = body; |
| 13488 this.op = op; | 13522 this.op = op; |
| 13489 lang_Expression.call(this, span); | 13523 Expression.call(this, span); |
| 13490 // Initializers done | 13524 // Initializers done |
| 13491 } | 13525 } |
| 13492 $inherits(PostfixExpression, lang_Expression); | 13526 $inherits(PostfixExpression, Expression); |
| 13493 PostfixExpression.prototype.visit = function(visitor) { | 13527 PostfixExpression.prototype.visit = function(visitor) { |
| 13494 return visitor.visitPostfixExpression$1(this); | 13528 return visitor.visitPostfixExpression$1(this); |
| 13495 } | 13529 } |
| 13496 // ********** Code for lang_NewExpression ************** | 13530 // ********** Code for NewExpression ************** |
| 13497 function lang_NewExpression(isConst, type, name, arguments, span) { | 13531 function NewExpression(isConst, type, name, arguments, span) { |
| 13498 this.isConst = isConst; | 13532 this.isConst = isConst; |
| 13499 this.type = type; | 13533 this.type = type; |
| 13500 this.name = name; | 13534 this.name = name; |
| 13501 this.arguments = arguments; | 13535 this.arguments = arguments; |
| 13502 lang_Expression.call(this, span); | 13536 Expression.call(this, span); |
| 13503 // Initializers done | 13537 // Initializers done |
| 13504 } | 13538 } |
| 13505 $inherits(lang_NewExpression, lang_Expression); | 13539 $inherits(NewExpression, Expression); |
| 13506 lang_NewExpression.prototype.get$isConst = function() { return this.isConst; }; | 13540 NewExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 13507 lang_NewExpression.prototype.set$isConst = function(value) { return this.isConst
= value; }; | 13541 NewExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; |
| 13508 lang_NewExpression.prototype.get$name = function() { return this.name; }; | 13542 NewExpression.prototype.get$name = function() { return this.name; }; |
| 13509 lang_NewExpression.prototype.set$name = function(value) { return this.name = val
ue; }; | 13543 NewExpression.prototype.set$name = function(value) { return this.name = value; }
; |
| 13510 lang_NewExpression.prototype.get$arguments = function() { return this.arguments;
}; | 13544 NewExpression.prototype.get$arguments = function() { return this.arguments; }; |
| 13511 lang_NewExpression.prototype.set$arguments = function(value) { return this.argum
ents = value; }; | 13545 NewExpression.prototype.set$arguments = function(value) { return this.arguments
= value; }; |
| 13512 lang_NewExpression.prototype.visit = function(visitor) { | 13546 NewExpression.prototype.visit = function(visitor) { |
| 13513 return visitor.visitNewExpression(this); | 13547 return visitor.visitNewExpression(this); |
| 13514 } | 13548 } |
| 13515 // ********** Code for ListExpression ************** | 13549 // ********** Code for ListExpression ************** |
| 13516 function ListExpression(isConst, type, values, span) { | 13550 function ListExpression(isConst, type, values, span) { |
| 13517 this.isConst = isConst; | 13551 this.isConst = isConst; |
| 13518 this.type = type; | 13552 this.type = type; |
| 13519 this.values = values; | 13553 this.values = values; |
| 13520 lang_Expression.call(this, span); | 13554 Expression.call(this, span); |
| 13521 // Initializers done | 13555 // Initializers done |
| 13522 } | 13556 } |
| 13523 $inherits(ListExpression, lang_Expression); | 13557 $inherits(ListExpression, Expression); |
| 13524 ListExpression.prototype.get$isConst = function() { return this.isConst; }; | 13558 ListExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 13525 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v
alue; }; | 13559 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v
alue; }; |
| 13526 ListExpression.prototype.visit = function(visitor) { | 13560 ListExpression.prototype.visit = function(visitor) { |
| 13527 return visitor.visitListExpression(this); | 13561 return visitor.visitListExpression(this); |
| 13528 } | 13562 } |
| 13529 // ********** Code for MapExpression ************** | 13563 // ********** Code for MapExpression ************** |
| 13530 function MapExpression(isConst, type, items, span) { | 13564 function MapExpression(isConst, type, items, span) { |
| 13531 this.isConst = isConst; | 13565 this.isConst = isConst; |
| 13532 this.type = type; | 13566 this.type = type; |
| 13533 this.items = items; | 13567 this.items = items; |
| 13534 lang_Expression.call(this, span); | 13568 Expression.call(this, span); |
| 13535 // Initializers done | 13569 // Initializers done |
| 13536 } | 13570 } |
| 13537 $inherits(MapExpression, lang_Expression); | 13571 $inherits(MapExpression, Expression); |
| 13538 MapExpression.prototype.get$isConst = function() { return this.isConst; }; | 13572 MapExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 13539 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; | 13573 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; |
| 13540 MapExpression.prototype.visit = function(visitor) { | 13574 MapExpression.prototype.visit = function(visitor) { |
| 13541 return visitor.visitMapExpression(this); | 13575 return visitor.visitMapExpression(this); |
| 13542 } | 13576 } |
| 13543 // ********** Code for ConditionalExpression ************** | 13577 // ********** Code for ConditionalExpression ************** |
| 13544 function ConditionalExpression(test, trueBranch, falseBranch, span) { | 13578 function ConditionalExpression(test, trueBranch, falseBranch, span) { |
| 13545 this.test = test; | 13579 this.test = test; |
| 13546 this.trueBranch = trueBranch; | 13580 this.trueBranch = trueBranch; |
| 13547 this.falseBranch = falseBranch; | 13581 this.falseBranch = falseBranch; |
| 13548 lang_Expression.call(this, span); | 13582 Expression.call(this, span); |
| 13549 // Initializers done | 13583 // Initializers done |
| 13550 } | 13584 } |
| 13551 $inherits(ConditionalExpression, lang_Expression); | 13585 $inherits(ConditionalExpression, Expression); |
| 13552 ConditionalExpression.prototype.visit = function(visitor) { | 13586 ConditionalExpression.prototype.visit = function(visitor) { |
| 13553 return visitor.visitConditionalExpression(this); | 13587 return visitor.visitConditionalExpression(this); |
| 13554 } | 13588 } |
| 13555 // ********** Code for IsExpression ************** | 13589 // ********** Code for IsExpression ************** |
| 13556 function IsExpression(isTrue, x, type, span) { | 13590 function IsExpression(isTrue, x, type, span) { |
| 13557 this.isTrue = isTrue; | 13591 this.isTrue = isTrue; |
| 13558 this.x = x; | 13592 this.x = x; |
| 13559 this.type = type; | 13593 this.type = type; |
| 13560 lang_Expression.call(this, span); | 13594 Expression.call(this, span); |
| 13561 // Initializers done | 13595 // Initializers done |
| 13562 } | 13596 } |
| 13563 $inherits(IsExpression, lang_Expression); | 13597 $inherits(IsExpression, Expression); |
| 13564 IsExpression.prototype.visit = function(visitor) { | 13598 IsExpression.prototype.visit = function(visitor) { |
| 13565 return visitor.visitIsExpression(this); | 13599 return visitor.visitIsExpression(this); |
| 13566 } | 13600 } |
| 13567 // ********** Code for ParenExpression ************** | 13601 // ********** Code for ParenExpression ************** |
| 13568 function ParenExpression(body, span) { | 13602 function ParenExpression(body, span) { |
| 13569 this.body = body; | 13603 this.body = body; |
| 13570 lang_Expression.call(this, span); | 13604 Expression.call(this, span); |
| 13571 // Initializers done | 13605 // Initializers done |
| 13572 } | 13606 } |
| 13573 $inherits(ParenExpression, lang_Expression); | 13607 $inherits(ParenExpression, Expression); |
| 13574 ParenExpression.prototype.visit = function(visitor) { | 13608 ParenExpression.prototype.visit = function(visitor) { |
| 13575 return visitor.visitParenExpression(this); | 13609 return visitor.visitParenExpression(this); |
| 13576 } | 13610 } |
| 13577 // ********** Code for DotExpression ************** | 13611 // ********** Code for DotExpression ************** |
| 13578 function DotExpression(self, name, span) { | 13612 function DotExpression(self, name, span) { |
| 13579 this.self = self; | 13613 this.self = self; |
| 13580 this.name = name; | 13614 this.name = name; |
| 13581 lang_Expression.call(this, span); | 13615 Expression.call(this, span); |
| 13582 // Initializers done | 13616 // Initializers done |
| 13583 } | 13617 } |
| 13584 $inherits(DotExpression, lang_Expression); | 13618 $inherits(DotExpression, Expression); |
| 13585 DotExpression.prototype.get$name = function() { return this.name; }; | 13619 DotExpression.prototype.get$name = function() { return this.name; }; |
| 13586 DotExpression.prototype.set$name = function(value) { return this.name = value; }
; | 13620 DotExpression.prototype.set$name = function(value) { return this.name = value; }
; |
| 13587 DotExpression.prototype.visit = function(visitor) { | 13621 DotExpression.prototype.visit = function(visitor) { |
| 13588 return visitor.visitDotExpression(this); | 13622 return visitor.visitDotExpression(this); |
| 13589 } | 13623 } |
| 13590 // ********** Code for VarExpression ************** | 13624 // ********** Code for VarExpression ************** |
| 13591 function VarExpression(name, span) { | 13625 function VarExpression(name, span) { |
| 13592 this.name = name; | 13626 this.name = name; |
| 13593 lang_Expression.call(this, span); | 13627 Expression.call(this, span); |
| 13594 // Initializers done | 13628 // Initializers done |
| 13595 } | 13629 } |
| 13596 $inherits(VarExpression, lang_Expression); | 13630 $inherits(VarExpression, Expression); |
| 13597 VarExpression.prototype.get$name = function() { return this.name; }; | 13631 VarExpression.prototype.get$name = function() { return this.name; }; |
| 13598 VarExpression.prototype.set$name = function(value) { return this.name = value; }
; | 13632 VarExpression.prototype.set$name = function(value) { return this.name = value; }
; |
| 13599 VarExpression.prototype.visit = function(visitor) { | 13633 VarExpression.prototype.visit = function(visitor) { |
| 13600 return visitor.visitVarExpression(this); | 13634 return visitor.visitVarExpression(this); |
| 13601 } | 13635 } |
| 13602 // ********** Code for ThisExpression ************** | 13636 // ********** Code for ThisExpression ************** |
| 13603 function ThisExpression(span) { | 13637 function ThisExpression(span) { |
| 13604 lang_Expression.call(this, span); | 13638 Expression.call(this, span); |
| 13605 // Initializers done | 13639 // Initializers done |
| 13606 } | 13640 } |
| 13607 $inherits(ThisExpression, lang_Expression); | 13641 $inherits(ThisExpression, Expression); |
| 13608 ThisExpression.prototype.visit = function(visitor) { | 13642 ThisExpression.prototype.visit = function(visitor) { |
| 13609 return visitor.visitThisExpression(this); | 13643 return visitor.visitThisExpression(this); |
| 13610 } | 13644 } |
| 13611 // ********** Code for SuperExpression ************** | 13645 // ********** Code for SuperExpression ************** |
| 13612 function SuperExpression(span) { | 13646 function SuperExpression(span) { |
| 13613 lang_Expression.call(this, span); | 13647 Expression.call(this, span); |
| 13614 // Initializers done | 13648 // Initializers done |
| 13615 } | 13649 } |
| 13616 $inherits(SuperExpression, lang_Expression); | 13650 $inherits(SuperExpression, Expression); |
| 13617 SuperExpression.prototype.visit = function(visitor) { | 13651 SuperExpression.prototype.visit = function(visitor) { |
| 13618 return visitor.visitSuperExpression(this); | 13652 return visitor.visitSuperExpression(this); |
| 13619 } | 13653 } |
| 13620 // ********** Code for NullExpression ************** | 13654 // ********** Code for NullExpression ************** |
| 13621 function NullExpression(span) { | 13655 function NullExpression(span) { |
| 13622 lang_Expression.call(this, span); | 13656 Expression.call(this, span); |
| 13623 // Initializers done | 13657 // Initializers done |
| 13624 } | 13658 } |
| 13625 $inherits(NullExpression, lang_Expression); | 13659 $inherits(NullExpression, Expression); |
| 13626 NullExpression.prototype.visit = function(visitor) { | 13660 NullExpression.prototype.visit = function(visitor) { |
| 13627 return visitor.visitNullExpression(this); | 13661 return visitor.visitNullExpression(this); |
| 13628 } | 13662 } |
| 13629 // ********** Code for LiteralExpression ************** | 13663 // ********** Code for LiteralExpression ************** |
| 13630 function LiteralExpression(value, type, text, span) { | 13664 function LiteralExpression(value, type, text, span) { |
| 13631 this.value = value; | 13665 this.value = value; |
| 13632 this.type = type; | 13666 this.type = type; |
| 13633 this.text = text; | 13667 this.text = text; |
| 13634 lang_Expression.call(this, span); | 13668 Expression.call(this, span); |
| 13635 // Initializers done | 13669 // Initializers done |
| 13636 } | 13670 } |
| 13637 $inherits(LiteralExpression, lang_Expression); | 13671 $inherits(LiteralExpression, Expression); |
| 13638 LiteralExpression.prototype.get$value = function() { return this.value; }; | 13672 LiteralExpression.prototype.get$value = function() { return this.value; }; |
| 13639 LiteralExpression.prototype.set$value = function(value) { return this.value = va
lue; }; | 13673 LiteralExpression.prototype.set$value = function(value) { return this.value = va
lue; }; |
| 13640 LiteralExpression.prototype.get$text = function() { return this.text; }; | 13674 LiteralExpression.prototype.get$text = function() { return this.text; }; |
| 13641 LiteralExpression.prototype.set$text = function(value) { return this.text = valu
e; }; | 13675 LiteralExpression.prototype.set$text = function(value) { return this.text = valu
e; }; |
| 13642 LiteralExpression.prototype.visit = function(visitor) { | 13676 LiteralExpression.prototype.visit = function(visitor) { |
| 13643 return visitor.visitLiteralExpression(this); | 13677 return visitor.visitLiteralExpression(this); |
| 13644 } | 13678 } |
| 13645 // ********** Code for NameTypeReference ************** | 13679 // ********** Code for NameTypeReference ************** |
| 13646 function NameTypeReference(isFinal, name, names, span) { | 13680 function NameTypeReference(isFinal, name, names, span) { |
| 13647 this.isFinal = isFinal; | 13681 this.isFinal = isFinal; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 13676 // Initializers done | 13710 // Initializers done |
| 13677 } | 13711 } |
| 13678 $inherits(FunctionTypeReference, TypeReference); | 13712 $inherits(FunctionTypeReference, TypeReference); |
| 13679 FunctionTypeReference.prototype.visit = function(visitor) { | 13713 FunctionTypeReference.prototype.visit = function(visitor) { |
| 13680 return visitor.visitFunctionTypeReference(this); | 13714 return visitor.visitFunctionTypeReference(this); |
| 13681 } | 13715 } |
| 13682 // ********** Code for ArgumentNode ************** | 13716 // ********** Code for ArgumentNode ************** |
| 13683 function ArgumentNode(label, value, span) { | 13717 function ArgumentNode(label, value, span) { |
| 13684 this.label = label; | 13718 this.label = label; |
| 13685 this.value = value; | 13719 this.value = value; |
| 13686 lang_Node.call(this, span); | 13720 Node.call(this, span); |
| 13687 // Initializers done | 13721 // Initializers done |
| 13688 } | 13722 } |
| 13689 $inherits(ArgumentNode, lang_Node); | 13723 $inherits(ArgumentNode, Node); |
| 13690 ArgumentNode.prototype.get$value = function() { return this.value; }; | 13724 ArgumentNode.prototype.get$value = function() { return this.value; }; |
| 13691 ArgumentNode.prototype.set$value = function(value) { return this.value = value;
}; | 13725 ArgumentNode.prototype.set$value = function(value) { return this.value = value;
}; |
| 13692 ArgumentNode.prototype.visit = function(visitor) { | 13726 ArgumentNode.prototype.visit = function(visitor) { |
| 13693 return visitor.visitArgumentNode(this); | 13727 return visitor.visitArgumentNode(this); |
| 13694 } | 13728 } |
| 13695 // ********** Code for FormalNode ************** | 13729 // ********** Code for FormalNode ************** |
| 13696 function FormalNode(isThis, isRest, type, name, value, span) { | 13730 function FormalNode(isThis, isRest, type, name, value, span) { |
| 13697 this.isThis = isThis; | 13731 this.isThis = isThis; |
| 13698 this.isRest = isRest; | 13732 this.isRest = isRest; |
| 13699 this.type = type; | 13733 this.type = type; |
| 13700 this.name = name; | 13734 this.name = name; |
| 13701 this.value = value; | 13735 this.value = value; |
| 13702 lang_Node.call(this, span); | 13736 Node.call(this, span); |
| 13703 // Initializers done | 13737 // Initializers done |
| 13704 } | 13738 } |
| 13705 $inherits(FormalNode, lang_Node); | 13739 $inherits(FormalNode, Node); |
| 13706 FormalNode.prototype.get$name = function() { return this.name; }; | 13740 FormalNode.prototype.get$name = function() { return this.name; }; |
| 13707 FormalNode.prototype.set$name = function(value) { return this.name = value; }; | 13741 FormalNode.prototype.set$name = function(value) { return this.name = value; }; |
| 13708 FormalNode.prototype.get$value = function() { return this.value; }; | 13742 FormalNode.prototype.get$value = function() { return this.value; }; |
| 13709 FormalNode.prototype.set$value = function(value) { return this.value = value; }; | 13743 FormalNode.prototype.set$value = function(value) { return this.value = value; }; |
| 13710 FormalNode.prototype.visit = function(visitor) { | 13744 FormalNode.prototype.visit = function(visitor) { |
| 13711 return visitor.visitFormalNode(this); | 13745 return visitor.visitFormalNode(this); |
| 13712 } | 13746 } |
| 13713 // ********** Code for CatchNode ************** | 13747 // ********** Code for CatchNode ************** |
| 13714 function CatchNode(exception, trace, body, span) { | 13748 function CatchNode(exception, trace, body, span) { |
| 13715 this.exception = exception; | 13749 this.exception = exception; |
| 13716 this.trace = trace; | 13750 this.trace = trace; |
| 13717 this.body = body; | 13751 this.body = body; |
| 13718 lang_Node.call(this, span); | 13752 Node.call(this, span); |
| 13719 // Initializers done | 13753 // Initializers done |
| 13720 } | 13754 } |
| 13721 $inherits(CatchNode, lang_Node); | 13755 $inherits(CatchNode, Node); |
| 13722 CatchNode.prototype.visit = function(visitor) { | 13756 CatchNode.prototype.visit = function(visitor) { |
| 13723 return visitor.visitCatchNode(this); | 13757 return visitor.visitCatchNode(this); |
| 13724 } | 13758 } |
| 13725 // ********** Code for CaseNode ************** | 13759 // ********** Code for CaseNode ************** |
| 13726 function CaseNode(label, cases, statements, span) { | 13760 function CaseNode(label, cases, statements, span) { |
| 13727 this.label = label; | 13761 this.label = label; |
| 13728 this.cases = cases; | 13762 this.cases = cases; |
| 13729 this.statements = statements; | 13763 this.statements = statements; |
| 13730 lang_Node.call(this, span); | 13764 Node.call(this, span); |
| 13731 // Initializers done | 13765 // Initializers done |
| 13732 } | 13766 } |
| 13733 $inherits(CaseNode, lang_Node); | 13767 $inherits(CaseNode, Node); |
| 13734 CaseNode.prototype.visit = function(visitor) { | 13768 CaseNode.prototype.visit = function(visitor) { |
| 13735 return visitor.visitCaseNode(this); | 13769 return visitor.visitCaseNode(this); |
| 13736 } | 13770 } |
| 13737 // ********** Code for TypeParameter ************** | 13771 // ********** Code for TypeParameter ************** |
| 13738 function TypeParameter(name, extendsType, span) { | 13772 function TypeParameter(name, extendsType, span) { |
| 13739 this.name = name; | 13773 this.name = name; |
| 13740 this.extendsType = extendsType; | 13774 this.extendsType = extendsType; |
| 13741 lang_Node.call(this, span); | 13775 Node.call(this, span); |
| 13742 // Initializers done | 13776 // Initializers done |
| 13743 } | 13777 } |
| 13744 $inherits(TypeParameter, lang_Node); | 13778 $inherits(TypeParameter, Node); |
| 13745 TypeParameter.prototype.get$name = function() { return this.name; }; | 13779 TypeParameter.prototype.get$name = function() { return this.name; }; |
| 13746 TypeParameter.prototype.set$name = function(value) { return this.name = value; }
; | 13780 TypeParameter.prototype.set$name = function(value) { return this.name = value; }
; |
| 13747 TypeParameter.prototype.visit = function(visitor) { | 13781 TypeParameter.prototype.visit = function(visitor) { |
| 13748 return visitor.visitTypeParameter(this); | 13782 return visitor.visitTypeParameter(this); |
| 13749 } | 13783 } |
| 13750 // ********** Code for lang_Identifier ************** | 13784 // ********** Code for Identifier ************** |
| 13751 function lang_Identifier(name, span) { | 13785 function Identifier(name, span) { |
| 13752 this.name = name; | 13786 this.name = name; |
| 13753 lang_Node.call(this, span); | 13787 Node.call(this, span); |
| 13754 // Initializers done | 13788 // Initializers done |
| 13755 } | 13789 } |
| 13756 $inherits(lang_Identifier, lang_Node); | 13790 $inherits(Identifier, Node); |
| 13757 lang_Identifier.prototype.get$name = function() { return this.name; }; | 13791 Identifier.prototype.get$name = function() { return this.name; }; |
| 13758 lang_Identifier.prototype.set$name = function(value) { return this.name = value;
}; | 13792 Identifier.prototype.set$name = function(value) { return this.name = value; }; |
| 13759 lang_Identifier.prototype.visit = function(visitor) { | 13793 Identifier.prototype.visit = function(visitor) { |
| 13760 return visitor.visitIdentifier(this); | 13794 return visitor.visitIdentifier(this); |
| 13761 } | 13795 } |
| 13762 // ********** Code for DeclaredIdentifier ************** | 13796 // ********** Code for DeclaredIdentifier ************** |
| 13763 function DeclaredIdentifier(type, name, span) { | 13797 function DeclaredIdentifier(type, name, span) { |
| 13764 this.type = type; | 13798 this.type = type; |
| 13765 this.name = name; | 13799 this.name = name; |
| 13766 lang_Expression.call(this, span); | 13800 Expression.call(this, span); |
| 13767 // Initializers done | 13801 // Initializers done |
| 13768 } | 13802 } |
| 13769 $inherits(DeclaredIdentifier, lang_Expression); | 13803 $inherits(DeclaredIdentifier, Expression); |
| 13770 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; | 13804 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; |
| 13771 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val
ue; }; | 13805 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val
ue; }; |
| 13772 DeclaredIdentifier.prototype.visit = function(visitor) { | 13806 DeclaredIdentifier.prototype.visit = function(visitor) { |
| 13773 return visitor.visitDeclaredIdentifier(this); | 13807 return visitor.visitDeclaredIdentifier(this); |
| 13774 } | 13808 } |
| 13775 // ********** Code for TreePrinter ************** | 13809 // ********** Code for TreePrinter ************** |
| 13776 function TreePrinter() {} | 13810 function TreePrinter() {} |
| 13777 TreePrinter.prototype.visitDirectiveDefinition = function(node) { | 13811 TreePrinter.prototype.visitDirectiveDefinition = function(node) { |
| 13778 this.output.heading('DirectiveDefinition', node.span); | 13812 this.output.heading('DirectiveDefinition', node.span); |
| 13779 this.output.writeNode('name', node.name); | 13813 this.output.writeNode('name', node.name); |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14031 } | 14065 } |
| 14032 TreePrinter.prototype.visitDeclaredIdentifier = function(node) { | 14066 TreePrinter.prototype.visitDeclaredIdentifier = function(node) { |
| 14033 this.output.heading('DeclaredIdentifier', node.span); | 14067 this.output.heading('DeclaredIdentifier', node.span); |
| 14034 this.output.writeNode('type', node.type); | 14068 this.output.writeNode('type', node.type); |
| 14035 this.output.writeNode('name', node.name); | 14069 this.output.writeNode('name', node.name); |
| 14036 } | 14070 } |
| 14037 TreePrinter.prototype.visitTypeReference = function(node) { | 14071 TreePrinter.prototype.visitTypeReference = function(node) { |
| 14038 this.output.heading('TypeReference(' + this.output.toValue(node.type) + ")", n
ode.span); | 14072 this.output.heading('TypeReference(' + this.output.toValue(node.type) + ")", n
ode.span); |
| 14039 } | 14073 } |
| 14040 $defineMethod(TreePrinter, "visitPostfixExpression$1", TreePrinter.prototype.vis
itPostfixExpression); | 14074 $defineMethod(TreePrinter, "visitPostfixExpression$1", TreePrinter.prototype.vis
itPostfixExpression); |
| 14041 // ********** Code for lang_Type ************** | 14075 // ********** Code for Type ************** |
| 14042 function lang_Type(name) { | 14076 function Type(name) { |
| 14043 this.name = name; | 14077 this.name = name; |
| 14044 this.isTested = false; | 14078 this.isTested = false; |
| 14045 // Initializers done | 14079 // Initializers done |
| 14046 } | 14080 } |
| 14047 lang_Type.prototype.get$name = function() { return this.name; }; | 14081 Type.prototype.get$name = function() { return this.name; }; |
| 14048 lang_Type.prototype.markUsed = function() { | 14082 Type.prototype.markUsed = function() { |
| 14049 | 14083 |
| 14050 } | 14084 } |
| 14051 lang_Type.prototype.get$typeMember = function() { | 14085 Type.prototype.get$typeMember = function() { |
| 14052 if (this._typeMember == null) { | 14086 if (this._typeMember == null) { |
| 14053 this._typeMember = new TypeMember(this); | 14087 this._typeMember = new TypeMember(this); |
| 14054 } | 14088 } |
| 14055 return this._typeMember; | 14089 return this._typeMember; |
| 14056 } | 14090 } |
| 14057 lang_Type.prototype.getMember = function(name) { | 14091 Type.prototype.getMember = function(name) { |
| 14058 return null; | 14092 return null; |
| 14059 } | 14093 } |
| 14060 lang_Type.prototype.get$isVar = function() { | 14094 Type.prototype.get$isVar = function() { |
| 14061 return false; | 14095 return false; |
| 14062 } | 14096 } |
| 14063 lang_Type.prototype.get$isTop = function() { | 14097 Type.prototype.get$isTop = function() { |
| 14064 return false; | 14098 return false; |
| 14065 } | 14099 } |
| 14066 lang_Type.prototype.get$isObject = function() { | 14100 Type.prototype.get$isObject = function() { |
| 14067 return false; | 14101 return false; |
| 14068 } | 14102 } |
| 14069 lang_Type.prototype.get$isString = function() { | 14103 Type.prototype.get$isString = function() { |
| 14070 return false; | 14104 return false; |
| 14071 } | 14105 } |
| 14072 lang_Type.prototype.get$isBool = function() { | 14106 Type.prototype.get$isBool = function() { |
| 14073 return false; | 14107 return false; |
| 14074 } | 14108 } |
| 14075 lang_Type.prototype.get$isFunction = function() { | 14109 Type.prototype.get$isFunction = function() { |
| 14076 return false; | 14110 return false; |
| 14077 } | 14111 } |
| 14078 lang_Type.prototype.get$isList = function() { | 14112 Type.prototype.get$isList = function() { |
| 14079 return false; | 14113 return false; |
| 14080 } | 14114 } |
| 14081 lang_Type.prototype.get$isNum = function() { | 14115 Type.prototype.get$isNum = function() { |
| 14082 return false; | 14116 return false; |
| 14083 } | 14117 } |
| 14084 lang_Type.prototype.get$isVarOrFunction = function() { | 14118 Type.prototype.get$isVarOrFunction = function() { |
| 14085 return this.get$isVar() || this.get$isFunction(); | 14119 return this.get$isVar() || this.get$isFunction(); |
| 14086 } | 14120 } |
| 14087 lang_Type.prototype.getCallMethod = function() { | 14121 Type.prototype.getCallMethod = function() { |
| 14088 return null; | 14122 return null; |
| 14089 } | 14123 } |
| 14090 lang_Type.prototype.get$isClosed = function() { | 14124 Type.prototype.get$isClosed = function() { |
| 14091 return this.get$isString() || this.get$isBool() || this.get$isNum() || this.ge
t$isFunction(); | 14125 return this.get$isString() || this.get$isBool() || this.get$isNum() || this.ge
t$isFunction(); |
| 14092 } | 14126 } |
| 14093 lang_Type.prototype.get$isUsed = function() { | 14127 Type.prototype.get$isUsed = function() { |
| 14094 return false; | 14128 return false; |
| 14095 } | 14129 } |
| 14096 lang_Type.prototype.get$isGeneric = function() { | 14130 Type.prototype.get$isGeneric = function() { |
| 14097 return false; | 14131 return false; |
| 14098 } | 14132 } |
| 14099 lang_Type.prototype.get$isNativeType = function() { | 14133 Type.prototype.get$isNativeType = function() { |
| 14100 return false; | 14134 return false; |
| 14101 } | 14135 } |
| 14102 lang_Type.prototype.get$isNative = function() { | 14136 Type.prototype.get$isNative = function() { |
| 14103 return this.get$isNativeType(); | 14137 return this.get$isNativeType(); |
| 14104 } | 14138 } |
| 14105 lang_Type.prototype.get$hasTypeParams = function() { | 14139 Type.prototype.get$hasTypeParams = function() { |
| 14106 return false; | 14140 return false; |
| 14107 } | 14141 } |
| 14108 lang_Type.prototype.get$typeofName = function() { | 14142 Type.prototype.get$typeofName = function() { |
| 14109 return null; | 14143 return null; |
| 14110 } | 14144 } |
| 14111 lang_Type.prototype.get$jsname = function() { | 14145 Type.prototype.get$jsname = function() { |
| 14112 return this._jsname == null ? this.name : this._jsname; | 14146 return this._jsname == null ? this.name : this._jsname; |
| 14113 } | 14147 } |
| 14114 lang_Type.prototype.set$jsname = function(name) { | 14148 Type.prototype.set$jsname = function(name) { |
| 14115 return this._jsname = name; | 14149 return this._jsname = name; |
| 14116 } | 14150 } |
| 14117 lang_Type.prototype.getAllMembers = function() { | 14151 Type.prototype.getAllMembers = function() { |
| 14118 return $map([]); | 14152 return $map([]); |
| 14119 } | 14153 } |
| 14120 lang_Type.prototype.needsVarCall = function(args) { | 14154 Type.prototype.needsVarCall = function(args) { |
| 14121 if (this.get$isVarOrFunction()) { | 14155 if (this.get$isVarOrFunction()) { |
| 14122 return true; | 14156 return true; |
| 14123 } | 14157 } |
| 14124 var call = this.getCallMethod(); | 14158 var call = this.getCallMethod(); |
| 14125 if ($ne(call, null)) { | 14159 if ($ne(call, null)) { |
| 14126 if (args.get$length() != call.get$parameters().length || !call.namesInOrder(
args)) { | 14160 if (args.get$length() != call.get$parameters().length || !call.namesInOrder(
args)) { |
| 14127 return true; | 14161 return true; |
| 14128 } | 14162 } |
| 14129 } | 14163 } |
| 14130 return false; | 14164 return false; |
| 14131 } | 14165 } |
| 14132 lang_Type.union = function(x, y) { | 14166 Type.union = function(x, y) { |
| 14133 if ($eq(x, y)) return x; | 14167 if ($eq(x, y)) return x; |
| 14134 if (x.get$isNum() && y.get$isNum()) return world.numType; | 14168 if (x.get$isNum() && y.get$isNum()) return world.numType; |
| 14135 if (x.get$isString() && y.get$isString()) return world.stringType; | 14169 if (x.get$isString() && y.get$isString()) return world.stringType; |
| 14136 return world.varType; | 14170 return world.varType; |
| 14137 } | 14171 } |
| 14138 // ********** Code for ParameterType ************** | 14172 // ********** Code for ParameterType ************** |
| 14139 function ParameterType(name, typeParameter) { | 14173 function ParameterType(name, typeParameter) { |
| 14140 this.typeParameter = typeParameter; | 14174 this.typeParameter = typeParameter; |
| 14141 lang_Type.call(this, name); | 14175 Type.call(this, name); |
| 14142 // Initializers done | 14176 // Initializers done |
| 14143 } | 14177 } |
| 14144 $inherits(ParameterType, lang_Type); | 14178 $inherits(ParameterType, Type); |
| 14145 ParameterType.prototype.get$isClass = function() { | 14179 ParameterType.prototype.get$isClass = function() { |
| 14146 return false; | 14180 return false; |
| 14147 } | 14181 } |
| 14148 ParameterType.prototype.get$library = function() { | 14182 ParameterType.prototype.get$library = function() { |
| 14149 return null; | 14183 return null; |
| 14150 } | 14184 } |
| 14151 ParameterType.prototype.get$span = function() { | 14185 ParameterType.prototype.get$span = function() { |
| 14152 return this.typeParameter.span; | 14186 return this.typeParameter.span; |
| 14153 } | 14187 } |
| 14154 ParameterType.prototype.getCallMethod = function() { | 14188 ParameterType.prototype.getCallMethod = function() { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 14178 } | 14212 } |
| 14179 } | 14213 } |
| 14180 // ********** Code for ConcreteType ************** | 14214 // ********** Code for ConcreteType ************** |
| 14181 function ConcreteType(name, genericType, typeArguments, typeArgsInOrder) { | 14215 function ConcreteType(name, genericType, typeArguments, typeArgsInOrder) { |
| 14182 this.genericType = genericType; | 14216 this.genericType = genericType; |
| 14183 this.typeArguments = typeArguments; | 14217 this.typeArguments = typeArguments; |
| 14184 this.typeArgsInOrder = typeArgsInOrder; | 14218 this.typeArgsInOrder = typeArgsInOrder; |
| 14185 this.constructors = $map([]); | 14219 this.constructors = $map([]); |
| 14186 this.members = $map([]); | 14220 this.members = $map([]); |
| 14187 this.factories = new FactoryMap(); | 14221 this.factories = new FactoryMap(); |
| 14188 lang_Type.call(this, name); | 14222 Type.call(this, name); |
| 14189 // Initializers done | 14223 // Initializers done |
| 14190 } | 14224 } |
| 14191 $inherits(ConcreteType, lang_Type); | 14225 $inherits(ConcreteType, Type); |
| 14192 ConcreteType.prototype.get$isList = function() { | 14226 ConcreteType.prototype.get$isList = function() { |
| 14193 return this.genericType.get$isList(); | 14227 return this.genericType.get$isList(); |
| 14194 } | 14228 } |
| 14195 ConcreteType.prototype.get$isClass = function() { | 14229 ConcreteType.prototype.get$isClass = function() { |
| 14196 return this.genericType.get$isClass(); | 14230 return this.genericType.get$isClass(); |
| 14197 } | 14231 } |
| 14198 ConcreteType.prototype.get$library = function() { | 14232 ConcreteType.prototype.get$library = function() { |
| 14199 return this.genericType.get$library(); | 14233 return this.genericType.get$library(); |
| 14200 } | 14234 } |
| 14201 ConcreteType.prototype.get$span = function() { | 14235 ConcreteType.prototype.get$span = function() { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14335 function DefinedType(name, library, definition, isClass) { | 14369 function DefinedType(name, library, definition, isClass) { |
| 14336 this.isUsed = false | 14370 this.isUsed = false |
| 14337 this.isNativeType = false | 14371 this.isNativeType = false |
| 14338 this.library = library; | 14372 this.library = library; |
| 14339 this.isClass = isClass; | 14373 this.isClass = isClass; |
| 14340 this.directSubtypes = []; | 14374 this.directSubtypes = []; |
| 14341 this.constructors = $map([]); | 14375 this.constructors = $map([]); |
| 14342 this.members = $map([]); | 14376 this.members = $map([]); |
| 14343 this.factories = new FactoryMap(); | 14377 this.factories = new FactoryMap(); |
| 14344 this._resolvedMembers = $map([]); | 14378 this._resolvedMembers = $map([]); |
| 14345 lang_Type.call(this, name); | 14379 Type.call(this, name); |
| 14346 // Initializers done | 14380 // Initializers done |
| 14347 this.setDefinition(definition); | 14381 this.setDefinition(definition); |
| 14348 } | 14382 } |
| 14349 $inherits(DefinedType, lang_Type); | 14383 $inherits(DefinedType, Type); |
| 14350 DefinedType.prototype.get$definition = function() { return this.definition; }; | 14384 DefinedType.prototype.get$definition = function() { return this.definition; }; |
| 14351 DefinedType.prototype.set$definition = function(value) { return this.definition
= value; }; | 14385 DefinedType.prototype.set$definition = function(value) { return this.definition
= value; }; |
| 14352 DefinedType.prototype.get$library = function() { return this.library; }; | 14386 DefinedType.prototype.get$library = function() { return this.library; }; |
| 14353 DefinedType.prototype.get$isClass = function() { return this.isClass; }; | 14387 DefinedType.prototype.get$isClass = function() { return this.isClass; }; |
| 14354 DefinedType.prototype.get$parent = function() { return this.parent; }; | 14388 DefinedType.prototype.get$parent = function() { return this.parent; }; |
| 14355 DefinedType.prototype.set$parent = function(value) { return this.parent = value;
}; | 14389 DefinedType.prototype.set$parent = function(value) { return this.parent = value;
}; |
| 14356 DefinedType.prototype.get$interfaces = function() { return this.interfaces; }; | 14390 DefinedType.prototype.get$interfaces = function() { return this.interfaces; }; |
| 14357 DefinedType.prototype.set$interfaces = function(value) { return this.interfaces
= value; }; | 14391 DefinedType.prototype.set$interfaces = function(value) { return this.interfaces
= value; }; |
| 14358 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete
rs; }; | 14392 DefinedType.prototype.get$typeParameters = function() { return this.typeParamete
rs; }; |
| 14359 DefinedType.prototype.set$typeParameters = function(value) { return this.typePar
ameters = value; }; | 14393 DefinedType.prototype.set$typeParameters = function(value) { return this.typePar
ameters = value; }; |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15020 return this.exp.get$dynamic().get$actualValue(); | 15054 return this.exp.get$dynamic().get$actualValue(); |
| 15021 } | 15055 } |
| 15022 GlobalValue.prototype.compareTo = function(other) { | 15056 GlobalValue.prototype.compareTo = function(other) { |
| 15023 if ($eq(other, this)) { | 15057 if ($eq(other, this)) { |
| 15024 return 0; | 15058 return 0; |
| 15025 } | 15059 } |
| 15026 else if (this.dependencies.indexOf(other, 0) >= 0) { | 15060 else if (this.dependencies.indexOf(other, 0) >= 0) { |
| 15027 return 1; | 15061 return 1; |
| 15028 } | 15062 } |
| 15029 else if (other.dependencies.indexOf(this, 0) >= 0) { | 15063 else if (other.dependencies.indexOf(this, 0) >= 0) { |
| 15030 return -1; | 15064 return -1.000000/*-1*/; |
| 15031 } | 15065 } |
| 15032 else if (this.dependencies.length > other.dependencies.length) { | 15066 else if (this.dependencies.length > other.dependencies.length) { |
| 15033 return 1; | 15067 return 1; |
| 15034 } | 15068 } |
| 15035 else if (this.dependencies.length < other.dependencies.length) { | 15069 else if (this.dependencies.length < other.dependencies.length) { |
| 15036 return -1; | 15070 return -1.000000/*-1*/; |
| 15037 } | 15071 } |
| 15038 else if (this.name == null && other.name != null) { | 15072 else if (this.name == null && other.name != null) { |
| 15039 return 1; | 15073 return 1; |
| 15040 } | 15074 } |
| 15041 else if (this.name != null && other.name == null) { | 15075 else if (this.name != null && other.name == null) { |
| 15042 return -1; | 15076 return -1.000000/*-1*/; |
| 15043 } | 15077 } |
| 15044 else if (this.name != null) { | 15078 else if (this.name != null) { |
| 15045 return this.name.compareTo(other.name); | 15079 return this.name.compareTo(other.name); |
| 15046 } | 15080 } |
| 15047 else { | 15081 else { |
| 15048 return this.field.name.compareTo(other.field.name); | 15082 return this.field.name.compareTo(other.field.name); |
| 15049 } | 15083 } |
| 15050 } | 15084 } |
| 15051 // ********** Code for CompilerException ************** | 15085 // ********** Code for CompilerException ************** |
| 15052 function CompilerException(_message, _location) { | 15086 function CompilerException(_message, _location) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15200 throw exc; | 15234 throw exc; |
| 15201 } | 15235 } |
| 15202 } | 15236 } |
| 15203 this.printStatus(); | 15237 this.printStatus(); |
| 15204 return !this.get$hasErrors(); | 15238 return !this.get$hasErrors(); |
| 15205 } | 15239 } |
| 15206 World.prototype.runLeg = function() { | 15240 World.prototype.runLeg = function() { |
| 15207 var $this = this; // closure support | 15241 var $this = this; // closure support |
| 15208 if (!options.enableLeg) return false; | 15242 if (!options.enableLeg) return false; |
| 15209 return this.withTiming('try leg compile', (function () { | 15243 return this.withTiming('try leg compile', (function () { |
| 15210 return compile($this); | 15244 return leg_compile($this); |
| 15211 }) | 15245 }) |
| 15212 ); | 15246 ); |
| 15213 } | 15247 } |
| 15214 World.prototype.runCompilationPhases = function() { | 15248 World.prototype.runCompilationPhases = function() { |
| 15215 var $this = this; // closure support | 15249 var $this = this; // closure support |
| 15216 var lib = this.withTiming('first pass', (function () { | 15250 var lib = this.withTiming('first pass', (function () { |
| 15217 return $this.processScript(options.dartScript); | 15251 return $this.processScript(options.dartScript); |
| 15218 }) | 15252 }) |
| 15219 ); | 15253 ); |
| 15220 this.withTiming('resolve top level', (function () { | 15254 this.withTiming('resolve top level', (function () { |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15698 } | 15732 } |
| 15699 else { | 15733 else { |
| 15700 return text; | 15734 return text; |
| 15701 } | 15735 } |
| 15702 } | 15736 } |
| 15703 var world; | 15737 var world; |
| 15704 function initializeWorld(files) { | 15738 function initializeWorld(files) { |
| 15705 world = new World(files); | 15739 world = new World(files); |
| 15706 world.init(); | 15740 world.init(); |
| 15707 } | 15741 } |
| 15708 function lang_compile(homedir, args, files) { | 15742 function compile(homedir, args, files) { |
| 15709 parseOptions(homedir, args); | 15743 parseOptions(homedir, args); |
| 15710 initializeWorld(files); | 15744 initializeWorld(files); |
| 15711 var success = world.compile(); | 15745 var success = world.compile(); |
| 15712 if (options.outfile != null) { | 15746 if (options.outfile != null) { |
| 15713 if (success) { | 15747 if (success) { |
| 15714 var code = world.getGeneratedCode(); | 15748 var code = world.getGeneratedCode(); |
| 15715 if (!options.outfile.endsWith('.js')) { | 15749 if (!options.outfile.endsWith('.js')) { |
| 15716 code = '#!/usr/bin/env node\n' + code; | 15750 code = '#!/usr/bin/env node\n' + code; |
| 15717 } | 15751 } |
| 15718 world.files.writeString(options.outfile, code); | 15752 world.files.writeString(options.outfile, code); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 15732 for (var i = args.get$bareCount(); | 15766 for (var i = args.get$bareCount(); |
| 15733 i < args.get$length(); i++) { | 15767 i < args.get$length(); i++) { |
| 15734 nameBuilder.add('\$').add(args.getName(i)); | 15768 nameBuilder.add('\$').add(args.getName(i)); |
| 15735 } | 15769 } |
| 15736 return nameBuilder.toString(); | 15770 return nameBuilder.toString(); |
| 15737 } | 15771 } |
| 15738 // ********** Library frog ************** | 15772 // ********** Library frog ************** |
| 15739 // ********** Code for top level ************** | 15773 // ********** Code for top level ************** |
| 15740 function main() { | 15774 function main() { |
| 15741 var homedir = get$path().dirname(get$fs().realpathSync(process.argv.$index(1))
); | 15775 var homedir = get$path().dirname(get$fs().realpathSync(process.argv.$index(1))
); |
| 15742 if (lang_compile(homedir, process.argv, new NodeFileSystem())) { | 15776 if (compile(homedir, process.argv, new NodeFileSystem())) { |
| 15743 var code = world.getGeneratedCode(); | 15777 var code = world.getGeneratedCode(); |
| 15744 if (!options.compileOnly) { | 15778 if (!options.compileOnly) { |
| 15745 process.argv = [process.argv.$index(0), process.argv.$index(1)]; | 15779 process.argv = [process.argv.$index(0), process.argv.$index(1)]; |
| 15746 process.argv.addAll(options.childArgs); | 15780 process.argv.addAll(options.childArgs); |
| 15747 runCodeWithContext(code); | 15781 runCodeWithContext(code); |
| 15748 } | 15782 } |
| 15749 } | 15783 } |
| 15750 else { | 15784 else { |
| 15751 process.exit(1); | 15785 process.exit(1); |
| 15752 } | 15786 } |
| 15753 } | 15787 } |
| 15754 $defineMethod(Function, "to$call$1", function() { | 15788 $defineMethod(Function, "to$call$1", function() { |
| 15755 this.call$1 = this.$genStub(1); | 15789 this.call$1 = this.$genStub(1); |
| 15756 this.to$call$1 = function() { return this.call$1; }; | 15790 this.to$call$1 = function() { return this.call$1; }; |
| 15757 return this.call$1; | 15791 return this.call$1; |
| 15758 }); | 15792 }); |
| 15759 $defineMethod(Function, "call$1", function(item) { | 15793 $defineMethod(Function, "call$1", function(item) { |
| 15760 return this.to$call$1()(item); | 15794 return this.to$call$1()(item); |
| 15761 }); | 15795 }); |
| 15762 function to$call$1(f) { return f && f.to$call$1(); } | 15796 function to$call$1(f) { return f && f.to$call$1(); } |
| 15763 $defineMethod(Function, "to$call$2", function() { | 15797 $defineMethod(Function, "to$call$2", function() { |
| 15764 this.call$2 = this.$genStub(2); | 15798 this.call$2 = this.$genStub(2); |
| 15765 this.to$call$2 = function() { return this.call$2; }; | 15799 this.to$call$2 = function() { return this.call$2; }; |
| 15766 return this.call$2; | 15800 return this.call$2; |
| 15767 }); | 15801 }); |
| 15768 $defineMethod(Function, "call$2", function(current, count) { | 15802 $defineMethod(Function, "call$2", function(current, count) { |
| 15769 return this.to$call$2()(current, count); | 15803 return this.to$call$2()(current, count); |
| 15770 }); | 15804 }); |
| 15771 function to$call$2(f) { return f && f.to$call$2(); } | 15805 function to$call$2(f) { return f && f.to$call$2(); } |
| 15772 var const$10 = new EmptyQueueException()/*const EmptyQueueException()*/; | 15806 var const$120 = []/*const <HInstruction>[]*/; |
| 15807 var const$121 = new NoMoreElementsException()/*const NoMoreElementsException()*/
; |
| 15808 var const$122 = new EmptyQueueException()/*const EmptyQueueException()*/; |
| 15773 var const$129 = new StringWrapper('main')/*const SourceString('main')*/; | 15809 var const$129 = new StringWrapper('main')/*const SourceString('main')*/; |
| 15774 var const$133 = new StringWrapper('void')/*const SourceString('void')*/; | 15810 var const$228 = new Keyword("break", false)/*const Keyword("break")*/; |
| 15775 var const$135 = new StringWrapper('int')/*const SourceString('int')*/; | 15811 var const$230 = new Keyword("case", false)/*const Keyword("case")*/; |
| 15776 var const$137 = new StringWrapper('Dynamic')/*const SourceString('Dynamic')*/; | 15812 var const$232 = new Keyword("catch", false)/*const Keyword("catch")*/; |
| 15777 var const$139 = new StringWrapper('print')/*const SourceString('print')*/; | 15813 var const$234 = new Keyword("const", false)/*const Keyword("const")*/; |
| 15778 var const$140 = new StringWrapper('+')/*const SourceString('+')*/; | 15814 var const$236 = new Keyword("continue", false)/*const Keyword("continue")*/; |
| 15779 var const$238 = new Keyword("break", false)/*const Keyword("break")*/; | 15815 var const$238 = new Keyword("default", false)/*const Keyword("default")*/; |
| 15780 var const$240 = new Keyword("case", false)/*const Keyword("case")*/; | 15816 var const$240 = new Keyword("do", false)/*const Keyword("do")*/; |
| 15781 var const$242 = new Keyword("catch", false)/*const Keyword("catch")*/; | 15817 var const$242 = new Keyword("else", false)/*const Keyword("else")*/; |
| 15782 var const$244 = new Keyword("const", false)/*const Keyword("const")*/; | 15818 var const$244 = new Keyword("false", false)/*const Keyword("false")*/; |
| 15783 var const$246 = new Keyword("continue", false)/*const Keyword("continue")*/; | 15819 var const$246 = new Keyword("final", false)/*const Keyword("final")*/; |
| 15784 var const$248 = new Keyword("default", false)/*const Keyword("default")*/; | 15820 var const$248 = new Keyword("finally", false)/*const Keyword("finally")*/; |
| 15785 var const$250 = new Keyword("do", false)/*const Keyword("do")*/; | 15821 var const$250 = new Keyword("for", false)/*const Keyword("for")*/; |
| 15786 var const$252 = new Keyword("else", false)/*const Keyword("else")*/; | 15822 var const$252 = new Keyword("if", false)/*const Keyword("if")*/; |
| 15787 var const$254 = new Keyword("false", false)/*const Keyword("false")*/; | 15823 var const$254 = new Keyword("in", false)/*const Keyword("in")*/; |
| 15788 var const$256 = new Keyword("final", false)/*const Keyword("final")*/; | 15824 var const$256 = new Keyword("is", false)/*const Keyword("is")*/; |
| 15789 var const$258 = new Keyword("finally", false)/*const Keyword("finally")*/; | 15825 var const$258 = new Keyword("new", false)/*const Keyword("new")*/; |
| 15790 var const$260 = new Keyword("for", false)/*const Keyword("for")*/; | 15826 var const$260 = new Keyword("null", false)/*const Keyword("null")*/; |
| 15791 var const$262 = new Keyword("if", false)/*const Keyword("if")*/; | 15827 var const$262 = new Keyword("return", false)/*const Keyword("return")*/; |
| 15792 var const$264 = new Keyword("in", false)/*const Keyword("in")*/; | 15828 var const$264 = new Keyword("super", false)/*const Keyword("super")*/; |
| 15793 var const$266 = new Keyword("is", false)/*const Keyword("is")*/; | 15829 var const$266 = new Keyword("switch", false)/*const Keyword("switch")*/; |
| 15794 var const$268 = new Keyword("new", false)/*const Keyword("new")*/; | 15830 var const$268 = new Keyword("this", false)/*const Keyword("this")*/; |
| 15795 var const$270 = new Keyword("null", false)/*const Keyword("null")*/; | 15831 var const$270 = new Keyword("throw", false)/*const Keyword("throw")*/; |
| 15796 var const$272 = new Keyword("return", false)/*const Keyword("return")*/; | 15832 var const$272 = new Keyword("true", false)/*const Keyword("true")*/; |
| 15797 var const$274 = new Keyword("super", false)/*const Keyword("super")*/; | 15833 var const$274 = new Keyword("try", false)/*const Keyword("try")*/; |
| 15798 var const$276 = new Keyword("switch", false)/*const Keyword("switch")*/; | 15834 var const$276 = new Keyword("var", false)/*const Keyword("var")*/; |
| 15799 var const$278 = new Keyword("this", false)/*const Keyword("this")*/; | 15835 var const$278 = new Keyword("void", false)/*const Keyword("void")*/; |
| 15800 var const$280 = new Keyword("throw", false)/*const Keyword("throw")*/; | 15836 var const$280 = new Keyword("while", false)/*const Keyword("while")*/; |
| 15801 var const$282 = new Keyword("true", false)/*const Keyword("true")*/; | 15837 var const$282 = new Keyword("abstract", true)/*const Keyword("abstract", true)*/
; |
| 15802 var const$284 = new Keyword("try", false)/*const Keyword("try")*/; | 15838 var const$284 = new Keyword("assert", true)/*const Keyword("assert", true)*/; |
| 15803 var const$286 = new Keyword("var", false)/*const Keyword("var")*/; | 15839 var const$286 = new Keyword("class", true)/*const Keyword("class", true)*/; |
| 15804 var const$288 = new Keyword("void", false)/*const Keyword("void")*/; | 15840 var const$288 = new Keyword("extends", true)/*const Keyword("extends", true)*/; |
| 15805 var const$290 = new Keyword("while", false)/*const Keyword("while")*/; | 15841 var const$290 = new Keyword("factory", true)/*const Keyword("factory", true)*/; |
| 15806 var const$292 = new Keyword("abstract", true)/*const Keyword("abstract", true)*/
; | 15842 var const$292 = new Keyword("get", true)/*const Keyword("get", true)*/; |
| 15807 var const$294 = new Keyword("assert", true)/*const Keyword("assert", true)*/; | 15843 var const$294 = new Keyword("implements", true)/*const Keyword("implements", tru
e)*/; |
| 15808 var const$296 = new Keyword("class", true)/*const Keyword("class", true)*/; | 15844 var const$296 = new Keyword("import", true)/*const Keyword("import", true)*/; |
| 15809 var const$298 = new Keyword("extends", true)/*const Keyword("extends", true)*/; | 15845 var const$298 = new Keyword("interface", true)/*const Keyword("interface", true)
*/; |
| 15810 var const$300 = new Keyword("factory", true)/*const Keyword("factory", true)*/; | 15846 var const$300 = new Keyword("library", true)/*const Keyword("library", true)*/; |
| 15811 var const$302 = new Keyword("get", true)/*const Keyword("get", true)*/; | 15847 var const$302 = new Keyword("native", true)/*const Keyword("native", true)*/; |
| 15812 var const$304 = new Keyword("implements", true)/*const Keyword("implements", tru
e)*/; | 15848 var const$304 = new Keyword("negate", true)/*const Keyword("negate", true)*/; |
| 15813 var const$306 = new Keyword("import", true)/*const Keyword("import", true)*/; | 15849 var const$306 = new Keyword("operator", true)/*const Keyword("operator", true)*/
; |
| 15814 var const$308 = new Keyword("interface", true)/*const Keyword("interface", true)
*/; | 15850 var const$308 = new Keyword("set", true)/*const Keyword("set", true)*/; |
| 15815 var const$310 = new Keyword("library", true)/*const Keyword("library", true)*/; | 15851 var const$310 = new Keyword("source", true)/*const Keyword("source", true)*/; |
| 15816 var const$312 = new Keyword("native", true)/*const Keyword("native", true)*/; | 15852 var const$312 = new Keyword("static", true)/*const Keyword("static", true)*/; |
| 15817 var const$314 = new Keyword("negate", true)/*const Keyword("negate", true)*/; | 15853 var const$314 = new Keyword("typedef", true)/*const Keyword("typedef", true)*/; |
| 15818 var const$316 = new Keyword("operator", true)/*const Keyword("operator", true)*/
; | 15854 var const$318 = new LinkTail()/*const LinkTail()*/; |
| 15819 var const$318 = new Keyword("set", true)/*const Keyword("set", true)*/; | 15855 var const$319 = new StringWrapper("<")/*const SourceString("<")*/; |
| 15820 var const$320 = new Keyword("source", true)/*const Keyword("source", true)*/; | 15856 var const$320 = new StringWrapper(".")/*const SourceString(".")*/; |
| 15821 var const$322 = new Keyword("static", true)/*const Keyword("static", true)*/; | 15857 var const$321 = new StringWrapper(",")/*const SourceString(",")*/; |
| 15822 var const$324 = new Keyword("typedef", true)/*const Keyword("typedef", true)*/; | 15858 var const$322 = new StringWrapper(">")/*const SourceString(">")*/; |
| 15823 var const$328 = new LinkTail()/*const LinkTail()*/; | 15859 var const$323 = new StringWrapper("{")/*const SourceString("{")*/; |
| 15824 var const$329 = new StringWrapper("<")/*const SourceString("<")*/; | 15860 var const$324 = new StringWrapper("string")/*const SourceString("string")*/; |
| 15825 var const$330 = new StringWrapper(".")/*const SourceString(".")*/; | 15861 var const$325 = new StringWrapper("(")/*const SourceString("(")*/; |
| 15826 var const$331 = new StringWrapper(",")/*const SourceString(",")*/; | 15862 var const$326 = new StringWrapper(")")/*const SourceString(")")*/; |
| 15827 var const$332 = new StringWrapper(">")/*const SourceString(">")*/; | 15863 var const$327 = new StringWrapper(";")/*const SourceString(";")*/; |
| 15828 var const$333 = new StringWrapper("{")/*const SourceString("{")*/; | 15864 var const$328 = new StringWrapper("#")/*const SourceString("#")*/; |
| 15829 var const$334 = new StringWrapper("string")/*const SourceString("string")*/; | 15865 var const$329 = new StringWrapper("=")/*const SourceString("=")*/; |
| 15830 var const$335 = new StringWrapper("(")/*const SourceString("(")*/; | 15866 var const$330 = new StringWrapper("}")/*const SourceString("}")*/; |
| 15831 var const$336 = new StringWrapper(")")/*const SourceString(")")*/; | 15867 var const$331 = new StringWrapper("return")/*const SourceString("return")*/; |
| 15832 var const$337 = new StringWrapper(";")/*const SourceString(";")*/; | 15868 var const$333 = new StringWrapper('print')/*const SourceString('print')*/; |
| 15833 var const$338 = new StringWrapper("#")/*const SourceString("#")*/; | 15869 var const$334 = new StringWrapper('+')/*const SourceString('+')*/; |
| 15834 var const$339 = new StringWrapper("=")/*const SourceString("=")*/; | 15870 var const$336 = new StringWrapper('void')/*const SourceString('void')*/; |
| 15835 var const$340 = new StringWrapper("}")/*const SourceString("}")*/; | 15871 var const$338 = new StringWrapper('int')/*const SourceString('int')*/; |
| 15836 var const$341 = new StringWrapper("return")/*const SourceString("return")*/; | 15872 var const$340 = new StringWrapper('Dynamic')/*const SourceString('Dynamic')*/; |
| 15837 var const$8 = []/*const <HInstruction>[]*/; | |
| 15838 var const$9 = new NoMoreElementsException()/*const NoMoreElementsException()*/; | |
| 15839 var $0 = 48; | 15873 var $0 = 48; |
| 15840 var $1 = 49; | 15874 var $1 = 49; |
| 15841 var $2 = 50; | 15875 var $2 = 50; |
| 15842 var $3 = 51; | 15876 var $3 = 51; |
| 15843 var $4 = 52; | 15877 var $4 = 52; |
| 15844 var $5 = 53; | 15878 var $5 = 53; |
| 15845 var $6 = 54; | 15879 var $6 = 54; |
| 15846 var $7 = 55; | 15880 var $7 = 55; |
| 15847 var $8 = 56; | 15881 var $8 = 56; |
| 15848 var $9 = 57; | 15882 var $9 = 57; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16018 TokenKind.LBRACE = 6; | 16052 TokenKind.LBRACE = 6; |
| 16019 TokenKind.LBRACK = 4; | 16053 TokenKind.LBRACK = 4; |
| 16020 TokenKind.LIBRARY = 79; | 16054 TokenKind.LIBRARY = 79; |
| 16021 Math.LN10 = 2.302585092994046; | 16055 Math.LN10 = 2.302585092994046; |
| 16022 Math.LN2 = 0.6931471805599453; | 16056 Math.LN2 = 0.6931471805599453; |
| 16023 Math.LOG10E = 0.4342944819032518; | 16057 Math.LOG10E = 0.4342944819032518; |
| 16024 Math.LOG2E = 1.4426950408889634; | 16058 Math.LOG2E = 1.4426950408889634; |
| 16025 TokenKind.LPAREN = 2; | 16059 TokenKind.LPAREN = 2; |
| 16026 TokenKind.LT = 52; | 16060 TokenKind.LT = 52; |
| 16027 TokenKind.LTE = 54; | 16061 TokenKind.LTE = 54; |
| 16028 Duration.MILLISECONDS_PER_DAY = 86400000/*MILLISECONDS_PER_HOUR * HOURS_PER_DAY*
/; | 16062 Duration.MILLISECONDS_PER_DAY = 86400000.000000/*MILLISECONDS_PER_HOUR * HOURS_P
ER_DAY*/; |
| 16029 Duration.MILLISECONDS_PER_HOUR = 3600000/*MILLISECONDS_PER_MINUTE * MINUTES_PER_
HOUR*/; | 16063 Duration.MILLISECONDS_PER_HOUR = 3600000.000000/*MILLISECONDS_PER_MINUTE * MINUT
ES_PER_HOUR*/; |
| 16030 Duration.MILLISECONDS_PER_MINUTE = 60000/*MILLISECONDS_PER_SECOND * SECONDS_PER_
MINUTE*/; | 16064 Duration.MILLISECONDS_PER_MINUTE = 60000.000000/*MILLISECONDS_PER_SECOND * SECON
DS_PER_MINUTE*/; |
| 16031 Duration.MILLISECONDS_PER_SECOND = 1000; | 16065 Duration.MILLISECONDS_PER_SECOND = 1000; |
| 16032 Duration.MINUTES_PER_HOUR = 60; | 16066 Duration.MINUTES_PER_HOUR = 60; |
| 16033 TokenKind.MOD = 47; | 16067 TokenKind.MOD = 47; |
| 16034 TokenKind.MUL = 44; | 16068 TokenKind.MUL = 44; |
| 16035 TokenKind.NATIVE = 80; | 16069 TokenKind.NATIVE = 80; |
| 16036 TokenKind.NE = 49; | 16070 TokenKind.NE = 49; |
| 16037 TokenKind.NEGATE = 81; | 16071 TokenKind.NEGATE = 81; |
| 16038 TokenKind.NEW = 102; | 16072 TokenKind.NEW = 102; |
| 16039 CodeWriter.NEWLINE = '\n'; | 16073 CodeWriter.NEWLINE = '\n'; |
| 16040 TokenKind.NE_STRICT = 51; | 16074 TokenKind.NE_STRICT = 51; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16074 TokenKind.TRUE = 109; | 16108 TokenKind.TRUE = 109; |
| 16075 TokenKind.TRUNCDIV = 46; | 16109 TokenKind.TRUNCDIV = 46; |
| 16076 TokenKind.TRY = 110; | 16110 TokenKind.TRY = 110; |
| 16077 TokenKind.TYPEDEF = 86; | 16111 TokenKind.TYPEDEF = 86; |
| 16078 TokenKind.VAR = 111; | 16112 TokenKind.VAR = 111; |
| 16079 TokenKind.VOID = 112; | 16113 TokenKind.VOID = 112; |
| 16080 TokenKind.WHILE = 113; | 16114 TokenKind.WHILE = 113; |
| 16081 TokenKind.WHITESPACE = 62; | 16115 TokenKind.WHITESPACE = 62; |
| 16082 HashMapImplementation._INITIAL_CAPACITY = 8; | 16116 HashMapImplementation._INITIAL_CAPACITY = 8; |
| 16083 var _SPAWNED_SIGNAL = "spawned"; | 16117 var _SPAWNED_SIGNAL = "spawned"; |
| 16084 var const$134 = new SimpleType(const$133)/*const SimpleType(const SourceString('
void'))*/; | 16118 var const$337 = new SimpleType(const$336)/*const SimpleType(const SourceString('
void'))*/; |
| 16085 var const$136 = new SimpleType(const$135)/*const SimpleType(const SourceString('
int'))*/; | 16119 var const$339 = new SimpleType(const$338)/*const SimpleType(const SourceString('
int'))*/; |
| 16086 var const$138 = new SimpleType(const$137)/*const SimpleType(const SourceString('
Dynamic'))*/; | 16120 var const$341 = new SimpleType(const$340)/*const SimpleType(const SourceString('
Dynamic'))*/; |
| 16087 Keyword.ABSTRACT = const$292/*const Keyword("abstract", true)*/; | 16121 Keyword.ABSTRACT = const$282/*const Keyword("abstract", true)*/; |
| 16088 Keyword.ASSERT = const$294/*const Keyword("assert", true)*/; | 16122 Keyword.ASSERT = const$284/*const Keyword("assert", true)*/; |
| 16089 Keyword.BREAK = const$238/*const Keyword("break")*/; | 16123 Keyword.BREAK = const$228/*const Keyword("break")*/; |
| 16090 Keyword.CASE = const$240/*const Keyword("case")*/; | 16124 Keyword.CASE = const$230/*const Keyword("case")*/; |
| 16091 Keyword.CATCH = const$242/*const Keyword("catch")*/; | 16125 Keyword.CATCH = const$232/*const Keyword("catch")*/; |
| 16092 Keyword.CLASS = const$296/*const Keyword("class", true)*/; | 16126 Keyword.CLASS = const$286/*const Keyword("class", true)*/; |
| 16093 Keyword.CONST = const$244/*const Keyword("const")*/; | 16127 Keyword.CONST = const$234/*const Keyword("const")*/; |
| 16094 Keyword.CONTINUE = const$246/*const Keyword("continue")*/; | 16128 Keyword.CONTINUE = const$236/*const Keyword("continue")*/; |
| 16095 Keyword.DEFAULT = const$248/*const Keyword("default")*/; | 16129 Keyword.DEFAULT = const$238/*const Keyword("default")*/; |
| 16096 Keyword.DO = const$250/*const Keyword("do")*/; | 16130 Keyword.DO = const$240/*const Keyword("do")*/; |
| 16097 Keyword.ELSE = const$252/*const Keyword("else")*/; | 16131 Keyword.ELSE = const$242/*const Keyword("else")*/; |
| 16098 Keyword.EXTENDS = const$298/*const Keyword("extends", true)*/; | 16132 Keyword.EXTENDS = const$288/*const Keyword("extends", true)*/; |
| 16099 Keyword.FACTORY = const$300/*const Keyword("factory", true)*/; | 16133 Keyword.FACTORY = const$290/*const Keyword("factory", true)*/; |
| 16100 Keyword.FALSE = const$254/*const Keyword("false")*/; | 16134 Keyword.FALSE = const$244/*const Keyword("false")*/; |
| 16101 Keyword.FINAL = const$256/*const Keyword("final")*/; | 16135 Keyword.FINAL = const$246/*const Keyword("final")*/; |
| 16102 Keyword.FINALLY = const$258/*const Keyword("finally")*/; | 16136 Keyword.FINALLY = const$248/*const Keyword("finally")*/; |
| 16103 Keyword.FOR = const$260/*const Keyword("for")*/; | 16137 Keyword.FOR = const$250/*const Keyword("for")*/; |
| 16104 Keyword.GET = const$302/*const Keyword("get", true)*/; | 16138 Keyword.GET = const$292/*const Keyword("get", true)*/; |
| 16105 Keyword.IF = const$262/*const Keyword("if")*/; | 16139 Keyword.IF = const$252/*const Keyword("if")*/; |
| 16106 Keyword.IMPLEMENTS = const$304/*const Keyword("implements", true)*/; | 16140 Keyword.IMPLEMENTS = const$294/*const Keyword("implements", true)*/; |
| 16107 Keyword.IMPORT = const$306/*const Keyword("import", true)*/; | 16141 Keyword.IMPORT = const$296/*const Keyword("import", true)*/; |
| 16108 Keyword.IN = const$264/*const Keyword("in")*/; | 16142 Keyword.IN = const$254/*const Keyword("in")*/; |
| 16109 Keyword.INTERFACE = const$308/*const Keyword("interface", true)*/; | 16143 Keyword.INTERFACE = const$298/*const Keyword("interface", true)*/; |
| 16110 Keyword.IS = const$266/*const Keyword("is")*/; | 16144 Keyword.IS = const$256/*const Keyword("is")*/; |
| 16111 Keyword.LIBRARY = const$310/*const Keyword("library", true)*/; | 16145 Keyword.LIBRARY = const$300/*const Keyword("library", true)*/; |
| 16112 Keyword.NATIVE = const$312/*const Keyword("native", true)*/; | 16146 Keyword.NATIVE = const$302/*const Keyword("native", true)*/; |
| 16113 Keyword.NEGATE = const$314/*const Keyword("negate", true)*/; | 16147 Keyword.NEGATE = const$304/*const Keyword("negate", true)*/; |
| 16114 Keyword.NEW = const$268/*const Keyword("new")*/; | 16148 Keyword.NEW = const$258/*const Keyword("new")*/; |
| 16115 Keyword.NULL = const$270/*const Keyword("null")*/; | 16149 Keyword.NULL = const$260/*const Keyword("null")*/; |
| 16116 Keyword.OPERATOR = const$316/*const Keyword("operator", true)*/; | 16150 Keyword.OPERATOR = const$306/*const Keyword("operator", true)*/; |
| 16117 Keyword.RETURN = const$272/*const Keyword("return")*/; | 16151 Keyword.RETURN = const$262/*const Keyword("return")*/; |
| 16118 Keyword.SET = const$318/*const Keyword("set", true)*/; | 16152 Keyword.SET = const$308/*const Keyword("set", true)*/; |
| 16119 Keyword.SOURCE = const$320/*const Keyword("source", true)*/; | 16153 Keyword.SOURCE = const$310/*const Keyword("source", true)*/; |
| 16120 Keyword.STATIC = const$322/*const Keyword("static", true)*/; | 16154 Keyword.STATIC = const$312/*const Keyword("static", true)*/; |
| 16121 Keyword.SUPER = const$274/*const Keyword("super")*/; | 16155 Keyword.SUPER = const$264/*const Keyword("super")*/; |
| 16122 Keyword.SWITCH = const$276/*const Keyword("switch")*/; | 16156 Keyword.SWITCH = const$266/*const Keyword("switch")*/; |
| 16123 Keyword.THIS = const$278/*const Keyword("this")*/; | 16157 Keyword.THIS = const$268/*const Keyword("this")*/; |
| 16124 Keyword.THROW = const$280/*const Keyword("throw")*/; | 16158 Keyword.THROW = const$270/*const Keyword("throw")*/; |
| 16125 Keyword.TRUE = const$282/*const Keyword("true")*/; | 16159 Keyword.TRUE = const$272/*const Keyword("true")*/; |
| 16126 Keyword.TRY = const$284/*const Keyword("try")*/; | 16160 Keyword.TRY = const$274/*const Keyword("try")*/; |
| 16127 Keyword.TYPEDEF = const$324/*const Keyword("typedef", true)*/; | 16161 Keyword.TYPEDEF = const$314/*const Keyword("typedef", true)*/; |
| 16128 Keyword.VAR = const$286/*const Keyword("var")*/; | 16162 Keyword.VAR = const$276/*const Keyword("var")*/; |
| 16129 Keyword.VOID = const$288/*const Keyword("void")*/; | 16163 Keyword.VOID = const$278/*const Keyword("void")*/; |
| 16130 Keyword.WHILE = const$290/*const Keyword("while")*/; | 16164 Keyword.WHILE = const$280/*const Keyword("while")*/; |
| 16131 var const$326 = [const$238, const$240, const$242, const$244, const$246, const$24
8, const$250, const$252, const$254, const$256, const$258, const$260, const$262,
const$264, const$266, const$268, const$270, const$272, const$274, const$276, con
st$278, const$280, const$282, const$284, const$286, const$288, const$290, const$
292, const$294, const$296, const$298, const$300, const$302, const$304, const$306
, const$308, const$310, const$312, const$314, const$316, const$318, const$320, c
onst$322, const$324]/*const <Keyword> [ | 16165 var const$316 = [const$228, const$230, const$232, const$234, const$236, const$23
8, const$240, const$242, const$244, const$246, const$248, const$250, const$252,
const$254, const$256, const$258, const$260, const$262, const$264, const$266, con
st$268, const$270, const$272, const$274, const$276, const$278, const$280, const$
282, const$284, const$286, const$288, const$290, const$292, const$294, const$296
, const$298, const$300, const$302, const$304, const$306, const$308, const$310, c
onst$312, const$314]/*const <Keyword> [ |
| 16132 BREAK, | 16166 BREAK, |
| 16133 CASE, | 16167 CASE, |
| 16134 CATCH, | 16168 CATCH, |
| 16135 CONST, | 16169 CONST, |
| 16136 CONTINUE, | 16170 CONTINUE, |
| 16137 DEFAULT, | 16171 DEFAULT, |
| 16138 DO, | 16172 DO, |
| 16139 ELSE, | 16173 ELSE, |
| 16140 FALSE, | 16174 FALSE, |
| 16141 FINAL, | 16175 FINAL, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 16166 IMPORT, | 16200 IMPORT, |
| 16167 INTERFACE, | 16201 INTERFACE, |
| 16168 LIBRARY, | 16202 LIBRARY, |
| 16169 NATIVE, | 16203 NATIVE, |
| 16170 NEGATE, | 16204 NEGATE, |
| 16171 OPERATOR, | 16205 OPERATOR, |
| 16172 SET, | 16206 SET, |
| 16173 SOURCE, | 16207 SOURCE, |
| 16174 STATIC, | 16208 STATIC, |
| 16175 TYPEDEF ]*/; | 16209 TYPEDEF ]*/; |
| 16176 Keyword.values = const$326/*const <Keyword> [ | 16210 Keyword.values = const$316/*const <Keyword> [ |
| 16177 BREAK, | 16211 BREAK, |
| 16178 CASE, | 16212 CASE, |
| 16179 CATCH, | 16213 CATCH, |
| 16180 CONST, | 16214 CONST, |
| 16181 CONTINUE, | 16215 CONTINUE, |
| 16182 DEFAULT, | 16216 DEFAULT, |
| 16183 DO, | 16217 DO, |
| 16184 ELSE, | 16218 ELSE, |
| 16185 FALSE, | 16219 FALSE, |
| 16186 FINAL, | 16220 FINAL, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 16212 INTERFACE, | 16246 INTERFACE, |
| 16213 LIBRARY, | 16247 LIBRARY, |
| 16214 NATIVE, | 16248 NATIVE, |
| 16215 NEGATE, | 16249 NEGATE, |
| 16216 OPERATOR, | 16250 OPERATOR, |
| 16217 SET, | 16251 SET, |
| 16218 SOURCE, | 16252 SOURCE, |
| 16219 STATIC, | 16253 STATIC, |
| 16220 TYPEDEF ]*/; | 16254 TYPEDEF ]*/; |
| 16221 main(); | 16255 main(); |
| OLD | NEW |