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

Unified Diff: runtime/vm/parser.h

Issue 2643523002: Implement generic function type syntax in the VM (fixes #27966). (Closed)
Patch Set: work in progress Created 3 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/parser.h
diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
index 7f11efef97dc4f19d624849e07ab33b0e9a00410..ec2af878549bf442f757436bb58883c5c658494c 100644
--- a/runtime/vm/parser.h
+++ b/runtime/vm/parser.h
@@ -403,6 +403,7 @@ class Parser : public ValueObject {
bool IsPatchAnnotation(TokenPosition pos);
void SkipTypeArguments();
void SkipType(bool allow_void);
+ void SkipTypeOrFunctionType(bool allow_void);
void SkipInitializers();
void SkipExpr();
void SkipNestedExpr();
@@ -513,6 +514,8 @@ class Parser : public ValueObject {
void ParseLibraryImportObsoleteSyntax();
void ParseLibraryIncludeObsoleteSyntax();
+ void ResolveSignature(ClassFinalizer::FinalizationKind finalization,
+ const Function& signature);
void ResolveType(ClassFinalizer::FinalizationKind finalization,
AbstractType* type);
RawAbstractType* ParseType(ClassFinalizer::FinalizationKind finalization,
@@ -522,7 +525,11 @@ class Parser : public ValueObject {
bool allow_deferred_type,
bool consume_unresolved_prefix,
LibraryPrefix* prefix);
-
+ RawType* ParseFunctionType(const AbstractType& result_type,
+ ClassFinalizer::FinalizationKind finalization);
+ RawAbstractType* ParseTypeOrFunctionType(
+ bool allow_void,
+ ClassFinalizer::FinalizationKind finalization);
void ParseTypeParameters(bool parameterizing_class);
RawTypeArguments* ParseTypeArguments(
ClassFinalizer::FinalizationKind finalization);
@@ -531,13 +538,16 @@ class Parser : public ValueObject {
void CheckMemberNameConflict(ClassDesc* members, MemberDesc* member);
void ParseClassMemberDefinition(ClassDesc* members,
TokenPosition metadata_pos);
- void ParseFormalParameter(bool allow_explicit_default_value,
+ void ParseFormalParameter(bool use_function_type_syntax,
+ bool allow_explicit_default_value,
bool evaluate_metadata,
ParamList* params);
- void ParseFormalParameters(bool allow_explicit_default_values,
+ void ParseFormalParameters(bool use_function_type_syntax,
+ bool allow_explicit_default_values,
bool evaluate_metadata,
ParamList* params);
- void ParseFormalParameterList(bool allow_explicit_default_values,
+ void ParseFormalParameterList(bool use_function_type_syntax,
+ bool allow_explicit_default_values,
bool evaluate_metadata,
ParamList* params);
void CheckFieldsInitialized(const Class& cls);
@@ -601,6 +611,7 @@ class Parser : public ValueObject {
ClosureNode* CreateImplicitClosureNode(const Function& func,
TokenPosition token_pos,
AstNode* receiver);
+ void FinalizeFormalParameterTypes(const ParamList* params);
void AddFormalParamsToFunction(const ParamList* params, const Function& func);
void AddFormalParamsToScope(const ParamList* params, LocalScope* scope);
@@ -749,15 +760,15 @@ class Parser : public ValueObject {
bool IsIdentifier();
bool IsSymbol(const String& symbol);
bool IsSimpleLiteral(const AbstractType& type, Instance* value);
- bool IsFunctionTypeAliasName();
+ bool IsFunctionTypeSymbol();
+ bool IsFunctionTypeAliasName(bool* use_function_type_syntax);
bool TryParseQualIdent();
bool TryParseTypeParameters();
bool TryParseTypeArguments();
bool IsTypeParameters();
bool IsArgumentPart();
bool IsParameterPart();
- bool TryParseOptionalType();
- bool TryParseReturnType();
+ bool TryParseType(bool allow_void);
bool IsVariableDeclaration();
bool IsFunctionReturnType();
bool IsFunctionDeclaration();
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/parser.cc » ('j') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698