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

Side by Side Diff: src/ast/ast.h

Issue 1841093002: Add optional types to function/method declarations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@types-1817353007-typ-mod
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/parsing/parser.h » ('j') | src/parsing/parser.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_AST_AST_H_ 5 #ifndef V8_AST_AST_H_
6 #define V8_AST_AST_H_ 6 #define V8_AST_AST_H_
7 7
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/ast/ast-value-factory.h" 9 #include "src/ast/ast-value-factory.h"
10 #include "src/ast/modules.h" 10 #include "src/ast/modules.h"
(...skipping 2918 matching lines...) Expand 10 before | Expand all | Expand 10 after
2929 DECLARE_NODE_TYPE(EmptyParentheses) 2929 DECLARE_NODE_TYPE(EmptyParentheses)
2930 2930
2931 private: 2931 private:
2932 EmptyParentheses(Zone* zone, int pos) : Expression(zone, pos) {} 2932 EmptyParentheses(Zone* zone, int pos) : Expression(zone, pos) {}
2933 }; 2933 };
2934 2934
2935 2935
2936 // Nodes for the optional type system. 2936 // Nodes for the optional type system.
2937 namespace typesystem { 2937 namespace typesystem {
2938 2938
2939 enum TypeFlags {
2940 kNormalTypes = 0,
2941 kDisallowTypeParameters = 1 << 0,
2942 kDisallowTypeAnnotation = 1 << 1,
2943 kAllowSignature = 1 << 2,
2944 kConstructorTypes = kDisallowTypeParameters | kDisallowTypeAnnotation
2945 };
2946
2939 class FormalParameter; 2947 class FormalParameter;
2940 2948
2941 2949
2942 // Abstract class for all types. 2950 // Abstract class for all types.
2943 // It also covers: binding identifiers, binding (array and object) patterns 2951 // It also covers: binding identifiers, binding (array and object) patterns
2944 // and formal parameter lists. 2952 // and formal parameter lists.
2945 class Type : public AstNode { 2953 class Type : public AstNode {
2946 public: 2954 public:
2947 // Uncovers the case of a single, parenthesized valid type. 2955 // Uncovers the case of a single, parenthesized valid type.
2948 V8_INLINE Type* Uncover(bool* ok); 2956 V8_INLINE Type* Uncover(bool* ok);
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after
4102 : NULL; \ 4110 : NULL; \
4103 } 4111 }
4104 TYPESYSTEM_NODE_LIST(DECLARE_NODE_FUNCTIONS) 4112 TYPESYSTEM_NODE_LIST(DECLARE_NODE_FUNCTIONS)
4105 #undef DECLARE_NODE_FUNCTIONS 4113 #undef DECLARE_NODE_FUNCTIONS
4106 4114
4107 4115
4108 } // namespace internal 4116 } // namespace internal
4109 } // namespace v8 4117 } // namespace v8
4110 4118
4111 #endif // V8_AST_AST_H_ 4119 #endif // V8_AST_AST_H_
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser.h » ('j') | src/parsing/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698