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

Unified Diff: pkg/analyzer/lib/src/generated/scanner.dart

Issue 107833002: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/generated/source.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/scanner.dart
diff --git a/pkg/analyzer/lib/src/generated/scanner.dart b/pkg/analyzer/lib/src/generated/scanner.dart
index 413cf3b789bd9b1d3da66fd2f9b5ebd8886980d2..88ff4b045dd2d6dd75f9f3912d84f76c6ba8595b 100644
--- a/pkg/analyzer/lib/src/generated/scanner.dart
+++ b/pkg/analyzer/lib/src/generated/scanner.dart
@@ -728,6 +728,11 @@ class Scanner {
AnalysisErrorListener _errorListener;
/**
+ * The flag specifying if documentation comments should be parsed.
+ */
+ bool _preserveComments = true;
+
+ /**
* The token pointing to the head of the linked list of tokens.
*/
Token _tokens;
@@ -806,6 +811,15 @@ class Scanner {
bool hasUnmatchedGroups() => _hasUnmatchedGroups2;
/**
+ * Set whether documentation tokens should be scanned.
+ *
+ * @param preserveComments `true` if documentation tokens should be scanned
+ */
+ void set preserveComments(bool preserveComments) {
+ this._preserveComments = preserveComments;
+ }
+
+ /**
* Record that the source begins on the given line and column at the current offset as given by
* the reader. The line starts for lines before the given line will not be correct.
*
@@ -1030,6 +1044,9 @@ class Scanner {
}
void appendCommentToken(TokenType type, String value) {
+ if (!_preserveComments) {
+ return;
+ }
if (_firstComment == null) {
_firstComment = new StringToken(type, value, _tokenStart);
_lastComment = _firstComment;
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/generated/source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698