| Index: runtime/vm/scanner.cc
|
| ===================================================================
|
| --- runtime/vm/scanner.cc (revision 1660)
|
| +++ runtime/vm/scanner.cc (working copy)
|
| @@ -313,17 +313,27 @@
|
| }
|
|
|
|
|
| +void Scanner::SkipLine() {
|
| + while (c0_ != '\n' && c0_ != '\0') {
|
| + ReadChar();
|
| + }
|
| +}
|
| +
|
| +
|
| void Scanner::ScanLibraryTag() {
|
| ReadChar();
|
| if (c0_ == '!') {
|
| + Recognize(Token::kSCRIPTTAG);
|
| // The script tag extends to the end of the line. Just treat this
|
| // similar to a line comment.
|
| - while (c0_ != '\n' && c0_ != '\0') {
|
| - ReadChar();
|
| - }
|
| - Recognize(Token::kSCRIPTTAG);
|
| + SkipLine();
|
| return;
|
| }
|
| + if (!IsIdentStartChar(c0_)) {
|
| + ErrorMsg("Unrecognized library tag");
|
| + SkipLine();
|
| + return;
|
| + }
|
| const String& kLibrary = String::Handle(String::NewSymbol("library"));
|
| const String& kImport = String::Handle(String::NewSymbol("import"));
|
| const String& kSource = String::Handle(String::NewSymbol("source"));
|
| @@ -341,6 +351,7 @@
|
| return;
|
| }
|
| ErrorMsg("Unrecognized library token");
|
| + SkipLine();
|
| }
|
|
|
|
|
|
|