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

Unified Diff: tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart

Issue 810783002: Clean up FunctionDefinition in the IR S-expression representation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | « tests/compiler/dart2js/backend_dart/opt_shrinking_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
diff --git a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
index d0eeba8d360b89f852ba3614c68560144a2ebc5a..db9cc7dfd49f47220d1bd6598654683b19096338 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
@@ -271,29 +271,15 @@ class SExpressionUnstringifier {
// name
Element element = new DummyElement("");
- if (tokens.current != '(' && tokens.current != '{') {
+ if (tokens.current != '(') {
// This is a named function.
element = new DummyElement(tokens.read());
}
- // [closure-vars]
- List<ClosureVariable> closureVariables = <ClosureVariable>[];
- if (tokens.current == '{') {
- tokens.read('{');
- while (tokens.current != '}') {
- String varName = tokens.read();
- ClosureVariable variable =
- new ClosureVariable(element, new DummyElement(varName));
- closureVariables.add(variable);
- name2variable[varName] = variable;
- }
- tokens.read('}');
- }
-
- // (args cont)
+ // (parameters)
List<Definition> parameters = <Definition>[];
tokens.consumeStart();
- while (tokens.next != ")") {
+ while (tokens.current != ")") {
String paramName = tokens.read();
if (name2variable.containsKey(paramName)) {
parameters.add(name2variable[paramName]);
@@ -303,10 +289,23 @@ class SExpressionUnstringifier {
parameters.add(param);
}
}
+ tokens.consumeEnd();
+ // continuation
String contName = tokens.read("return");
Continuation cont = name2variable[contName];
assert(cont != null);
+
+ // [closure-variables]
+ List<ClosureVariable> closureVariables = <ClosureVariable>[];
+ tokens.consumeStart();
+ while (tokens.current != ')') {
+ String varName = tokens.read();
+ ClosureVariable variable =
+ new ClosureVariable(element, new DummyElement(varName));
+ closureVariables.add(variable);
+ name2variable[varName] = variable;
+ }
tokens.consumeEnd();
// body
« no previous file with comments | « tests/compiler/dart2js/backend_dart/opt_shrinking_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698