| OLD | NEW |
| 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 #include "vm/parser.h" | 5 #include "vm/parser.h" |
| 6 #include "vm/flags.h" | 6 #include "vm/flags.h" |
| 7 | 7 |
| 8 #ifndef DART_PRECOMPILED | 8 #ifndef DART_PRECOMPILED |
| 9 | 9 |
| 10 #include "lib/invocation_mirror.h" | 10 #include "lib/invocation_mirror.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 "Disable to make importing dart:mirrors an error."); | 45 "Disable to make importing dart:mirrors an error."); |
| 46 DEFINE_FLAG(bool, load_deferred_eagerly, false, | 46 DEFINE_FLAG(bool, load_deferred_eagerly, false, |
| 47 "Load deferred libraries eagerly."); | 47 "Load deferred libraries eagerly."); |
| 48 DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations."); | 48 DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations."); |
| 49 DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef."); | 49 DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef."); |
| 50 DEFINE_FLAG(bool, link_natives_lazily, false, "Link native calls lazily"); | 50 DEFINE_FLAG(bool, link_natives_lazily, false, "Link native calls lazily"); |
| 51 DEFINE_FLAG(bool, conditional_directives, false, | 51 DEFINE_FLAG(bool, conditional_directives, false, |
| 52 "Enable conditional directives"); | 52 "Enable conditional directives"); |
| 53 DEFINE_FLAG(bool, warn_super, false, | 53 DEFINE_FLAG(bool, warn_super, false, |
| 54 "Warning if super initializer not last in initializer list."); | 54 "Warning if super initializer not last in initializer list."); |
| 55 DEFINE_FLAG(bool, await_is_keyword, false, |
| 56 "await and yield are treated as proper keywords in synchronous code."); |
| 55 | 57 |
| 56 DECLARE_FLAG(bool, lazy_dispatchers); | 58 DECLARE_FLAG(bool, lazy_dispatchers); |
| 57 DECLARE_FLAG(bool, load_deferred_eagerly); | 59 DECLARE_FLAG(bool, load_deferred_eagerly); |
| 58 DECLARE_FLAG(bool, profile_vm); | 60 DECLARE_FLAG(bool, profile_vm); |
| 59 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); | 61 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); |
| 60 DECLARE_FLAG(bool, warn_on_javascript_compatibility); | 62 DECLARE_FLAG(bool, warn_on_javascript_compatibility); |
| 61 | 63 |
| 62 // Quick access to the current thread, isolate and zone. | 64 // Quick access to the current thread, isolate and zone. |
| 63 #define T (thread()) | 65 #define T (thread()) |
| 64 #define I (isolate()) | 66 #define I (isolate()) |
| (...skipping 10108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10173 if (!IsIdentifier()) { | 10175 if (!IsIdentifier()) { |
| 10174 ReportError("%s", msg); | 10176 ReportError("%s", msg); |
| 10175 } | 10177 } |
| 10176 String* ident = CurrentLiteral(); | 10178 String* ident = CurrentLiteral(); |
| 10177 ConsumeToken(); | 10179 ConsumeToken(); |
| 10178 return ident; | 10180 return ident; |
| 10179 } | 10181 } |
| 10180 | 10182 |
| 10181 | 10183 |
| 10182 bool Parser::IsAwaitKeyword() { | 10184 bool Parser::IsAwaitKeyword() { |
| 10183 return await_is_keyword_ && IsSymbol(Symbols::Await()); | 10185 return (FLAG_await_is_keyword || await_is_keyword_) && |
| 10186 IsSymbol(Symbols::Await()); |
| 10184 } | 10187 } |
| 10185 | 10188 |
| 10186 | 10189 |
| 10187 bool Parser::IsYieldKeyword() { | 10190 bool Parser::IsYieldKeyword() { |
| 10188 return await_is_keyword_ && IsSymbol(Symbols::YieldKw()); | 10191 return (FLAG_await_is_keyword || await_is_keyword_) && |
| 10192 IsSymbol(Symbols::YieldKw()); |
| 10189 } | 10193 } |
| 10190 | 10194 |
| 10191 | 10195 |
| 10192 static bool IsIncrementOperator(Token::Kind token) { | 10196 static bool IsIncrementOperator(Token::Kind token) { |
| 10193 return token == Token::kINCR || token == Token::kDECR; | 10197 return token == Token::kINCR || token == Token::kDECR; |
| 10194 } | 10198 } |
| 10195 | 10199 |
| 10196 | 10200 |
| 10197 static bool IsPrefixOperator(Token::Kind token) { | 10201 static bool IsPrefixOperator(Token::Kind token) { |
| 10198 return (token == Token::kSUB) || | 10202 return (token == Token::kSUB) || |
| (...skipping 4187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14386 const ArgumentListNode& function_args, | 14390 const ArgumentListNode& function_args, |
| 14387 const LocalVariable* temp_for_last_arg, | 14391 const LocalVariable* temp_for_last_arg, |
| 14388 bool is_super_invocation) { | 14392 bool is_super_invocation) { |
| 14389 UNREACHABLE(); | 14393 UNREACHABLE(); |
| 14390 return NULL; | 14394 return NULL; |
| 14391 } | 14395 } |
| 14392 | 14396 |
| 14393 } // namespace dart | 14397 } // namespace dart |
| 14394 | 14398 |
| 14395 #endif // DART_PRECOMPILED | 14399 #endif // DART_PRECOMPILED |
| OLD | NEW |