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

Side by Side Diff: pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart

Issue 2738693004: Parse script tags with Fasta. (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 fasta.scanner.abstract_scanner; 5 library fasta.scanner.abstract_scanner;
6 6
7 import 'dart:collection' show ListMixin; 7 import 'dart:collection' show ListMixin;
8 8
9 import 'dart:typed_data' show Uint16List, Uint32List; 9 import 'dart:typed_data' show Uint16List, Uint32List;
10 10
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 396
397 next = currentAsUnicode(next); 397 next = currentAsUnicode(next);
398 398
399 return unexpected(next); 399 return unexpected(next);
400 } 400 }
401 401
402 int tokenizeTag(int next) { 402 int tokenizeTag(int next) {
403 // # or #!.*[\n\r] 403 // # or #!.*[\n\r]
404 if (scanOffset == 0) { 404 if (scanOffset == 0) {
405 if (identical(peek(), $BANG)) { 405 if (identical(peek(), $BANG)) {
406 int start = scanOffset + 1; 406 int start = scanOffset;
407 bool asciiOnly = true; 407 bool asciiOnly = true;
408 do { 408 do {
409 next = advance(); 409 next = advance();
410 if (next > 127) asciiOnly = false; 410 if (next > 127) asciiOnly = false;
411 } while (!identical(next, $LF) && 411 } while (!identical(next, $LF) &&
412 !identical(next, $CR) && 412 !identical(next, $CR) &&
413 !identical(next, $EOF)); 413 !identical(next, $EOF));
414 if (!asciiOnly) handleUnicode(start); 414 if (!asciiOnly) handleUnicode(start);
415 appendSubstringToken(SCRIPT_INFO, start, asciiOnly);
415 return next; 416 return next;
416 } 417 }
417 } 418 }
418 appendPrecedenceToken(HASH_INFO); 419 appendPrecedenceToken(HASH_INFO);
419 return advance(); 420 return advance();
420 } 421 }
421 422
422 int tokenizeTilde(int next) { 423 int tokenizeTilde(int next) {
423 // ~ ~/ ~/= 424 // ~ ~/ ~/=
424 next = advance(); 425 next = advance();
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 switchToUint32(newLength); 1245 switchToUint32(newLength);
1245 } 1246 }
1246 } 1247 }
1247 1248
1248 void switchToUint32(int newLength) { 1249 void switchToUint32(int newLength) {
1249 final newArray = new Uint32List(newLength); 1250 final newArray = new Uint32List(newLength);
1250 newArray.setRange(0, arrayLength, array); 1251 newArray.setRange(0, arrayLength, array);
1251 array = newArray; 1252 array = newArray;
1252 } 1253 }
1253 } 1254 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/parser.dart ('k') | pkg/front_end/lib/src/fasta/scanner/precedence.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698