Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1159)

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2738693004: Parse script tags with Fasta. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 '../parser/parser.dart' show FormalParameterType, optional; 7 import '../parser/parser.dart' show FormalParameterType, optional;
8 8
9 import '../parser/error_kind.dart' show ErrorKind; 9 import '../parser/error_kind.dart' show ErrorKind;
10 10
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 expressions.add(toValue(part)); 805 expressions.add(toValue(part));
806 } 806 }
807 } 807 }
808 expressions 808 expressions
809 .add(new StringLiteral(unescapeLastStringPart(last.value, quote))); 809 .add(new StringLiteral(unescapeLastStringPart(last.value, quote)));
810 push(new StringConcatenation(expressions)); 810 push(new StringConcatenation(expressions));
811 } 811 }
812 } 812 }
813 813
814 @override 814 @override
815 void handleScript(Token token) {
816 debugEvent("Script");
817 }
818
819 @override
815 void handleStringJuxtaposition(int literalCount) { 820 void handleStringJuxtaposition(int literalCount) {
816 debugEvent("StringJuxtaposition"); 821 debugEvent("StringJuxtaposition");
817 List<Expression> parts = popListForValue(literalCount); 822 List<Expression> parts = popListForValue(literalCount);
818 List<Expression> expressions; 823 List<Expression> expressions;
819 // Flatten string juxtapositions of string interpolation. 824 // Flatten string juxtapositions of string interpolation.
820 for (int i = 0; i < parts.length; i++) { 825 for (int i = 0; i < parts.length; i++) {
821 Expression part = parts[i]; 826 Expression part = parts[i];
822 if (part is StringConcatenation) { 827 if (part is StringConcatenation) {
823 if (expressions == null) { 828 if (expressions == null) {
824 expressions = parts.sublist(0, i); 829 expressions = parts.sublist(0, i);
(...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after
2687 } else if (node is TypeDeclarationBuilder) { 2692 } else if (node is TypeDeclarationBuilder) {
2688 return node.name; 2693 return node.name;
2689 } else if (node is PrefixBuilder) { 2694 } else if (node is PrefixBuilder) {
2690 return node.name; 2695 return node.name;
2691 } else if (node is ThisPropertyAccessor) { 2696 } else if (node is ThisPropertyAccessor) {
2692 return node.name.name; 2697 return node.name.name;
2693 } else { 2698 } else {
2694 return internalError("Unhandled: ${node.runtimeType}"); 2699 return internalError("Unhandled: ${node.runtimeType}");
2695 } 2700 }
2696 } 2701 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/analyzer/token_utils.dart ('k') | pkg/front_end/lib/src/fasta/parser/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698