| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 library validation_input_parser; | 5 library validation_input_parser; |
| 6 | 6 |
| 7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
| 8 | 8 |
| 9 class ValidationParseResult { | 9 class ValidationParseResult { |
| 10 final Iterable<_Entry> _entries; | 10 final Iterable<_Entry> _entries; |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 175 } |
| 176 | 176 |
| 177 class _ValidationTestParser { | 177 class _ValidationTestParser { |
| 178 static final RegExp newline = new RegExp(r'[\r\n]+'); | 178 static final RegExp newline = new RegExp(r'[\r\n]+'); |
| 179 static final RegExp whitespace = new RegExp(r'[ \t\n\r]+'); | 179 static final RegExp whitespace = new RegExp(r'[ \t\n\r]+'); |
| 180 static final RegExp nakedUintRegExp = | 180 static final RegExp nakedUintRegExp = |
| 181 new RegExp(r'^0$|^[1-9][0-9]*$|^0[xX][0-9a-fA-F]+$'); | 181 new RegExp(r'^0$|^[1-9][0-9]*$|^0[xX][0-9a-fA-F]+$'); |
| 182 static final RegExp unsignedRegExp = | 182 static final RegExp unsignedRegExp = |
| 183 new RegExp(r'^\[u([1248])\](0$|[1-9][0-9]*$|0[xX][0-9a-fA-F]+$)'); | 183 new RegExp(r'^\[u([1248])\](0$|[1-9][0-9]*$|0[xX][0-9a-fA-F]+$)'); |
| 184 static final RegExp signedRegExp = new RegExp( | 184 static final RegExp signedRegExp = new RegExp( |
| 185 r'^\[s([1248])\]([-+]?0$|[-+][1-9][0-9]*$|[-+]0[xX][0-9a-fA-F]+$)'); | 185 r'^\[s([1248])\]([-+]?0$|[-+]?[1-9][0-9]*$|[-+]?0[xX][0-9a-fA-F]+$)'); |
| 186 static final RegExp binaryRegExp = | 186 static final RegExp binaryRegExp = |
| 187 new RegExp(r'^\[(b)\]([01]{8}$)'); | 187 new RegExp(r'^\[(b)\]([01]{8}$)'); |
| 188 static final RegExp floatRegExp = | 188 static final RegExp floatRegExp = |
| 189 new RegExp(r'^\[([fd])\]([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$)'); | 189 new RegExp(r'^\[([fd])\]([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$)'); |
| 190 static final RegExp distRegExp = | 190 static final RegExp distRegExp = |
| 191 new RegExp(r'^\[dist([48])\]([0-9a-zA-Z_]+$)'); | 191 new RegExp(r'^\[dist([48])\]([0-9a-zA-Z_]+$)'); |
| 192 static final RegExp anchrRegExp = | 192 static final RegExp anchrRegExp = |
| 193 new RegExp(r'^\[(anchr)\]([0-9a-zA-Z_]+$)'); | 193 new RegExp(r'^\[(anchr)\]([0-9a-zA-Z_]+$)'); |
| 194 static final RegExp handlesRegExp = | 194 static final RegExp handlesRegExp = |
| 195 new RegExp(r'^\[(handles)\](0$|([1-9][0-9]*$)|(0[xX][0-9a-fA-F]+$))'); | 195 new RegExp(r'^\[(handles)\](0$|([1-9][0-9]*$)|(0[xX][0-9a-fA-F]+$))'); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 try { | 428 try { |
| 429 var result = parse(input); | 429 var result = parse(input); |
| 430 assert(false); | 430 assert(false); |
| 431 } on ValidationParseError catch(e) { | 431 } on ValidationParseError catch(e) { |
| 432 // Pass. | 432 // Pass. |
| 433 } | 433 } |
| 434 } | 434 } |
| 435 } | 435 } |
| 436 } | 436 } |
| 437 | 437 |
| OLD | NEW |