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

Unified Diff: dart/frog/leg/scanner/scanner.dart

Issue 9146011: Nested comments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/frog/leg/lib/core.dart ('k') | dart/tests/language/language-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/scanner/scanner.dart
diff --git a/dart/frog/leg/scanner/scanner.dart b/dart/frog/leg/scanner/scanner.dart
index e0e85d72c60dbecca39fd878a91f6de5c1459501..bfce2342cb9597ab318b32124ef838c973f29a26 100644
--- a/dart/frog/leg/scanner/scanner.dart
+++ b/dart/frog/leg/scanner/scanner.dart
@@ -518,16 +518,27 @@ class AbstractScanner<T> implements Scanner {
}
int tokenizeMultiLineComment(int next) {
+ int nesting = 1;
next = advance();
while (true) {
if ($EOF === next) {
+ // TODO(ahe): Report error.
return next;
} else if ($STAR === next) {
next = advance();
- if (next === $SLASH) {
- return advance();
- } else if (next === $EOF) {
- return next;
+ if ($SLASH === next) {
+ --nesting;
+ if (0 === nesting) {
+ return advance();
+ } else {
+ next = advance();
+ }
+ }
+ } else if ($SLASH === next) {
+ next = advance();
+ if ($STAR === next) {
+ next = advance();
+ ++nesting;
}
} else {
next = advance();
« no previous file with comments | « dart/frog/leg/lib/core.dart ('k') | dart/tests/language/language-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698