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

Unified Diff: pkg/kernel/lib/text/ast_to_text.dart

Issue 2767773004: Add Vector type to Kernel (Closed)
Patch Set: Reformat comment with Markdown, throw exception in type propagation 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/kernel/lib/frontend/accessors.dart ('k') | pkg/kernel/lib/transformations/closure/context.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/text/ast_to_text.dart
diff --git a/pkg/kernel/lib/text/ast_to_text.dart b/pkg/kernel/lib/text/ast_to_text.dart
index a393327fd91c43bd4188adfb588cd7c6e0df4bce..6682aa04d4ce35eda322ca5102738009344da494 100644
--- a/pkg/kernel/lib/text/ast_to_text.dart
+++ b/pkg/kernel/lib/text/ast_to_text.dart
@@ -455,6 +455,10 @@ class Printer extends Visitor<Null> {
}
}
+ visitVectorType(VectorType type) {
+ writeWord('Vector');
+ }
+
void writeModifier(bool isThere, String name) {
if (isThere) {
writeWord(name);
@@ -1017,6 +1021,36 @@ class Printer extends Visitor<Null> {
state = WORD;
}
+ visitVectorCreation(VectorCreation node) {
+ writeWord('MakeVector');
+ writeSymbol('(');
+ writeWord(node.length.toString());
+ writeSymbol(')');
+ }
+
+ visitVectorGet(VectorGet node) {
+ writeExpression(node.vectorExpression);
+ writeSymbol('[');
+ writeWord(node.index.toString());
+ writeSymbol(']');
+ }
+
+ visitVectorSet(VectorSet node) {
+ writeExpression(node.vectorExpression);
+ writeSymbol('[');
+ writeWord(node.index.toString());
+ writeSymbol(']');
+ writeSpaced('=');
+ writeExpression(node.value);
+ }
+
+ visitVectorCopy(VectorCopy node) {
+ writeWord('CopyVector');
+ writeSymbol('(');
+ writeExpression(node.vectorExpression);
+ writeSymbol(')');
+ }
+
visitDeferredImport(DeferredImport node) {
write('import "');
write('${node.importedLibrary.importUri}');
« no previous file with comments | « pkg/kernel/lib/frontend/accessors.dart ('k') | pkg/kernel/lib/transformations/closure/context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698