@@ -9,20 +9,19 @@ import 'token.dart';
99/// A regular expression matching both whitespace and single-line comments.
1010///
1111/// This will only match if consumes at least one character.
12- final _whitespaceAndSingleLineComments =
13- new RegExp (r"([ \t\n]+|//[^\n]*(\n|$))+" );
12+ final _whitespaceAndSingleLineComments = RegExp (r"([ \t\n]+|//[^\n]*(\n|$))+" );
1413
1514/// A regular expression matching the body of a multi-line comment, after `/*`
1615/// but before `*/` or a nested `/*` .
1716///
1817/// This will only match if it consumes at least one character.
19- final _multiLineCommentBody = new RegExp (r"([^/*]|/[^*]|\*[^/])+" );
18+ final _multiLineCommentBody = RegExp (r"([^/*]|/[^*]|\*[^/])+" );
2019
2120/// A regular expression matching a hyphenated identifier.
2221///
2322/// This is like a standard Dart identifier, except that it can also contain
2423/// hyphens.
25- final _hyphenatedIdentifier = new RegExp (r"[a-zA-Z_-][a-zA-Z0-9_-]*" );
24+ final _hyphenatedIdentifier = RegExp (r"[a-zA-Z_-][a-zA-Z0-9_-]*" );
2625
2726/// A scanner that converts a boolean selector string into a stream of tokens.
2827class Scanner {
@@ -35,7 +34,7 @@ class Scanner {
3534 /// Whether the scanner has emitted a [TokenType.endOfFile] token.
3635 bool _endOfFileEmitted = false ;
3736
38- Scanner (String selector) : _scanner = new SpanScanner (selector);
37+ Scanner (String selector) : _scanner = SpanScanner (selector);
3938
4039 /// Returns the next token that will be returned by [next] .
4140 ///
@@ -70,11 +69,11 @@ class Scanner {
7069
7170 /// Scan and return the next token in the stream.
7271 Token _getNext () {
73- if (_endOfFileEmitted) throw new StateError ("No more tokens." );
72+ if (_endOfFileEmitted) throw StateError ("No more tokens." );
7473
7574 _consumeWhitespace ();
7675 if (_scanner.isDone) {
77- return new Token (TokenType .endOfFile, _scanner.spanFrom (_scanner.state));
76+ return Token (TokenType .endOfFile, _scanner.spanFrom (_scanner.state));
7877 }
7978
8079 switch (_scanner.peekChar ()) {
@@ -104,7 +103,7 @@ class Scanner {
104103 Token _scanOperator (TokenType type) {
105104 var start = _scanner.state;
106105 _scanner.readChar ();
107- return new Token (type, _scanner.spanFrom (start));
106+ return Token (type, _scanner.spanFrom (start));
108107 }
109108
110109 /// Scans a `||` operator and returns the appropriate token.
@@ -113,7 +112,7 @@ class Scanner {
113112 Token _scanOr () {
114113 var start = _scanner.state;
115114 _scanner.expect ("||" );
116- return new Token (TokenType .or, _scanner.spanFrom (start));
115+ return Token (TokenType .or, _scanner.spanFrom (start));
117116 }
118117
119118 /// Scans a `&&` operator and returns the appropriate token.
@@ -122,13 +121,13 @@ class Scanner {
122121 Token _scanAnd () {
123122 var start = _scanner.state;
124123 _scanner.expect ("&&" );
125- return new Token (TokenType .and, _scanner.spanFrom (start));
124+ return Token (TokenType .and, _scanner.spanFrom (start));
126125 }
127126
128127 /// Scans and returns an identifier token.
129128 Token _scanIdentifier () {
130129 _scanner.expect (_hyphenatedIdentifier, name: "expression" );
131- return new IdentifierToken (_scanner.lastMatch[0 ], _scanner.lastSpan);
130+ return IdentifierToken (_scanner.lastMatch[0 ], _scanner.lastSpan);
132131 }
133132
134133 /// Consumes all whitespace and comments immediately following the cursor's
0 commit comments