OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // If neither is set, it's no particular type, and both set isn't | 117 // If neither is set, it's no particular type, and both set isn't |
118 // use yet. | 118 // use yet. |
119 // Bit 2 is used to mark the expression as being parenthesized, | 119 // Bit 2 is used to mark the expression as being parenthesized, |
120 // so "(foo)" isn't recognized as a pure identifier (and possible label). | 120 // so "(foo)" isn't recognized as a pure identifier (and possible label). |
121 class Expression { | 121 class Expression { |
122 public: | 122 public: |
123 static Expression Default() { | 123 static Expression Default() { |
124 return Expression(kUnknownExpression); | 124 return Expression(kUnknownExpression); |
125 } | 125 } |
126 | 126 |
127 static Expression Identifier(Identifier id) { | 127 static Expression FromIdentifier(Identifier id) { |
128 return Expression(kIdentifierFlag | (id.type_ << kIdentifierShift)); | 128 return Expression(kIdentifierFlag | (id.type_ << kIdentifierShift)); |
129 } | 129 } |
130 | 130 |
131 static Expression StringLiteral() { | 131 static Expression StringLiteral() { |
132 return Expression(kUnknownStringLiteral); | 132 return Expression(kUnknownStringLiteral); |
133 } | 133 } |
134 | 134 |
135 static Expression UseStrictStringLiteral() { | 135 static Expression UseStrictStringLiteral() { |
136 return Expression(kUseStrictString); | 136 return Expression(kUseStrictString); |
137 } | 137 } |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 uintptr_t stack_limit_; | 475 uintptr_t stack_limit_; |
476 i::Scanner::Location strict_mode_violation_location_; | 476 i::Scanner::Location strict_mode_violation_location_; |
477 const char* strict_mode_violation_type_; | 477 const char* strict_mode_violation_type_; |
478 bool stack_overflow_; | 478 bool stack_overflow_; |
479 bool allow_lazy_; | 479 bool allow_lazy_; |
480 bool parenthesized_function_; | 480 bool parenthesized_function_; |
481 }; | 481 }; |
482 } } // v8::preparser | 482 } } // v8::preparser |
483 | 483 |
484 #endif // V8_PREPARSER_H | 484 #endif // V8_PREPARSER_H |
OLD | NEW |