| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 void handleStringPart(Token token) { | 106 void handleStringPart(Token token) { |
| 107 debugEvent("StringPart"); | 107 debugEvent("StringPart"); |
| 108 push(token); | 108 push(token); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void doStringPart(Token token) { | 111 void doStringPart(Token token) { |
| 112 push(ast.simpleStringLiteral(toAnalyzerToken(token), token.value)); | 112 push(ast.simpleStringLiteral(toAnalyzerToken(token), token.value)); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void endLiteralString(int interpolationCount) { | 115 void endLiteralString(int interpolationCount, Token endToken) { |
| 116 debugEvent("endLiteralString"); | 116 debugEvent("endLiteralString"); |
| 117 if (interpolationCount == 0) { | 117 if (interpolationCount == 0) { |
| 118 Token token = pop(); | 118 Token token = pop(); |
| 119 String value = unescapeString(token.value); | 119 String value = unescapeString(token.value); |
| 120 push(ast.simpleStringLiteral(toAnalyzerToken(token), value)); | 120 push(ast.simpleStringLiteral(toAnalyzerToken(token), value)); |
| 121 } else { | 121 } else { |
| 122 List parts = popList(1 + interpolationCount * 2); | 122 List parts = popList(1 + interpolationCount * 2); |
| 123 Token first = parts.first; | 123 Token first = parts.first; |
| 124 Token last = parts.last; | 124 Token last = parts.last; |
| 125 Quote quote = analyzeQuote(first.value); | 125 Quote quote = analyzeQuote(first.value); |
| (...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1514 } else if (identical('static', s)) { | 1514 } else if (identical('static', s)) { |
| 1515 staticKeyword = token; | 1515 staticKeyword = token; |
| 1516 } else if (identical('var', s)) { | 1516 } else if (identical('var', s)) { |
| 1517 finalConstOrVarKeyword = token; | 1517 finalConstOrVarKeyword = token; |
| 1518 } else { | 1518 } else { |
| 1519 internalError('Unhandled modifier: $s'); | 1519 internalError('Unhandled modifier: $s'); |
| 1520 } | 1520 } |
| 1521 } | 1521 } |
| 1522 } | 1522 } |
| 1523 } | 1523 } |
| OLD | NEW |