OLD | NEW |
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_PARSING_PREPARSER_H | 5 #ifndef V8_PARSING_PREPARSER_H |
6 #define V8_PARSING_PREPARSER_H | 6 #define V8_PARSING_PREPARSER_H |
7 | 7 |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/parsing/parser-base.h" | 9 #include "src/parsing/parser-base.h" |
10 | 10 |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 return false; | 899 return false; |
900 } | 900 } |
901 | 901 |
902 V8_INLINE static PreParserExpression GetPropertyValue( | 902 V8_INLINE static PreParserExpression GetPropertyValue( |
903 PreParserExpression property) { | 903 PreParserExpression property) { |
904 return PreParserExpression::Default(); | 904 return PreParserExpression::Default(); |
905 } | 905 } |
906 | 906 |
907 // Functions for encapsulating the differences between parsing and preparsing; | 907 // Functions for encapsulating the differences between parsing and preparsing; |
908 // operations interleaved with the recursive descent. | 908 // operations interleaved with the recursive descent. |
909 V8_INLINE static void PushLiteralName(FuncNameInferrer* fni, | 909 V8_INLINE static void PushLiteralName(PreParserIdentifier id) {} |
910 PreParserIdentifier id) { | 910 V8_INLINE static void PushVariableName(PreParserIdentifier id) {} |
911 // PreParser should not use FuncNameInferrer. | 911 V8_INLINE void PushPropertyName(PreParserExpression expression) {} |
912 UNREACHABLE(); | 912 V8_INLINE static void InferFunctionName(PreParserExpression expression) {} |
913 } | |
914 | |
915 V8_INLINE static void PushVariableName(FuncNameInferrer* fni, | |
916 PreParserIdentifier id) { | |
917 // PreParser should not use FuncNameInferrer. | |
918 UNREACHABLE(); | |
919 } | |
920 | |
921 V8_INLINE void PushPropertyName(FuncNameInferrer* fni, | |
922 PreParserExpression expression) { | |
923 // PreParser should not use FuncNameInferrer. | |
924 UNREACHABLE(); | |
925 } | |
926 | |
927 V8_INLINE static void InferFunctionName(FuncNameInferrer* fni, | |
928 PreParserExpression expression) { | |
929 // PreParser should not use FuncNameInferrer. | |
930 UNREACHABLE(); | |
931 } | |
932 | 913 |
933 V8_INLINE static void CheckAssigningFunctionLiteralToProperty( | 914 V8_INLINE static void CheckAssigningFunctionLiteralToProperty( |
934 PreParserExpression left, PreParserExpression right) {} | 915 PreParserExpression left, PreParserExpression right) {} |
935 | 916 |
936 V8_INLINE static PreParserExpression MarkExpressionAsAssigned( | 917 V8_INLINE static PreParserExpression MarkExpressionAsAssigned( |
937 PreParserExpression expression) { | 918 PreParserExpression expression) { |
938 // TODO(marja): To be able to produce the same errors, the preparser needs | 919 // TODO(marja): To be able to produce the same errors, the preparser needs |
939 // to start tracking which expressions are variables and which are assigned. | 920 // to start tracking which expressions are variables and which are assigned. |
940 return expression; | 921 return expression; |
941 } | 922 } |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 function_state_->NextMaterializedLiteralIndex(); | 1190 function_state_->NextMaterializedLiteralIndex(); |
1210 function_state_->NextMaterializedLiteralIndex(); | 1191 function_state_->NextMaterializedLiteralIndex(); |
1211 } | 1192 } |
1212 return EmptyExpression(); | 1193 return EmptyExpression(); |
1213 } | 1194 } |
1214 | 1195 |
1215 } // namespace internal | 1196 } // namespace internal |
1216 } // namespace v8 | 1197 } // namespace v8 |
1217 | 1198 |
1218 #endif // V8_PARSING_PREPARSER_H | 1199 #endif // V8_PARSING_PREPARSER_H |
OLD | NEW |