| Index: pkg/analyzer/test/generated/parser_test.dart
|
| diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
|
| index 2b716bf29e7e75408f8efe6b77d2fbc979fad812..593892623ca06f2cb7509cc94450c71508a2fb9a 100644
|
| --- a/pkg/analyzer/test/generated/parser_test.dart
|
| +++ b/pkg/analyzer/test/generated/parser_test.dart
|
| @@ -1941,6 +1941,70 @@ class Foo {
|
| "int x; ; int y;", [ParserErrorCode.UNEXPECTED_TOKEN]);
|
| }
|
|
|
| + void test_unterminatedString_at_eof() {
|
| + // Although the "unterminated string" error message is produced by the
|
| + // scanner, we need to verify that the parser can handle the tokens
|
| + // produced by the scanner when an unterminated string is encountered.
|
| + ParserTestCase.parseCompilationUnit(r'''
|
| +void main() {
|
| + var x = "''', [
|
| + ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
|
| + ParserErrorCode.EXPECTED_TOKEN,
|
| + ParserErrorCode.EXPECTED_TOKEN
|
| + ]);
|
| + }
|
| +
|
| + void test_unterminatedString_at_eol() {
|
| + // Although the "unterminated string" error message is produced by the
|
| + // scanner, we need to verify that the parser can handle the tokens
|
| + // produced by the scanner when an unterminated string is encountered.
|
| + ParserTestCase.parseCompilationUnit(r'''
|
| +void main() {
|
| + var x = "
|
| +;
|
| +}
|
| +''', [ScannerErrorCode.UNTERMINATED_STRING_LITERAL]);
|
| + }
|
| +
|
| + void test_unterminatedString_multiline_at_eof_3_quotes() {
|
| + // Although the "unterminated string" error message is produced by the
|
| + // scanner, we need to verify that the parser can handle the tokens
|
| + // produced by the scanner when an unterminated string is encountered.
|
| + ParserTestCase.parseCompilationUnit(r'''
|
| +void main() {
|
| + var x = """''', [
|
| + ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
|
| + ParserErrorCode.EXPECTED_TOKEN,
|
| + ParserErrorCode.EXPECTED_TOKEN
|
| + ]);
|
| + }
|
| +
|
| + void test_unterminatedString_multiline_at_eof_4_quotes() {
|
| + // Although the "unterminated string" error message is produced by the
|
| + // scanner, we need to verify that the parser can handle the tokens
|
| + // produced by the scanner when an unterminated string is encountered.
|
| + ParserTestCase.parseCompilationUnit(r'''
|
| +void main() {
|
| + var x = """"''', [
|
| + ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
|
| + ParserErrorCode.EXPECTED_TOKEN,
|
| + ParserErrorCode.EXPECTED_TOKEN
|
| + ]);
|
| + }
|
| +
|
| + void test_unterminatedString_multiline_at_eof_5_quotes() {
|
| + // Although the "unterminated string" error message is produced by the
|
| + // scanner, we need to verify that the parser can handle the tokens
|
| + // produced by the scanner when an unterminated string is encountered.
|
| + ParserTestCase.parseCompilationUnit(r'''
|
| +void main() {
|
| + var x = """""''', [
|
| + ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
|
| + ParserErrorCode.EXPECTED_TOKEN,
|
| + ParserErrorCode.EXPECTED_TOKEN
|
| + ]);
|
| + }
|
| +
|
| void test_useOfUnaryPlusOperator() {
|
| SimpleIdentifier expression = parse4(
|
| "parseUnaryExpression", "+x", [ParserErrorCode.MISSING_IDENTIFIER]);
|
|
|