| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analyzer.test.generated.parser_test; | 5 library analyzer.test.generated.parser_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
| 9 import 'package:analyzer/dart/ast/visitor.dart'; | 9 import 'package:analyzer/dart/ast/visitor.dart'; |
| 10 import 'package:analyzer/src/dart/ast/token.dart'; | 10 import 'package:analyzer/src/dart/ast/token.dart'; |
| (...skipping 6245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6256 parse("parseCommentReference", <Object>["", 5], ""); | 6256 parse("parseCommentReference", <Object>["", 5], ""); |
| 6257 SimpleIdentifier identifier = EngineTestCase.assertInstanceOf( | 6257 SimpleIdentifier identifier = EngineTestCase.assertInstanceOf( |
| 6258 (obj) => obj is SimpleIdentifier, | 6258 (obj) => obj is SimpleIdentifier, |
| 6259 SimpleIdentifier, | 6259 SimpleIdentifier, |
| 6260 reference.identifier); | 6260 reference.identifier); |
| 6261 expect(identifier, isNotNull); | 6261 expect(identifier, isNotNull); |
| 6262 expect(identifier.isSynthetic, isTrue); | 6262 expect(identifier.isSynthetic, isTrue); |
| 6263 expect(identifier.token, isNotNull); | 6263 expect(identifier.token, isNotNull); |
| 6264 expect(identifier.name, ""); | 6264 expect(identifier.name, ""); |
| 6265 expect(identifier.offset, 5); | 6265 expect(identifier.offset, 5); |
| 6266 // Should end with EOF token. |
| 6267 Token nextToken = identifier.token.next; |
| 6268 expect(nextToken, isNotNull); |
| 6269 expect(nextToken.type, TokenType.EOF); |
| 6266 } | 6270 } |
| 6267 | 6271 |
| 6268 void test_parseCommentReferences_multiLine() { | 6272 void test_parseCommentReferences_multiLine() { |
| 6269 DocumentationCommentToken token = new DocumentationCommentToken( | 6273 DocumentationCommentToken token = new DocumentationCommentToken( |
| 6270 TokenType.MULTI_LINE_COMMENT, "/** xxx [a] yyy [bb] zzz */", 3); | 6274 TokenType.MULTI_LINE_COMMENT, "/** xxx [a] yyy [bb] zzz */", 3); |
| 6271 List<DocumentationCommentToken> tokens = <DocumentationCommentToken>[token]; | 6275 List<DocumentationCommentToken> tokens = <DocumentationCommentToken>[token]; |
| 6272 List<CommentReference> references = | 6276 List<CommentReference> references = |
| 6273 parse("parseCommentReferences", <Object>[tokens], "") | 6277 parse("parseCommentReferences", <Object>[tokens], "") |
| 6274 as List<CommentReference>; | 6278 as List<CommentReference>; |
| 6275 List<Token> tokenReferences = token.references; | 6279 List<Token> tokenReferences = token.references; |
| (...skipping 4897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11173 new Scanner(null, new CharSequenceReader(source), listener); | 11177 new Scanner(null, new CharSequenceReader(source), listener); |
| 11174 Token tokenStream = scanner.tokenize(); | 11178 Token tokenStream = scanner.tokenize(); |
| 11175 // | 11179 // |
| 11176 // Parse the source. | 11180 // Parse the source. |
| 11177 // | 11181 // |
| 11178 Parser parser = new Parser(null, listener); | 11182 Parser parser = new Parser(null, listener); |
| 11179 return invokeParserMethodImpl( | 11183 return invokeParserMethodImpl( |
| 11180 parser, methodName, <Object>[tokenStream], tokenStream) as Token; | 11184 parser, methodName, <Object>[tokenStream], tokenStream) as Token; |
| 11181 } | 11185 } |
| 11182 } | 11186 } |
| OLD | NEW |