Index: pkg/analyzer/test/generated/scanner_test.dart |
diff --git a/pkg/analyzer/test/generated/scanner_test.dart b/pkg/analyzer/test/generated/scanner_test.dart |
index 59321ecab64f3b5258e6e7f080536fe02e72c27e..19e2a0275cb85a97d4c20255a23ad07421f77f4b 100644 |
--- a/pkg/analyzer/test/generated/scanner_test.dart |
+++ b/pkg/analyzer/test/generated/scanner_test.dart |
@@ -172,14 +172,12 @@ class KeywordStateTest { |
class ScannerTest { |
void fail_incomplete_string_interpolation() { |
// https://code.google.com/p/dart/issues/detail?id=18073 |
- _assertErrorAndTokens( |
- ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
- 9, |
- "\"foo \${bar", |
- [ |
- new StringToken(TokenType.STRING, "\"foo ", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 5), |
- new StringToken(TokenType.IDENTIFIER, "bar", 7)]); |
+ _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 9, |
+ "\"foo \${bar", [ |
+ new StringToken(TokenType.STRING, "\"foo ", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 5), |
+ new StringToken(TokenType.IDENTIFIER, "bar", 7) |
+ ]); |
} |
void test_ampersand() { |
@@ -255,8 +253,7 @@ class ScannerTest { |
} |
void test_comment_disabled_multi() { |
- Scanner scanner = new Scanner( |
- null, |
+ Scanner scanner = new Scanner(null, |
new CharSequenceReader("/* comment */ "), |
AnalysisErrorListener.NULL_LISTENER); |
scanner.preserveComments = false; |
@@ -275,8 +272,7 @@ class ScannerTest { |
void test_comment_nested() { |
_assertComment( |
- TokenType.MULTI_LINE_COMMENT, |
- "/* comment /* within a */ comment */"); |
+ TokenType.MULTI_LINE_COMMENT, "/* comment /* within a */ comment */"); |
} |
void test_comment_single() { |
@@ -581,42 +577,38 @@ class ScannerTest { |
void test_lineInfo_multilineComment() { |
String source = "/*\r *\r */"; |
- _assertLineInfo( |
- source, |
- [ |
- new ScannerTest_ExpectedLocation(0, 1, 1), |
- new ScannerTest_ExpectedLocation(4, 2, 2), |
- new ScannerTest_ExpectedLocation(source.length - 1, 3, 3)]); |
+ _assertLineInfo(source, [ |
+ new ScannerTest_ExpectedLocation(0, 1, 1), |
+ new ScannerTest_ExpectedLocation(4, 2, 2), |
+ new ScannerTest_ExpectedLocation(source.length - 1, 3, 3) |
+ ]); |
} |
void test_lineInfo_multilineString() { |
String source = "'''a\r\nbc\r\nd'''"; |
- _assertLineInfo( |
- source, |
- [ |
- new ScannerTest_ExpectedLocation(0, 1, 1), |
- new ScannerTest_ExpectedLocation(7, 2, 2), |
- new ScannerTest_ExpectedLocation(source.length - 1, 3, 4)]); |
+ _assertLineInfo(source, [ |
+ new ScannerTest_ExpectedLocation(0, 1, 1), |
+ new ScannerTest_ExpectedLocation(7, 2, 2), |
+ new ScannerTest_ExpectedLocation(source.length - 1, 3, 4) |
+ ]); |
} |
void test_lineInfo_simpleClass() { |
String source = |
"class Test {\r\n String s = '...';\r\n int get x => s.MISSING_GETTER;\r\n}"; |
- _assertLineInfo( |
- source, |
- [ |
- new ScannerTest_ExpectedLocation(0, 1, 1), |
- new ScannerTest_ExpectedLocation(source.indexOf("MISSING_GETTER"), 3, 20), |
- new ScannerTest_ExpectedLocation(source.length - 1, 4, 1)]); |
+ _assertLineInfo(source, [ |
+ new ScannerTest_ExpectedLocation(0, 1, 1), |
+ new ScannerTest_ExpectedLocation(source.indexOf("MISSING_GETTER"), 3, 20), |
+ new ScannerTest_ExpectedLocation(source.length - 1, 4, 1) |
+ ]); |
} |
void test_lineInfo_slashN() { |
String source = "class Test {\n}"; |
- _assertLineInfo( |
- source, |
- [ |
- new ScannerTest_ExpectedLocation(0, 1, 1), |
- new ScannerTest_ExpectedLocation(source.indexOf("}"), 2, 1)]); |
+ _assertLineInfo(source, [ |
+ new ScannerTest_ExpectedLocation(0, 1, 1), |
+ new ScannerTest_ExpectedLocation(source.indexOf("}"), 2, 1) |
+ ]); |
} |
void test_lt() { |
@@ -676,25 +668,23 @@ class ScannerTest { |
} |
void test_periodAfterNumberNotIncluded_identifier() { |
- _assertTokens( |
- "42.isEven()", |
- [ |
- new StringToken(TokenType.INT, "42", 0), |
- new Token(TokenType.PERIOD, 2), |
- new StringToken(TokenType.IDENTIFIER, "isEven", 3), |
- new Token(TokenType.OPEN_PAREN, 9), |
- new Token(TokenType.CLOSE_PAREN, 10)]); |
+ _assertTokens("42.isEven()", [ |
+ new StringToken(TokenType.INT, "42", 0), |
+ new Token(TokenType.PERIOD, 2), |
+ new StringToken(TokenType.IDENTIFIER, "isEven", 3), |
+ new Token(TokenType.OPEN_PAREN, 9), |
+ new Token(TokenType.CLOSE_PAREN, 10) |
+ ]); |
} |
void test_periodAfterNumberNotIncluded_period() { |
- _assertTokens( |
- "42..isEven()", |
- [ |
- new StringToken(TokenType.INT, "42", 0), |
- new Token(TokenType.PERIOD_PERIOD, 2), |
- new StringToken(TokenType.IDENTIFIER, "isEven", 4), |
- new Token(TokenType.OPEN_PAREN, 10), |
- new Token(TokenType.CLOSE_PAREN, 11)]); |
+ _assertTokens("42..isEven()", [ |
+ new StringToken(TokenType.INT, "42", 0), |
+ new Token(TokenType.PERIOD_PERIOD, 2), |
+ new StringToken(TokenType.IDENTIFIER, "isEven", 4), |
+ new Token(TokenType.OPEN_PAREN, 10), |
+ new Token(TokenType.CLOSE_PAREN, 11) |
+ ]); |
} |
void test_period_period() { |
@@ -789,24 +779,22 @@ class ScannerTest { |
} |
void test_string_multi_interpolation_block() { |
- _assertTokens( |
- "\"Hello \${name}!\"", |
- [ |
- new StringToken(TokenType.STRING, "\"Hello ", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 7), |
- new StringToken(TokenType.IDENTIFIER, "name", 9), |
- new Token(TokenType.CLOSE_CURLY_BRACKET, 13), |
- new StringToken(TokenType.STRING, "!\"", 14)]); |
+ _assertTokens("\"Hello \${name}!\"", [ |
+ new StringToken(TokenType.STRING, "\"Hello ", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 7), |
+ new StringToken(TokenType.IDENTIFIER, "name", 9), |
+ new Token(TokenType.CLOSE_CURLY_BRACKET, 13), |
+ new StringToken(TokenType.STRING, "!\"", 14) |
+ ]); |
} |
void test_string_multi_interpolation_identifier() { |
- _assertTokens( |
- "\"Hello \$name!\"", |
- [ |
- new StringToken(TokenType.STRING, "\"Hello ", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 7), |
- new StringToken(TokenType.IDENTIFIER, "name", 8), |
- new StringToken(TokenType.STRING, "!\"", 12)]); |
+ _assertTokens("\"Hello \$name!\"", [ |
+ new StringToken(TokenType.STRING, "\"Hello ", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 7), |
+ new StringToken(TokenType.IDENTIFIER, "name", 8), |
+ new StringToken(TokenType.STRING, "!\"", 12) |
+ ]); |
} |
void test_string_multi_single() { |
@@ -818,35 +806,28 @@ class ScannerTest { |
} |
void test_string_multi_unterminated() { |
- _assertErrorAndTokens( |
- ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
- 8, |
- "'''string", |
- [new StringToken(TokenType.STRING, "'''string", 0)]); |
+ _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8, |
+ "'''string", [new StringToken(TokenType.STRING, "'''string", 0)]); |
} |
void test_string_multi_unterminated_interpolation_block() { |
- _assertErrorAndTokens( |
- ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
- 8, |
- "'''\${name", |
- [ |
- new StringToken(TokenType.STRING, "'''", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 3), |
- new StringToken(TokenType.IDENTIFIER, "name", 5), |
- new StringToken(TokenType.STRING, "", 9)]); |
+ _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8, |
+ "'''\${name", [ |
+ new StringToken(TokenType.STRING, "'''", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 3), |
+ new StringToken(TokenType.IDENTIFIER, "name", 5), |
+ new StringToken(TokenType.STRING, "", 9) |
+ ]); |
} |
void test_string_multi_unterminated_interpolation_identifier() { |
- _assertErrorAndTokens( |
- ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
- 7, |
- "'''\$name", |
- [ |
- new StringToken(TokenType.STRING, "'''", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3), |
- new StringToken(TokenType.IDENTIFIER, "name", 4), |
- new StringToken(TokenType.STRING, "", 8)]); |
+ _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7, |
+ "'''\$name", [ |
+ new StringToken(TokenType.STRING, "'''", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3), |
+ new StringToken(TokenType.IDENTIFIER, "name", 4), |
+ new StringToken(TokenType.STRING, "", 8) |
+ ]); |
} |
void test_string_raw_multi_double() { |
@@ -859,11 +840,8 @@ class ScannerTest { |
void test_string_raw_multi_unterminated() { |
String source = "r'''string"; |
- _assertErrorAndTokens( |
- ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
- 9, |
- source, |
- [new StringToken(TokenType.STRING, source, 0)]); |
+ _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
+ 9, source, [new StringToken(TokenType.STRING, source, 0)]); |
} |
void test_string_raw_simple_double() { |
@@ -876,20 +854,14 @@ class ScannerTest { |
void test_string_raw_simple_unterminated_eof() { |
String source = "r'string"; |
- _assertErrorAndTokens( |
- ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
- 7, |
- source, |
- [new StringToken(TokenType.STRING, source, 0)]); |
+ _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
+ 7, source, [new StringToken(TokenType.STRING, source, 0)]); |
} |
void test_string_raw_simple_unterminated_eol() { |
String source = "r'string"; |
- _assertErrorAndTokens( |
- ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
- 8, |
- "$source\n", |
- [new StringToken(TokenType.STRING, source, 0)]); |
+ _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
+ 8, "$source\n", [new StringToken(TokenType.STRING, source, 0)]); |
} |
void test_string_simple_double() { |
@@ -901,89 +873,82 @@ class ScannerTest { |
} |
void test_string_simple_interpolation_adjacentIdentifiers() { |
- _assertTokens( |
- "'\$a\$b'", |
- [ |
- new StringToken(TokenType.STRING, "'", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1), |
- new StringToken(TokenType.IDENTIFIER, "a", 2), |
- new StringToken(TokenType.STRING, "", 3), |
- new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3), |
- new StringToken(TokenType.IDENTIFIER, "b", 4), |
- new StringToken(TokenType.STRING, "'", 5)]); |
+ _assertTokens("'\$a\$b'", [ |
+ new StringToken(TokenType.STRING, "'", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1), |
+ new StringToken(TokenType.IDENTIFIER, "a", 2), |
+ new StringToken(TokenType.STRING, "", 3), |
+ new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3), |
+ new StringToken(TokenType.IDENTIFIER, "b", 4), |
+ new StringToken(TokenType.STRING, "'", 5) |
+ ]); |
} |
void test_string_simple_interpolation_block() { |
- _assertTokens( |
- "'Hello \${name}!'", |
- [ |
- new StringToken(TokenType.STRING, "'Hello ", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 7), |
- new StringToken(TokenType.IDENTIFIER, "name", 9), |
- new Token(TokenType.CLOSE_CURLY_BRACKET, 13), |
- new StringToken(TokenType.STRING, "!'", 14)]); |
+ _assertTokens("'Hello \${name}!'", [ |
+ new StringToken(TokenType.STRING, "'Hello ", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 7), |
+ new StringToken(TokenType.IDENTIFIER, "name", 9), |
+ new Token(TokenType.CLOSE_CURLY_BRACKET, 13), |
+ new StringToken(TokenType.STRING, "!'", 14) |
+ ]); |
} |
void test_string_simple_interpolation_blockWithNestedMap() { |
- _assertTokens( |
- "'a \${f({'b' : 'c'})} d'", |
- [ |
- new StringToken(TokenType.STRING, "'a ", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 3), |
- new StringToken(TokenType.IDENTIFIER, "f", 5), |
- new Token(TokenType.OPEN_PAREN, 6), |
- new Token(TokenType.OPEN_CURLY_BRACKET, 7), |
- new StringToken(TokenType.STRING, "'b'", 8), |
- new Token(TokenType.COLON, 12), |
- new StringToken(TokenType.STRING, "'c'", 14), |
- new Token(TokenType.CLOSE_CURLY_BRACKET, 17), |
- new Token(TokenType.CLOSE_PAREN, 18), |
- new Token(TokenType.CLOSE_CURLY_BRACKET, 19), |
- new StringToken(TokenType.STRING, " d'", 20)]); |
+ _assertTokens("'a \${f({'b' : 'c'})} d'", [ |
+ new StringToken(TokenType.STRING, "'a ", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 3), |
+ new StringToken(TokenType.IDENTIFIER, "f", 5), |
+ new Token(TokenType.OPEN_PAREN, 6), |
+ new Token(TokenType.OPEN_CURLY_BRACKET, 7), |
+ new StringToken(TokenType.STRING, "'b'", 8), |
+ new Token(TokenType.COLON, 12), |
+ new StringToken(TokenType.STRING, "'c'", 14), |
+ new Token(TokenType.CLOSE_CURLY_BRACKET, 17), |
+ new Token(TokenType.CLOSE_PAREN, 18), |
+ new Token(TokenType.CLOSE_CURLY_BRACKET, 19), |
+ new StringToken(TokenType.STRING, " d'", 20) |
+ ]); |
} |
void test_string_simple_interpolation_firstAndLast() { |
- _assertTokens( |
- "'\$greeting \$name'", |
- [ |
- new StringToken(TokenType.STRING, "'", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1), |
- new StringToken(TokenType.IDENTIFIER, "greeting", 2), |
- new StringToken(TokenType.STRING, " ", 10), |
- new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 11), |
- new StringToken(TokenType.IDENTIFIER, "name", 12), |
- new StringToken(TokenType.STRING, "'", 16)]); |
+ _assertTokens("'\$greeting \$name'", [ |
+ new StringToken(TokenType.STRING, "'", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1), |
+ new StringToken(TokenType.IDENTIFIER, "greeting", 2), |
+ new StringToken(TokenType.STRING, " ", 10), |
+ new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 11), |
+ new StringToken(TokenType.IDENTIFIER, "name", 12), |
+ new StringToken(TokenType.STRING, "'", 16) |
+ ]); |
} |
void test_string_simple_interpolation_identifier() { |
- _assertTokens( |
- "'Hello \$name!'", |
- [ |
- new StringToken(TokenType.STRING, "'Hello ", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 7), |
- new StringToken(TokenType.IDENTIFIER, "name", 8), |
- new StringToken(TokenType.STRING, "!'", 12)]); |
+ _assertTokens("'Hello \$name!'", [ |
+ new StringToken(TokenType.STRING, "'Hello ", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 7), |
+ new StringToken(TokenType.IDENTIFIER, "name", 8), |
+ new StringToken(TokenType.STRING, "!'", 12) |
+ ]); |
} |
void test_string_simple_interpolation_missingIdentifier() { |
- _assertTokens( |
- "'\$x\$'", |
- [ |
- new StringToken(TokenType.STRING, "'", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1), |
- new StringToken(TokenType.IDENTIFIER, "x", 2), |
- new StringToken(TokenType.STRING, "", 3), |
- new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3), |
- new StringToken(TokenType.STRING, "'", 4)]); |
+ _assertTokens("'\$x\$'", [ |
+ new StringToken(TokenType.STRING, "'", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1), |
+ new StringToken(TokenType.IDENTIFIER, "x", 2), |
+ new StringToken(TokenType.STRING, "", 3), |
+ new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 3), |
+ new StringToken(TokenType.STRING, "'", 4) |
+ ]); |
} |
void test_string_simple_interpolation_nonIdentifier() { |
- _assertTokens( |
- "'\$1'", |
- [ |
- new StringToken(TokenType.STRING, "'", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1), |
- new StringToken(TokenType.STRING, "1'", 2)]); |
+ _assertTokens("'\$1'", [ |
+ new StringToken(TokenType.STRING, "'", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1), |
+ new StringToken(TokenType.STRING, "1'", 2) |
+ ]); |
} |
void test_string_simple_single() { |
@@ -992,44 +957,34 @@ class ScannerTest { |
void test_string_simple_unterminated_eof() { |
String source = "'string"; |
- _assertErrorAndTokens( |
- ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
- 6, |
- source, |
- [new StringToken(TokenType.STRING, source, 0)]); |
+ _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
+ 6, source, [new StringToken(TokenType.STRING, source, 0)]); |
} |
void test_string_simple_unterminated_eol() { |
String source = "'string"; |
- _assertErrorAndTokens( |
- ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
- 7, |
- "$source\r", |
- [new StringToken(TokenType.STRING, source, 0)]); |
+ _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
+ 7, "$source\r", [new StringToken(TokenType.STRING, source, 0)]); |
} |
void test_string_simple_unterminated_interpolation_block() { |
- _assertErrorAndTokens( |
- ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
- 6, |
- "'\${name", |
- [ |
- new StringToken(TokenType.STRING, "'", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 1), |
- new StringToken(TokenType.IDENTIFIER, "name", 3), |
- new StringToken(TokenType.STRING, "", 7)]); |
+ _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 6, |
+ "'\${name", [ |
+ new StringToken(TokenType.STRING, "'", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_EXPRESSION, "\${", 1), |
+ new StringToken(TokenType.IDENTIFIER, "name", 3), |
+ new StringToken(TokenType.STRING, "", 7) |
+ ]); |
} |
void test_string_simple_unterminated_interpolation_identifier() { |
- _assertErrorAndTokens( |
- ScannerErrorCode.UNTERMINATED_STRING_LITERAL, |
- 5, |
- "'\$name", |
- [ |
- new StringToken(TokenType.STRING, "'", 0), |
- new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1), |
- new StringToken(TokenType.IDENTIFIER, "name", 2), |
- new StringToken(TokenType.STRING, "", 6)]); |
+ _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 5, |
+ "'\$name", [ |
+ new StringToken(TokenType.STRING, "'", 0), |
+ new StringToken(TokenType.STRING_INTERPOLATION_IDENTIFIER, "\$", 1), |
+ new StringToken(TokenType.IDENTIFIER, "name", 2), |
+ new StringToken(TokenType.STRING, "", 6) |
+ ]); |
} |
void test_tilde() { |
@@ -1084,18 +1039,15 @@ class ScannerTest { |
* [expectedOffset] the string offset that should be associated with the error |
* [source] the source to be scanned to produce the error |
*/ |
- void _assertError(ScannerErrorCode expectedError, int expectedOffset, |
- String source) { |
+ void _assertError( |
+ ScannerErrorCode expectedError, int expectedOffset, String source) { |
GatheringErrorListener listener = new GatheringErrorListener(); |
_scanWithListener(source, listener); |
- listener.assertErrors( |
- [ |
- new AnalysisError.con2( |
- null, |
- expectedOffset, |
- 1, |
- expectedError, |
- [source.codeUnitAt(expectedOffset)])]); |
+ listener.assertErrors([ |
+ new AnalysisError.con2(null, expectedOffset, 1, expectedError, [ |
+ source.codeUnitAt(expectedOffset) |
+ ]) |
+ ]); |
} |
/** |
@@ -1111,14 +1063,11 @@ class ScannerTest { |
String source, List<Token> expectedTokens) { |
GatheringErrorListener listener = new GatheringErrorListener(); |
Token token = _scanWithListener(source, listener); |
- listener.assertErrors( |
- [ |
- new AnalysisError.con2( |
- null, |
- expectedOffset, |
- 1, |
- expectedError, |
- [source.codeUnitAt(expectedOffset)])]); |
+ listener.assertErrors([ |
+ new AnalysisError.con2(null, expectedOffset, 1, expectedError, [ |
+ source.codeUnitAt(expectedOffset) |
+ ]) |
+ ]); |
_checkTokens(token, expectedTokens); |
} |
@@ -1148,8 +1097,8 @@ class ScannerTest { |
expect(token.next.type, TokenType.EOF); |
} |
- void _assertLineInfo(String source, |
- List<ScannerTest_ExpectedLocation> expectedLocations) { |
+ void _assertLineInfo( |
+ String source, List<ScannerTest_ExpectedLocation> expectedLocations) { |
GatheringErrorListener listener = new GatheringErrorListener(); |
_scanWithListener(source, listener); |
listener.assertNoErrors(); |
@@ -1226,17 +1175,11 @@ class ScannerTest { |
for (int i = 0; i < expectedTokens.length; i++) { |
Token expectedToken = expectedTokens[i]; |
expect(token.type, expectedToken.type, reason: "Wrong type for token $i"); |
- expect( |
- token.offset, |
- expectedToken.offset, |
+ expect(token.offset, expectedToken.offset, |
reason: "Wrong offset for token $i"); |
- expect( |
- token.length, |
- expectedToken.length, |
+ expect(token.length, expectedToken.length, |
reason: "Wrong length for token $i"); |
- expect( |
- token.lexeme, |
- expectedToken.lexeme, |
+ expect(token.lexeme, expectedToken.lexeme, |
reason: "Wrong lexeme for token $i"); |
token = token.next; |
expect(token, isNotNull); |
@@ -1271,8 +1214,8 @@ class ScannerTest_ExpectedLocation { |
final int _columnNumber; |
- ScannerTest_ExpectedLocation(this._offset, this._lineNumber, |
- this._columnNumber); |
+ ScannerTest_ExpectedLocation( |
+ this._offset, this._lineNumber, this._columnNumber); |
} |
/** |