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

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

Issue 13724021: Remove deprecated Expect from the libraries. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Rebase. Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « tests/standalone/typed_data_view_test.dart ('k') | tools/testing/dart/test_runner.dart » ('j') | 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 Tokenizer(String this.expression) 49 Tokenizer(String this.expression)
50 : tokens = new List<String>(); 50 : tokens = new List<String>();
51 51
52 // Tokens are : "(", ")", "$", ",", "&&", "||", "==", and (maximal) \w+. 52 // Tokens are : "(", ")", "$", ",", "&&", "||", "==", and (maximal) \w+.
53 static final testRegexp = 53 static final testRegexp =
54 new RegExp(r"^([()$\w\s,]|(\&\&)|(\|\|)|(\=\=))+$"); 54 new RegExp(r"^([()$\w\s,]|(\&\&)|(\|\|)|(\=\=))+$");
55 static final regexp = new RegExp(r"[()$,]|(\&\&)|(\|\|)|(\=\=)|\w+"); 55 static final regexp = new RegExp(r"[()$,]|(\&\&)|(\|\|)|(\=\=)|\w+");
56 56
57 List<String> tokenize() { 57 List<String> tokenize() {
58 if (!testRegexp.hasMatch(expression)) { 58 if (!testRegexp.hasMatch(expression)) {
59 throw new ExpectException("Syntax error in '$expression'"); 59 throw new FormatException("Syntax error in '$expression'");
60 } 60 }
61 for (Match match in regexp.allMatches(expression)) tokens.add(match[0]); 61 for (Match match in regexp.allMatches(expression)) tokens.add(match[0]);
62 return tokens; 62 return tokens;
63 } 63 }
64 } 64 }
65 65
66 66
67 abstract class BooleanExpression { 67 abstract class BooleanExpression {
68 bool evaluate(Map<String, String> environment); 68 bool evaluate(Map<String, String> environment);
69 } 69 }
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 } 298 }
299 TermConstant right = new TermConstant(scanner.current); 299 TermConstant right = new TermConstant(scanner.current);
300 scanner.advance(); 300 scanner.advance();
301 return new Comparison(left, right); 301 return new Comparison(left, right);
302 } else { 302 } else {
303 return new BooleanVariable(left); 303 return new BooleanVariable(left);
304 } 304 }
305 } 305 }
306 } 306 }
307 307
OLDNEW
« no previous file with comments | « tests/standalone/typed_data_view_test.dart ('k') | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698