Skip to content

Commit 5c83d86

Browse files
srawlinscommit-bot@chromium.org
authored andcommitted
Delete 3 classes from analyzer's deprecated parser
Change-Id: I8aec6064215969023d23a871e10c1aa22fdc2f7a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213848 Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]>
1 parent c260f25 commit 5c83d86

File tree

1 file changed

+0
-90
lines changed

1 file changed

+0
-90
lines changed

pkg/analyzer/lib/src/generated/parser.dart

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -13,101 +13,11 @@ import 'package:analyzer/error/listener.dart';
1313
import 'package:analyzer/src/dart/ast/ast.dart';
1414
import 'package:analyzer/src/dart/ast/token.dart';
1515
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
16-
import 'package:analyzer/src/dart/scanner/scanner.dart';
1716
import 'package:analyzer/src/fasta/ast_builder.dart';
1817
import 'package:analyzer/src/generated/source.dart';
1918

2019
export 'package:analyzer/src/dart/error/syntactic_errors.dart';
2120

22-
/// A simple data-holder for a method that needs to return multiple values.
23-
class CommentAndMetadata {
24-
/// The documentation comment that was parsed, or `null` if none was given.
25-
final Comment? comment;
26-
27-
/// The metadata that was parsed, or `null` if none was given.
28-
final List<Annotation>? metadata;
29-
30-
/// Initialize a newly created holder with the given [comment] and [metadata].
31-
CommentAndMetadata(this.comment, this.metadata);
32-
33-
/// Return `true` if some metadata was parsed.
34-
bool get hasMetadata => metadata != null && metadata!.isNotEmpty;
35-
}
36-
37-
/// A simple data-holder for a method that needs to return multiple values.
38-
class FinalConstVarOrType {
39-
/// The 'final', 'const' or 'var' keyword, or `null` if none was given.
40-
final Token keyword;
41-
42-
/// The type, or `null` if no type was specified.
43-
final TypeAnnotation type;
44-
45-
/// Initialize a newly created holder with the given [keyword] and [type].
46-
FinalConstVarOrType(this.keyword, this.type);
47-
}
48-
49-
/// A simple data-holder for a method that needs to return multiple values.
50-
class Modifiers {
51-
/// The token representing the keyword 'abstract', or `null` if the keyword
52-
/// was not found.
53-
Token? abstractKeyword;
54-
55-
/// The token representing the keyword 'const', or `null` if the keyword was
56-
/// not found.
57-
Token? constKeyword;
58-
59-
/// The token representing the keyword 'covariant', or `null` if the keyword
60-
/// was not found.
61-
Token? covariantKeyword;
62-
63-
/// The token representing the keyword 'external', or `null` if the keyword
64-
/// was not found.
65-
Token? externalKeyword;
66-
67-
/// The token representing the keyword 'factory', or `null` if the keyword was
68-
/// not found.
69-
Token? factoryKeyword;
70-
71-
/// The token representing the keyword 'final', or `null` if the keyword was
72-
/// not found.
73-
Token? finalKeyword;
74-
75-
/// The token representing the keyword 'static', or `null` if the keyword was
76-
/// not found.
77-
Token? staticKeyword;
78-
79-
/// The token representing the keyword 'var', or `null` if the keyword was not
80-
/// found.
81-
Token? varKeyword;
82-
83-
@override
84-
String toString() {
85-
StringBuffer buffer = StringBuffer();
86-
bool needsSpace = _appendKeyword(buffer, false, abstractKeyword);
87-
needsSpace = _appendKeyword(buffer, needsSpace, constKeyword);
88-
needsSpace = _appendKeyword(buffer, needsSpace, externalKeyword);
89-
needsSpace = _appendKeyword(buffer, needsSpace, factoryKeyword);
90-
needsSpace = _appendKeyword(buffer, needsSpace, finalKeyword);
91-
needsSpace = _appendKeyword(buffer, needsSpace, staticKeyword);
92-
_appendKeyword(buffer, needsSpace, varKeyword);
93-
return buffer.toString();
94-
}
95-
96-
/// If the given [keyword] is not `null`, append it to the given [buffer],
97-
/// prefixing it with a space if [needsSpace] is `true`. Return `true` if
98-
/// subsequent keywords need to be prefixed with a space.
99-
bool _appendKeyword(StringBuffer buffer, bool needsSpace, Token? keyword) {
100-
if (keyword != null) {
101-
if (needsSpace) {
102-
buffer.writeCharCode(0x20);
103-
}
104-
buffer.write(keyword.lexeme);
105-
return true;
106-
}
107-
return needsSpace;
108-
}
109-
}
110-
11121
/// A parser used to parse tokens into an AST structure.
11222
class Parser {
11323
late Token currentToken;

0 commit comments

Comments
 (0)