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

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

Issue 109853003: 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
Index: pkg/analyzer/lib/src/generated/parser.dart
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index dfc40e20c2796da6a5018ecb8a49b8003a8351dc..70ad35c49d1dd93b0fe77a7aea2c3e3b6fd32308 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -24,12 +24,12 @@ class CommentAndMetadata {
/**
* The documentation comment that was parsed, or `null` if none was given.
*/
- Comment comment;
+ final Comment comment;
/**
* The metadata that was parsed.
*/
- List<Annotation> metadata;
+ final List<Annotation> metadata;
/**
* Initialize a newly created holder with the given data.
@@ -37,10 +37,7 @@ class CommentAndMetadata {
* @param comment the documentation comment that was parsed
* @param metadata the metadata that was parsed
*/
- CommentAndMetadata(Comment comment, List<Annotation> metadata) {
- this.comment = comment;
- this.metadata = metadata;
- }
+ CommentAndMetadata(this.comment, this.metadata);
}
/**
@@ -53,12 +50,12 @@ class FinalConstVarOrType {
/**
* The 'final', 'const' or 'var' keyword, or `null` if none was given.
*/
- Token keyword;
+ final Token keyword;
/**
* The type, of `null` if no type was specified.
*/
- TypeName type;
+ final TypeName type;
/**
* Initialize a newly created holder with the given data.
@@ -66,10 +63,7 @@ class FinalConstVarOrType {
* @param keyword the 'final', 'const' or 'var' keyword
* @param type the type
*/
- FinalConstVarOrType(Token keyword, TypeName type) {
- this.keyword = keyword;
- this.type = type;
- }
+ FinalConstVarOrType(this.keyword, this.type);
}
/**
@@ -1148,6 +1142,11 @@ class IncrementalParser {
AnalysisErrorListener _errorListener;
/**
+ * The node in the AST structure that contains the revised content.
+ */
+ ASTNode _updatedNode;
+
+ /**
* Initialize a newly created incremental parser to parse a portion of the content of the given
* source.
*
@@ -1163,6 +1162,13 @@ class IncrementalParser {
}
/**
+ * Return the node in the AST structure that contains the revised content.
+ *
+ * @return the updated node
+ */
+ ASTNode get updatedNode => _updatedNode;
+
+ /**
* Given a range of tokens that were re-scanned, re-parse the minimum number of tokens to produce
* a consistent AST structure. The range is represented by the first and last tokens in the range.
* The tokens are assumed to be contained in the same token stream.
@@ -1221,6 +1227,7 @@ class IncrementalParser {
parser.currentToken = parseToken;
}
}
+ _updatedNode = newNode;
if (identical(oldNode, originalStructure)) {
ResolutionCopier.copyResolutionData(oldNode, newNode);
return newNode as ASTNode;
@@ -1255,10 +1262,7 @@ class IncrementalParser {
while (firstToken.offset > offset && firstToken.type != TokenType.EOF) {
firstToken = firstToken.previous;
}
- if (firstToken.offset == offset) {
- return firstToken;
- }
- return null;
+ return firstToken;
}
}

Powered by Google App Engine
This is Rietveld 408576698