| Index: runtime/vm/parser.h
|
| diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
|
| index 1be0f50598e4b60b05903ef2030e691d5a0a61bb..edc8fdfd01d88936f8e608bcffc5d97cf73729b1 100644
|
| --- a/runtime/vm/parser.h
|
| +++ b/runtime/vm/parser.h
|
| @@ -294,6 +294,7 @@ class Parser : public ValueObject {
|
| }
|
|
|
| intptr_t TokenPos() const { return tokens_iterator_.CurrentPosition(); }
|
| + intptr_t PrevTokenPos() const { return prev_token_pos_; }
|
|
|
| Token::Kind CurrentToken() {
|
| if (token_kind_ == Token::kILLEGAL) {
|
| @@ -316,6 +317,7 @@ class Parser : public ValueObject {
|
|
|
| void ConsumeToken() {
|
| // Reset cache and advance the token.
|
| + prev_token_pos_ = tokens_iterator_.CurrentPosition();
|
| token_kind_ = Token::kILLEGAL;
|
| tokens_iterator_.Advance();
|
| INC_STAT(thread(), num_tokens_consumed, 1);
|
| @@ -374,6 +376,8 @@ class Parser : public ValueObject {
|
| // Report error message at location of current token in current script.
|
| void ReportError(const char* msg, ...) const PRINTF_ATTRIBUTE(2, 3);
|
|
|
| + void ReportErrorBefore(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
|
| +
|
| // Report error message at given location in current script.
|
| void ReportError(intptr_t token_pos,
|
| const char* msg, ...) const PRINTF_ATTRIBUTE(3, 4);
|
| @@ -533,7 +537,7 @@ class Parser : public ValueObject {
|
| void AddFormalParamsToScope(const ParamList* params, LocalScope* scope);
|
|
|
| SequenceNode* ParseConstructor(const Function& func);
|
| - SequenceNode* ParseFunc(const Function& func);
|
| + SequenceNode* ParseFunc(const Function& func, bool check_semicolon);
|
|
|
| void ParseNativeFunctionBlock(const ParamList* params, const Function& func);
|
|
|
| @@ -833,6 +837,7 @@ class Parser : public ValueObject {
|
| Script& script_;
|
| TokenStream::Iterator tokens_iterator_;
|
| Token::Kind token_kind_; // Cached token kind for current token.
|
| + intptr_t prev_token_pos_;
|
| Block* current_block_;
|
|
|
| // is_top_level_ is true if parsing the "top level" of a compilation unit,
|
|
|