Chromium Code Reviews| 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_kw, false, | |
|
zra
2016/01/12 05:29:39
I'll have to hardcode this flag into the Mojo sour
hausner
2016/01/12 17:49:51
Done that for you, even though I had to break up t
zra
2016/01/12 17:54:22
Thanks =)
| |
| 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_kw || await_is_keyword_) && IsSymbol(Symbols::Await()); |
| 10184 } | 10186 } |
| 10185 | 10187 |
| 10186 | 10188 |
| 10187 bool Parser::IsYieldKeyword() { | 10189 bool Parser::IsYieldKeyword() { |
| 10188 return await_is_keyword_ && IsSymbol(Symbols::YieldKw()); | 10190 return (FLAG_await_is_kw ||await_is_keyword_) && IsSymbol(Symbols::YieldKw()); |
|
Ivan Posva
2016/01/12 06:14:32
Missing space.
hausner
2016/01/12 17:49:51
Done.
| |
| 10189 } | 10191 } |
| 10190 | 10192 |
| 10191 | 10193 |
| 10192 static bool IsIncrementOperator(Token::Kind token) { | 10194 static bool IsIncrementOperator(Token::Kind token) { |
| 10193 return token == Token::kINCR || token == Token::kDECR; | 10195 return token == Token::kINCR || token == Token::kDECR; |
| 10194 } | 10196 } |
| 10195 | 10197 |
| 10196 | 10198 |
| 10197 static bool IsPrefixOperator(Token::Kind token) { | 10199 static bool IsPrefixOperator(Token::Kind token) { |
| 10198 return (token == Token::kSUB) || | 10200 return (token == Token::kSUB) || |
| (...skipping 4186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14385 const ArgumentListNode& function_args, | 14387 const ArgumentListNode& function_args, |
| 14386 const LocalVariable* temp_for_last_arg, | 14388 const LocalVariable* temp_for_last_arg, |
| 14387 bool is_super_invocation) { | 14389 bool is_super_invocation) { |
| 14388 UNREACHABLE(); | 14390 UNREACHABLE(); |
| 14389 return NULL; | 14391 return NULL; |
| 14390 } | 14392 } |
| 14391 | 14393 |
| 14392 } // namespace dart | 14394 } // namespace dart |
| 14393 | 14395 |
| 14394 #endif // DART_PRECOMPILED | 14396 #endif // DART_PRECOMPILED |
| OLD | NEW |