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

Unified Diff: dart/site/try/src/interaction_manager.dart

Issue 257613003: Update Try Dart to new scanner behavior. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/site/try/src/editor.dart ('k') | dart/tests/try/paste_content_rewriting_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/site/try/src/interaction_manager.dart
diff --git a/dart/site/try/src/interaction_manager.dart b/dart/site/try/src/interaction_manager.dart
index 88986cc35024fe143562b74fc9f58fb2f86cf8c1..a59cf4e43cfb495f0b56d09764cef63247e15366 100644
--- a/dart/site/try/src/interaction_manager.dart
+++ b/dart/site/try/src/interaction_manager.dart
@@ -16,9 +16,10 @@ import 'dart:math' show
import 'dart:async' show
Future;
-import 'package:compiler/implementation/scanner/scannerlib.dart'
- show
+import 'package:compiler/implementation/scanner/scannerlib.dart' show
+ BeginGroupToken,
EOF_TOKEN,
+ ErrorToken,
StringScanner,
Token;
@@ -685,6 +686,15 @@ void tokenizeAndHighlight(String currentText,
if (charOffset < offset) continue; // Happens for scanner errors.
Decoration decoration = editor.getDecoration(token);
+
+ Token follow = token.next;
+ if (token is BeginGroupToken) {
+ follow = token.endGroup.next;
+ }
+ if (follow is ErrorToken) {
+ decoration = editor.getDecoration(follow);
+ }
+
if (decoration == null) continue;
// Add a node for text before current token.
« no previous file with comments | « dart/site/try/src/editor.dart ('k') | dart/tests/try/paste_content_rewriting_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698