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

Side by Side Diff: frog/tests/leg/src/ScannerTest.dart

Issue 9190038: Handle escapes in string literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed validation from scanner Created 8 years, 11 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
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 #import('../../../../utils/utf8/utf8.dart'); 5 #import('../../../../utils/utf8/utf8.dart');
6 #import('../../../leg/scanner/scannerlib.dart'); 6 #import('../../../leg/scanner/scannerlib.dart');
7 #import('../../../leg/scanner/scanner_implementation.dart'); 7 #import('../../../leg/scanner/scanner_implementation.dart');
8 #import('../../../leg/util/characters.dart');
8 #source('../../../leg/scanner/byte_strings.dart'); 9 #source('../../../leg/scanner/byte_strings.dart');
9 #source('../../../leg/scanner/byte_array_scanner.dart'); 10 #source('../../../leg/scanner/byte_array_scanner.dart');
10 11
11 Token scan(List<int> bytes) => new ByteArrayScanner(bytes).tokenize(); 12 Token scan(List<int> bytes) => new ByteArrayScanner(bytes).tokenize();
12 13
13 bool isRunningOnJavaScript() => 1 === 1.0; 14 bool isRunningOnJavaScript() => 1 === 1.0;
14 15
15 main() { 16 main() {
16 // Google favorite: "Îñţérñåţîöñåļîžåţîờñ". 17 // Google favorite: "Îñţérñåţîöñåļîžåţîờñ".
17 Token token = scan([0xc3, 0x8e, 0xc3, 0xb1, 0xc5, 0xa3, 0xc3, 0xa9, 0x72, 18 Token token = scan([0xc3, 0x8e, 0xc3, 0xb1, 0xc5, 0xa3, 0xc3, 0xa9, 0x72,
(...skipping 26 matching lines...) Expand all
44 45
45 if (!isRunningOnJavaScript()) { 46 if (!isRunningOnJavaScript()) {
46 // DESERET CAPITAL LETTER BEE, unicode 0x10412(0xD801+0xDC12) 47 // DESERET CAPITAL LETTER BEE, unicode 0x10412(0xD801+0xDC12)
47 // UTF-8: F0 90 90 92 48 // UTF-8: F0 90 90 92
48 token = scan([0xf0, 0x90, 0x90, 0x92, $EOF]); 49 token = scan([0xf0, 0x90, 0x90, 0x92, $EOF]);
49 Expect.stringEquals("𐐒", token.value.toString()); 50 Expect.stringEquals("𐐒", token.value.toString());
50 } else { 51 } else {
51 print('Skipping non-BMP character test'); 52 print('Skipping non-BMP character test');
52 } 53 }
53 } 54 }
OLDNEW
« no previous file with comments | « frog/tests/leg/src/BuiltinInterceptorTest.dart ('k') | frog/tests/leg/src/StringEscapesTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698