Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: runtime/vm/parser.h

Issue 507233002: Fix conditionally parsing await as keyword. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix typo Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #ifndef VM_PARSER_H_ 5 #ifndef VM_PARSER_H_
6 #define VM_PARSER_H_ 6 #define VM_PARSER_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 9
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 CompilerStats::num_tokens_consumed++; 335 CompilerStats::num_tokens_consumed++;
336 } 336 }
337 void ConsumeRightAngleBracket(); 337 void ConsumeRightAngleBracket();
338 void CheckToken(Token::Kind token_expected, const char* msg = NULL); 338 void CheckToken(Token::Kind token_expected, const char* msg = NULL);
339 void ExpectToken(Token::Kind token_expected); 339 void ExpectToken(Token::Kind token_expected);
340 void ExpectSemicolon(); 340 void ExpectSemicolon();
341 void UnexpectedToken(); 341 void UnexpectedToken();
342 String* ExpectUserDefinedTypeIdentifier(const char* msg); 342 String* ExpectUserDefinedTypeIdentifier(const char* msg);
343 String* ExpectIdentifier(const char* msg); 343 String* ExpectIdentifier(const char* msg);
344 bool IsLiteral(const char* literal); 344 bool IsLiteral(const char* literal);
345 bool IsAwaitAsKeyword();
345 346
346 void SkipIf(Token::Kind); 347 void SkipIf(Token::Kind);
347 void SkipBlock(); 348 void SkipBlock();
348 intptr_t SkipMetadata(); 349 intptr_t SkipMetadata();
349 void SkipToMatchingParenthesis(); 350 void SkipToMatchingParenthesis();
350 void SkipTypeArguments(); 351 void SkipTypeArguments();
351 void SkipType(bool allow_void); 352 void SkipType(bool allow_void);
352 void SkipInitializers(); 353 void SkipInitializers();
353 void SkipExpr(); 354 void SkipExpr();
354 void SkipNestedExpr(); 355 void SkipNestedExpr();
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 Script& script_; 767 Script& script_;
767 TokenStream::Iterator tokens_iterator_; 768 TokenStream::Iterator tokens_iterator_;
768 Token::Kind token_kind_; // Cached token kind for current token. 769 Token::Kind token_kind_; // Cached token kind for current token.
769 Block* current_block_; 770 Block* current_block_;
770 771
771 // is_top_level_ is true if parsing the "top level" of a compilation unit, 772 // is_top_level_ is true if parsing the "top level" of a compilation unit,
772 // that is class definitions, function type aliases, global functions, 773 // that is class definitions, function type aliases, global functions,
773 // global variables. 774 // global variables.
774 bool is_top_level_; 775 bool is_top_level_;
775 776
777 // await_is_keyword_ is true if we are parsing an async function. In this
778 // context async is not treated as identifier but as a keyword.
779 bool await_is_keyword_;
780
776 // The member currently being parsed during "top level" parsing. 781 // The member currently being parsed during "top level" parsing.
777 MemberDesc* current_member_; 782 MemberDesc* current_member_;
778 783
779 // Parser mode to allow/disallow function literals. This is used in 784 // Parser mode to allow/disallow function literals. This is used in
780 // constructor initializer expressions to handle ambiguous grammar. 785 // constructor initializer expressions to handle ambiguous grammar.
781 bool SetAllowFunctionLiterals(bool value); 786 bool SetAllowFunctionLiterals(bool value);
782 bool allow_function_literals_; 787 bool allow_function_literals_;
783 788
784 // The function currently being compiled. 789 // The function currently being compiled.
785 ParsedFunction* parsed_function_; 790 ParsedFunction* parsed_function_;
(...skipping 25 matching lines...) Expand all
811 int16_t last_used_try_index_; 816 int16_t last_used_try_index_;
812 817
813 bool unregister_pending_function_; 818 bool unregister_pending_function_;
814 819
815 DISALLOW_COPY_AND_ASSIGN(Parser); 820 DISALLOW_COPY_AND_ASSIGN(Parser);
816 }; 821 };
817 822
818 } // namespace dart 823 } // namespace dart
819 824
820 #endif // VM_PARSER_H_ 825 #endif // VM_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698