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

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

Issue 106843002: Detect illegal assignable expressions (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 static void ErrorMsg(const Error& error); 311 static void ErrorMsg(const Error& error);
312 312
313 // Concatenates two error messages, the previous and the current one. 313 // Concatenates two error messages, the previous and the current one.
314 void AppendErrorMsg( 314 void AppendErrorMsg(
315 const Error& prev_error, intptr_t token_pos, const char* format, ...) 315 const Error& prev_error, intptr_t token_pos, const char* format, ...)
316 PRINTF_ATTRIBUTE(4, 5); 316 PRINTF_ATTRIBUTE(4, 5);
317 317
318 void CheckRecursiveInvocation(); 318 void CheckRecursiveInvocation();
319 319
320 const Instance& EvaluateConstExpr(intptr_t expr_pos, AstNode* expr); 320 const Instance& EvaluateConstExpr(intptr_t expr_pos, AstNode* expr);
321 AstNode* RunStaticFieldInitializer(const Field& field); 321 AstNode* RunStaticFieldInitializer(const Field& field,
322 intptr_t field_ref_pos);
322 RawObject* EvaluateConstConstructorCall( 323 RawObject* EvaluateConstConstructorCall(
323 const Class& type_class, 324 const Class& type_class,
324 const AbstractTypeArguments& type_arguments, 325 const AbstractTypeArguments& type_arguments,
325 const Function& constructor, 326 const Function& constructor,
326 ArgumentListNode* arguments); 327 ArgumentListNode* arguments);
327 AstNode* FoldConstExpr(intptr_t expr_pos, AstNode* expr); 328 AstNode* FoldConstExpr(intptr_t expr_pos, AstNode* expr);
328 329
329 // Support for parsing of scripts. 330 // Support for parsing of scripts.
330 void ParseTopLevel(); 331 void ParseTopLevel();
331 void ParseClassDeclaration(const GrowableObjectArray& pending_classes, 332 void ParseClassDeclaration(const GrowableObjectArray& pending_classes,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 const String& function_name, 415 const String& function_name,
415 const ArgumentListNode& function_args, 416 const ArgumentListNode& function_args,
416 const LocalVariable* temp, 417 const LocalVariable* temp,
417 bool is_super_invocation); 418 bool is_super_invocation);
418 RawFunction* GetSuperFunction(intptr_t token_pos, 419 RawFunction* GetSuperFunction(intptr_t token_pos,
419 const String& name, 420 const String& name,
420 ArgumentListNode* arguments, 421 ArgumentListNode* arguments,
421 bool resolve_getter, 422 bool resolve_getter,
422 bool* is_no_such_method); 423 bool* is_no_such_method);
423 AstNode* ParseSuperCall(const String& function_name); 424 AstNode* ParseSuperCall(const String& function_name);
424 AstNode* ParseSuperFieldAccess(const String& field_name); 425 AstNode* ParseSuperFieldAccess(const String& field_name, intptr_t field_pos);
425 AstNode* ParseSuperOperator(); 426 AstNode* ParseSuperOperator();
426 AstNode* BuildUnarySuperOperator(Token::Kind op, PrimaryNode* super); 427 AstNode* BuildUnarySuperOperator(Token::Kind op, PrimaryNode* super);
427 428
428 static void SetupDefaultsForOptionalParams(const ParamList* params, 429 static void SetupDefaultsForOptionalParams(const ParamList* params,
429 Array& default_values); 430 Array& default_values);
430 AstNode* CreateImplicitClosureNode(const Function& func, 431 AstNode* CreateImplicitClosureNode(const Function& func,
431 intptr_t token_pos, 432 intptr_t token_pos,
432 AstNode* receiver); 433 AstNode* receiver);
433 static void AddFormalParamsToFunction(const ParamList* params, 434 static void AddFormalParamsToFunction(const ParamList* params,
434 const Function& func); 435 const Function& func);
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 const String& function_name, 633 const String& function_name,
633 ArgumentListNode* function_arguments, 634 ArgumentListNode* function_arguments,
634 InvocationMirror::Call call, 635 InvocationMirror::Call call,
635 InvocationMirror::Type type, 636 InvocationMirror::Type type,
636 Function* func); 637 Function* func);
637 638
638 void CheckOperatorArity(const MemberDesc& member); 639 void CheckOperatorArity(const MemberDesc& member);
639 640
640 void EnsureExpressionTemp(); 641 void EnsureExpressionTemp();
641 void EnsureSavedCurrentContext(); 642 void EnsureSavedCurrentContext();
643 bool IsLegalAssignableSyntax(AstNode* expr, intptr_t end_pos);
642 AstNode* CreateAssignmentNode(AstNode* original, 644 AstNode* CreateAssignmentNode(AstNode* original,
643 AstNode* rhs, 645 AstNode* rhs,
644 const String* left_ident, 646 const String* left_ident,
645 intptr_t left_pos); 647 intptr_t left_pos);
646 AstNode* InsertClosureCallNodes(AstNode* condition); 648 AstNode* InsertClosureCallNodes(AstNode* condition);
647 649
648 ConstructorCallNode* CreateConstructorCallNode( 650 ConstructorCallNode* CreateConstructorCallNode(
649 intptr_t token_pos, 651 intptr_t token_pos,
650 const AbstractTypeArguments& type_arguments, 652 const AbstractTypeArguments& type_arguments,
651 const Function& constructor, 653 const Function& constructor,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 intptr_t last_used_try_index_; 713 intptr_t last_used_try_index_;
712 714
713 bool unregister_pending_function_; 715 bool unregister_pending_function_;
714 716
715 DISALLOW_COPY_AND_ASSIGN(Parser); 717 DISALLOW_COPY_AND_ASSIGN(Parser);
716 }; 718 };
717 719
718 } // namespace dart 720 } // namespace dart
719 721
720 #endif // VM_PARSER_H_ 722 #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