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

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

Issue 8968021: One small step towards sanity (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years 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/token.h » ('j') | tests/language/src/PseudoKWTest.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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"
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 // of function. Parse the formal parameters, initializers and code. 1525 // of function. Parse the formal parameters, initializers and code.
1526 SequenceNode* Parser::ParseConstructor(const Function& func, 1526 SequenceNode* Parser::ParseConstructor(const Function& func,
1527 Array& default_parameter_values) { 1527 Array& default_parameter_values) {
1528 ASSERT(func.IsConstructor()); 1528 ASSERT(func.IsConstructor());
1529 ASSERT(!func.IsFactory()); 1529 ASSERT(!func.IsFactory());
1530 ASSERT(!func.is_static()); 1530 ASSERT(!func.is_static());
1531 ASSERT(!func.IsLocalFunction()); 1531 ASSERT(!func.IsLocalFunction());
1532 const Class& cls = Class::Handle(func.owner()); 1532 const Class& cls = Class::Handle(func.owner());
1533 ASSERT(!cls.IsNull()); 1533 ASSERT(!cls.IsNull());
1534 1534
1535 if (IsLiteral("class")) { 1535 if (CurrentToken() == Token::kCLASS) {
1536 // Special case: implicit constructor. 1536 // Special case: implicit constructor.
1537 // The parser adds an implicit default constructor when a class 1537 // The parser adds an implicit default constructor when a class
1538 // does not have any explicit constructor or factory (see 1538 // does not have any explicit constructor or factory (see
1539 // Parser::CheckConstructors). The token position of this implicit 1539 // Parser::CheckConstructors). The token position of this implicit
1540 // constructor points to the 'class' keyword, which is followed 1540 // constructor points to the 'class' keyword, which is followed
1541 // by the name of the class (which is also the constructor name). 1541 // by the name of the class (which is also the constructor name).
1542 // There is no source text to parse. We just build the 1542 // There is no source text to parse. We just build the
1543 // sequence node by hand. 1543 // sequence node by hand.
1544 return MakeImplicitConstructor(func); 1544 return MakeImplicitConstructor(func);
1545 } 1545 }
(...skipping 6139 matching lines...) Expand 10 before | Expand all | Expand 10 after
7685 } 7685 }
7686 7686
7687 7687
7688 void Parser::SkipNestedExpr() { 7688 void Parser::SkipNestedExpr() {
7689 const bool saved_mode = SetAllowFunctionLiterals(true); 7689 const bool saved_mode = SetAllowFunctionLiterals(true);
7690 SkipExpr(); 7690 SkipExpr();
7691 SetAllowFunctionLiterals(saved_mode); 7691 SetAllowFunctionLiterals(saved_mode);
7692 } 7692 }
7693 7693
7694 } // namespace dart 7694 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/token.h » ('j') | tests/language/src/PseudoKWTest.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698