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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 } | 880 } |
881 | 881 |
882 // Parses a single function literal, from the opening parentheses before | 882 // Parses a single function literal, from the opening parentheses before |
883 // parameters to the closing brace after the body. | 883 // parameters to the closing brace after the body. |
884 // Returns a FunctionEntry describing the body of the function in enough | 884 // Returns a FunctionEntry describing the body of the function in enough |
885 // detail that it can be lazily compiled. | 885 // detail that it can be lazily compiled. |
886 // The scanner is expected to have matched the "function" or "function*" | 886 // The scanner is expected to have matched the "function" or "function*" |
887 // keyword and parameters, and have consumed the initial '{'. | 887 // keyword and parameters, and have consumed the initial '{'. |
888 // At return, unless an error occurred, the scanner is positioned before the | 888 // At return, unless an error occurred, the scanner is positioned before the |
889 // the final '}'. | 889 // the final '}'. |
890 PreParseResult PreParseLazyFunction(DeclarationScope* function_scope, | 890 PreParseResult PreParseFunction(DeclarationScope* function_scope, |
891 bool parsing_module, SingletonLogger* log, | 891 bool parsing_module, SingletonLogger* log, |
892 bool track_unresolved_variables, | 892 bool track_unresolved_variables, |
893 bool may_abort, int* use_counts); | 893 bool may_abort, int* use_counts); |
894 | 894 |
895 private: | 895 private: |
896 // These types form an algebra over syntactic categories that is just | 896 // These types form an algebra over syntactic categories that is just |
897 // rich enough to let us recognize and propagate the constructs that | 897 // rich enough to let us recognize and propagate the constructs that |
898 // are either being counted in the preparser data, or is important | 898 // are either being counted in the preparser data, or is important |
899 // to throw the correct syntax error exceptions. | 899 // to throw the correct syntax error exceptions. |
900 | 900 |
901 // All ParseXXX functions take as the last argument an *ok parameter | 901 // All ParseXXX functions take as the last argument an *ok parameter |
902 // which is set to false if parsing failed; it is unchanged otherwise. | 902 // which is set to false if parsing failed; it is unchanged otherwise. |
903 // By making the 'exception handling' explicit, we are forced to check | 903 // By making the 'exception handling' explicit, we are forced to check |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1540 function_state_->NextMaterializedLiteralIndex(); | 1540 function_state_->NextMaterializedLiteralIndex(); |
1541 function_state_->NextMaterializedLiteralIndex(); | 1541 function_state_->NextMaterializedLiteralIndex(); |
1542 } | 1542 } |
1543 return EmptyExpression(); | 1543 return EmptyExpression(); |
1544 } | 1544 } |
1545 | 1545 |
1546 } // namespace internal | 1546 } // namespace internal |
1547 } // namespace v8 | 1547 } // namespace v8 |
1548 | 1548 |
1549 #endif // V8_PARSING_PREPARSER_H | 1549 #endif // V8_PARSING_PREPARSER_H |
OLD | NEW |