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

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

Issue 2767773004: Add Vector type to Kernel (Closed)
Patch Set: Add a note to return Run step in Closure Conversion test suite 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
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..e82346cfa48deacfc87f205a7c47ec24d0e25d42 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,37 @@ class Printer extends Visitor<Null> {
state = WORD;
}
+ visitVectorCreation(VectorCreation node) {
+ writeWord('MakeVector');
+ writeSymbol('(');
+ writeExpression(node.length);
+ writeSymbol(')');
+ }
+
+ visitVectorGet(VectorGet node) {
+ writeExpression(node.vectorExpression);
+ writeSymbol('[');
+ writeExpression(node.index);
+ writeSymbol(']');
+ }
+
+ visitVectorSet(VectorSet node) {
+ writeExpression(node.vectorExpression);
+ writeSymbol('[');
+ writeExpression(node.index);
+ writeSymbol(']');
+ state = WORD;
+ writeWord('=');
asgerf 2017/03/22 14:33:22 Please change to writeSpaced('=')
Dmitry Stefantsov 2017/03/23 11:22:43 Thanks! Done.
+ writeExpression(node.value);
+ }
+
+ visitVectorCopy(VectorCopy node) {
+ writeWord('CopyVector');
+ writeSymbol('(');
+ writeExpression(node.vectorExpression);
+ writeSymbol(')');
+ }
+
visitDeferredImport(DeferredImport node) {
write('import "');
write('${node.importedLibrary.importUri}');

Powered by Google App Engine
This is Rietveld 408576698