| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 if (reinterpret_cast<uintptr_t>(&marker) < stack_limit_) { | 236 if (reinterpret_cast<uintptr_t>(&marker) < stack_limit_) { |
| 237 // Further calls to peek/Next will return illegal token. | 237 // Further calls to peek/Next will return illegal token. |
| 238 // The current one will still be returned. It might already | 238 // The current one will still be returned. It might already |
| 239 // have been seen using peek. | 239 // have been seen using peek. |
| 240 stack_overflow_ = true; | 240 stack_overflow_ = true; |
| 241 } | 241 } |
| 242 } | 242 } |
| 243 return scanner_->Next(); | 243 return scanner_->Next(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 bool peek_any_identifier(); |
| 247 |
| 246 void Consume(i::Token::Value token) { Next(); } | 248 void Consume(i::Token::Value token) { Next(); } |
| 247 | 249 |
| 248 void Expect(i::Token::Value token, bool* ok) { | 250 void Expect(i::Token::Value token, bool* ok) { |
| 249 if (Next() != token) { | 251 if (Next() != token) { |
| 250 *ok = false; | 252 *ok = false; |
| 251 } | 253 } |
| 252 } | 254 } |
| 253 | 255 |
| 254 bool Check(i::Token::Value token) { | 256 bool Check(i::Token::Value token) { |
| 255 i::Token::Value next = peek(); | 257 i::Token::Value next = peek(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 267 i::ParserRecorder* log_; | 269 i::ParserRecorder* log_; |
| 268 Scope* scope_; | 270 Scope* scope_; |
| 269 uintptr_t stack_limit_; | 271 uintptr_t stack_limit_; |
| 270 bool stack_overflow_; | 272 bool stack_overflow_; |
| 271 bool allow_lazy_; | 273 bool allow_lazy_; |
| 272 bool parenthesized_function_; | 274 bool parenthesized_function_; |
| 273 }; | 275 }; |
| 274 } } // v8::preparser | 276 } } // v8::preparser |
| 275 | 277 |
| 276 #endif // V8_PREPARSER_H | 278 #endif // V8_PREPARSER_H |
| OLD | NEW |