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 | 6 |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/compiler_stats.h" | 10 #include "vm/compiler_stats.h" |
11 #include "vm/dart_api_impl.h" | 11 #include "vm/dart_api_impl.h" |
12 #include "vm/dart_entry.h" | 12 #include "vm/dart_entry.h" |
13 #include "vm/flags.h" | 13 #include "vm/flags.h" |
14 #include "vm/growable_array.h" | 14 #include "vm/growable_array.h" |
15 #include "vm/longjump.h" | 15 #include "vm/longjump.h" |
16 #include "vm/native_entry.h" | 16 #include "vm/native_entry.h" |
17 #include "vm/object.h" | 17 #include "vm/object.h" |
18 #include "vm/object_store.h" | 18 #include "vm/object_store.h" |
19 #include "vm/resolver.h" | 19 #include "vm/resolver.h" |
20 #include "vm/scopes.h" | 20 #include "vm/scopes.h" |
21 | 21 |
22 namespace dart { | 22 namespace dart { |
23 | 23 |
24 DEFINE_FLAG(bool, enable_asserts, false, "Enable assert statements."); | 24 DEFINE_FLAG(bool, enable_asserts, false, "Enable assert statements."); |
25 DEFINE_FLAG(bool, enable_type_checks, false, "Enable type checks."); | 25 DEFINE_FLAG(bool, enable_type_checks, false, "Enable type checks."); |
26 DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations."); | 26 DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations."); |
27 DEFINE_FLAG(bool, warning_as_error, false, "Treat warnings as errors."); | 27 DEFINE_FLAG(bool, warning_as_error, false, "Treat warnings as errors."); |
28 DEFINE_FLAG(bool, silent_warnings, false, "Silence warnings."); | 28 DEFINE_FLAG(bool, silent_warnings, false, "Silence warnings."); |
29 | 29 |
| 30 static void CheckedModeHandler(bool value) { |
| 31 FLAG_enable_asserts = value; |
| 32 FLAG_enable_type_checks = value; |
| 33 } |
| 34 |
| 35 DEFINE_FLAG_HANDLER(CheckedModeHandler, |
| 36 enable_checked_mode, |
| 37 "Enabled checked mode."); |
| 38 |
30 // All references to Dart names are listed here. | 39 // All references to Dart names are listed here. |
31 static const char* kAssertionErrorName = "AssertionError"; | 40 static const char* kAssertionErrorName = "AssertionError"; |
32 static const char* kTypeErrorName = "TypeError"; | 41 static const char* kTypeErrorName = "TypeError"; |
33 static const char* kFallThroughErrorName = "FallThroughError"; | 42 static const char* kFallThroughErrorName = "FallThroughError"; |
34 static const char* kStaticResolutionExceptionName = "StaticResolutionException"; | 43 static const char* kStaticResolutionExceptionName = "StaticResolutionException"; |
35 static const char* kThrowNewName = "_throwNew"; | 44 static const char* kThrowNewName = "_throwNew"; |
36 static const char* kListLiteralFactoryClassName = "_ListLiteralFactory"; | 45 static const char* kListLiteralFactoryClassName = "_ListLiteralFactory"; |
37 static const char* kListLiteralFactoryName = "List.fromLiteral"; | 46 static const char* kListLiteralFactoryName = "List.fromLiteral"; |
38 static const char* kMapLiteralFactoryClassName = "_MapLiteralFactory"; | 47 static const char* kMapLiteralFactoryClassName = "_MapLiteralFactory"; |
39 static const char* kMapLiteralFactoryName = "Map.fromLiteral"; | 48 static const char* kMapLiteralFactoryName = "Map.fromLiteral"; |
(...skipping 8121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8161 void Parser::SkipQualIdent() { | 8170 void Parser::SkipQualIdent() { |
8162 ASSERT(IsIdentifier()); | 8171 ASSERT(IsIdentifier()); |
8163 ConsumeToken(); | 8172 ConsumeToken(); |
8164 if (CurrentToken() == Token::kPERIOD) { | 8173 if (CurrentToken() == Token::kPERIOD) { |
8165 ConsumeToken(); // Consume the kPERIOD token. | 8174 ConsumeToken(); // Consume the kPERIOD token. |
8166 ExpectIdentifier("identifier expected after '.'"); | 8175 ExpectIdentifier("identifier expected after '.'"); |
8167 } | 8176 } |
8168 } | 8177 } |
8169 | 8178 |
8170 } // namespace dart | 8179 } // namespace dart |
OLD | NEW |