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

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

Issue 2711453002: Implement shell-style comments and record shebangs as comments. (Closed)
Patch Set: Remove shell-style comment support. Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
diff --git a/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart b/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
index c621efde27fd4a0dd770fd9c7780f3b9ee5d3eba..c49b5fb8d4b4f1dcf926041ec07aa2d9c14220c9 100644
--- a/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
+++ b/pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart
@@ -37,6 +37,7 @@ import 'token_constants.dart';
import 'characters.dart';
abstract class AbstractScanner implements Scanner {
+ /// If true, include comments in the token stream.
final bool includeComments;
/**
@@ -408,20 +409,9 @@ abstract class AbstractScanner implements Scanner {
}
int tokenizeTag(int next) {
- // # or #!.*[\n\r]
- if (scanOffset == 0) {
- if (identical(peek(), $BANG)) {
- int start = scanOffset + 1;
- bool asciiOnly = true;
- do {
- next = advance();
- if (next > 127) asciiOnly = false;
- } while (!identical(next, $LF) &&
- !identical(next, $CR) &&
- !identical(next, $EOF));
- if (!asciiOnly) handleUnicode(start);
- return next;
- }
+ // #!.*[\n\r]
+ if (scanOffset == 0 && identical(peek(), $BANG)) {
+ tokenizeSingleLineComment(next, scanOffset);
}
appendPrecedenceToken(HASH_INFO);
return advance();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698