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.analyzer.ast_builder; | 5 library fasta.analyzer.ast_builder; |
6 | 6 |
7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; | 8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; |
9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; | 9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; |
10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token; | 10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token; |
(...skipping 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1921 } | 1921 } |
1922 | 1922 |
1923 @override | 1923 @override |
1924 void addCompileTimeErrorFromMessage(FastaMessage message) { | 1924 void addCompileTimeErrorFromMessage(FastaMessage message) { |
1925 FastaCode code = message.code; | 1925 FastaCode code = message.code; |
1926 switch (code.analyzerCode) { | 1926 switch (code.analyzerCode) { |
1927 case "EXPECTED_TYPE_NAME": | 1927 case "EXPECTED_TYPE_NAME": |
1928 errorReporter?.reportErrorForOffset( | 1928 errorReporter?.reportErrorForOffset( |
1929 ParserErrorCode.EXPECTED_TYPE_NAME, message.charOffset, 1); | 1929 ParserErrorCode.EXPECTED_TYPE_NAME, message.charOffset, 1); |
1930 return; | 1930 return; |
| 1931 case "EXPECTED_STRING_LITERAL": |
| 1932 errorReporter?.reportErrorForOffset( |
| 1933 ParserErrorCode.EXPECTED_STRING_LITERAL, message.charOffset, 1); |
| 1934 return; |
1931 default: | 1935 default: |
1932 // fall through | 1936 // fall through |
1933 } | 1937 } |
1934 library.addCompileTimeError(message.charOffset, message.message, | 1938 library.addCompileTimeError(message.charOffset, message.message, |
1935 fileUri: message.uri); | 1939 fileUri: message.uri); |
1936 } | 1940 } |
1937 } | 1941 } |
1938 | 1942 |
1939 /// Data structure placed on the stack to represent a class body. | 1943 /// Data structure placed on the stack to represent a class body. |
1940 /// | 1944 /// |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2034 } else if (identical('var', s)) { | 2038 } else if (identical('var', s)) { |
2035 finalConstOrVarKeyword = token; | 2039 finalConstOrVarKeyword = token; |
2036 } else if (identical('covariant', s)) { | 2040 } else if (identical('covariant', s)) { |
2037 covariantKeyword = token; | 2041 covariantKeyword = token; |
2038 } else { | 2042 } else { |
2039 internalError('Unhandled modifier: $s'); | 2043 internalError('Unhandled modifier: $s'); |
2040 } | 2044 } |
2041 } | 2045 } |
2042 } | 2046 } |
2043 } | 2047 } |
OLD | NEW |