Commit dd495008 authored by tfarina's avatar tfarina Committed by Commit bot

tools/gn: Give a better informative message if user uses apostrophe.

Since most most gn users come from gyp and that apostrophe
works as a string delimiter in both gyp and python, it is pretty common
that they use an apostrophe (') instead of a double one (").

So lets try to give them a more helpful error message that could save people
some time the first time.

BUG=469097
TEST=edit any BUILD.gn and change any " by '. regenerate the ninja files
by running gn gen out-gn. See the error message.
R=brettw@chromium.org

Review URL: https://codereview.chromium.org/1024333002

Cr-Commit-Position: refs/heads/master@{#321813}
parent 2bb0feb0
......@@ -388,6 +388,8 @@ Err Tokenizer::GetErrorForInvalidToken(const Location& location) const {
(input_[cur_ + 1] == '/' || input_[cur_ + 1] == '*')) {
// Different types of comments.
help = "Comments should start with # instead";
} else if (cur_char() == '\'') {
help = "Strings are delimited by \" characters, not apostrophes.";
} else {
help = "I have no idea what this is.";
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment