Fix mismatched parenthesis error message

'file:xxxx.dart': error: line 2 pos 4: unterminated '('
foo(state { // <= missing closing parenthesis
   ^

Also include a couple of postscripts from previous change.

BUG=5830
R=iposva@google.com

Review URL: https://codereview.chromium.org/1504313003 .
This commit is contained in:
Matthias Hausner 2015-12-08 15:36:10 -08:00
parent b05ae45575
commit d68a7de36a
2 changed files with 4 additions and 4 deletions

View file

@ -9370,9 +9370,7 @@ void Library::RemovePatchClass(const Class& cls) const {
// Library::LoadedScripts() can find it without having to iterate
// over the members of each class.
ASSERT(i < num_classes); // We must have found a class.
Class& pc = Class::Handle();
pc ^= patch_classes.At(i);
const Script& patch_script = Script::Handle(pc.script());
const Script& patch_script = Script::Handle(cls.script());
patch_classes.SetAt(i, patch_script);
}
@ -9816,7 +9814,7 @@ RawArray* Library::LoadedScripts() const {
owner_script = Class::Cast(entry).script();
} else {
ASSERT(entry.IsScript());
owner_script ^= Script::Cast(entry).raw();
owner_script = Script::Cast(entry).raw();
}
AddScriptIfUnique(scripts, owner_script);
}

View file

@ -1707,6 +1707,8 @@ void Parser::SkipToMatching() {
is_match = opening_token == Token::kLBRACK;
break;
case Token::kEOS:
opening_token = token_stack.RemoveLast();
opening_pos = token_pos_stack.RemoveLast();
unexpected_token_found = true;
break;
default: