OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library fasta.body_builder; | 5 library fasta.body_builder; |
6 | 6 |
7 import '../fasta_codes.dart' | 7 import '../fasta_codes.dart' |
8 show | 8 show |
9 FastaMessage, | 9 FastaMessage, |
10 codeConstFieldWithoutInitializer, | 10 codeConstFieldWithoutInitializer, |
(...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1888 } | 1888 } |
1889 | 1889 |
1890 @override | 1890 @override |
1891 void handleNoExpression(Token token) { | 1891 void handleNoExpression(Token token) { |
1892 debugEvent("NoExpression"); | 1892 debugEvent("NoExpression"); |
1893 push(NullValue.Expression); | 1893 push(NullValue.Expression); |
1894 } | 1894 } |
1895 | 1895 |
1896 @override | 1896 @override |
1897 void handleIndexedExpression( | 1897 void handleIndexedExpression( |
1898 Token openCurlyBracket, Token closeCurlyBracket) { | 1898 Token openSquareBracket, Token closeSquareBracket) { |
1899 debugEvent("IndexedExpression"); | 1899 debugEvent("IndexedExpression"); |
1900 Expression index = popForValue(); | 1900 Expression index = popForValue(); |
1901 var receiver = pop(); | 1901 var receiver = pop(); |
1902 if (receiver is ThisAccessor && receiver.isSuper) { | 1902 if (receiver is ThisAccessor && receiver.isSuper) { |
1903 push(new SuperIndexAccessor(this, openCurlyBracket, index, | 1903 push(new SuperIndexAccessor(this, openSquareBracket, index, |
1904 lookupSuperMember(indexGetName), lookupSuperMember(indexSetName))); | 1904 lookupSuperMember(indexGetName), lookupSuperMember(indexSetName))); |
1905 } else { | 1905 } else { |
1906 push(IndexAccessor.make( | 1906 push(IndexAccessor.make( |
1907 this, openCurlyBracket, toValue(receiver), index, null, null)); | 1907 this, openSquareBracket, toValue(receiver), index, null, null)); |
1908 } | 1908 } |
1909 } | 1909 } |
1910 | 1910 |
1911 @override | 1911 @override |
1912 void handleUnaryPrefixExpression(Token token) { | 1912 void handleUnaryPrefixExpression(Token token) { |
1913 debugEvent("UnaryPrefixExpression"); | 1913 debugEvent("UnaryPrefixExpression"); |
1914 var receiver = pop(); | 1914 var receiver = pop(); |
1915 if (optional("!", token)) { | 1915 if (optional("!", token)) { |
1916 push( | 1916 push( |
1917 new KernelNot(toValue(receiver))..fileOffset = offsetForToken(token)); | 1917 new KernelNot(toValue(receiver))..fileOffset = offsetForToken(token)); |
(...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3551 if (starToken == null) { | 3551 if (starToken == null) { |
3552 return AsyncMarker.Async; | 3552 return AsyncMarker.Async; |
3553 } else { | 3553 } else { |
3554 assert(identical(starToken.stringValue, "*")); | 3554 assert(identical(starToken.stringValue, "*")); |
3555 return AsyncMarker.AsyncStar; | 3555 return AsyncMarker.AsyncStar; |
3556 } | 3556 } |
3557 } else { | 3557 } else { |
3558 return internalError("Unknown async modifier: $asyncToken"); | 3558 return internalError("Unknown async modifier: $asyncToken"); |
3559 } | 3559 } |
3560 } | 3560 } |
OLD | NEW |