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

Side by Side Diff: tools/testing/dart/status_expression.dart

Issue 8539009: Fix type mismatch errors. Environments do not only contain strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « tests/standalone/src/StatusExpressionTest.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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("status_expression"); 5 #library("status_expression");
6 6
7 /** 7 /**
8 * Parse and evaluate expressions in a .status file for Dart and V8. 8 * Parse and evaluate expressions in a .status file for Dart and V8.
9 * There are set expressions and Boolean expressions in a .status file. 9 * There are set expressions and Boolean expressions in a .status file.
10 * The grammar is: 10 * The grammar is:
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 left.termValue(environment) == right.termValue(environment); 85 left.termValue(environment) == right.termValue(environment);
86 String toString() => "(\$${left.name} == ${right.value})"; 86 String toString() => "(\$${left.name} == ${right.value})";
87 } 87 }
88 88
89 89
90 class TermVariable { 90 class TermVariable {
91 String name; 91 String name;
92 92
93 TermVariable(this.name); 93 TermVariable(this.name);
94 94
95 String termValue(environment) => environment[name]; 95 termValue(environment) => environment[name];
Bill Hesse 2011/11/11 09:43:19 How about String termValue(environment) => environ
Mads Ager (google) 2011/11/11 09:46:30 Sounds good to me. I'll do that as part of my next
96 } 96 }
97 97
98 98
99 class TermConstant { 99 class TermConstant {
100 String value; 100 String value;
101 101
102 TermConstant(String this.value); 102 TermConstant(String this.value);
103 103
104 String termValue(environment) => value; 104 String termValue(environment) => value;
105 } 105 }
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 "Expected identifier in expression, got ${scanner.current}"); 289 "Expected identifier in expression, got ${scanner.current}");
290 TermConstant right = new TermConstant(scanner.current); 290 TermConstant right = new TermConstant(scanner.current);
291 scanner.advance(); 291 scanner.advance();
292 return new Comparison(left, right); 292 return new Comparison(left, right);
293 } else { 293 } else {
294 return new BooleanVariable(left); 294 return new BooleanVariable(left);
295 } 295 }
296 } 296 }
297 } 297 }
298 298
OLDNEW
« no previous file with comments | « tests/standalone/src/StatusExpressionTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698