diff options
author | Peter Kuemmel <syntheticpp@gmx.net> | 2012-01-29 13:26:24 (GMT) |
---|---|---|
committer | Peter Kuemmel <syntheticpp@gmx.net> | 2012-01-29 13:26:24 (GMT) |
commit | 2e481086ad7337bb868327f12ffd317dc5143a3e (patch) | |
tree | 970d5c7fb9207ec96beff9d9fdfcf60c60a06e0d /src/lexer.in.cc | |
parent | 88c9491f515f7ba479b5334ef834743fed539730 (diff) | |
download | Ninja-2e481086ad7337bb868327f12ffd317dc5143a3e.zip Ninja-2e481086ad7337bb868327f12ffd317dc5143a3e.tar.gz Ninja-2e481086ad7337bb868327f12ffd317dc5143a3e.tar.bz2 |
parse $:
'$:' is a valid string now, it expands to ':'
update error messages and show a hint when something went wrong.
Diffstat (limited to 'src/lexer.in.cc')
-rw-r--r-- | src/lexer.in.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lexer.in.cc b/src/lexer.in.cc index 9caaa36..28a5bdf 100644 --- a/src/lexer.in.cc +++ b/src/lexer.in.cc @@ -89,6 +89,26 @@ const char* Lexer::TokenName(Token t) { return NULL; // not reached } +const char* Lexer::TokenErrorHint(Token t) { + switch (t) { + case ERROR: return ""; + case BUILD: return ""; + case COLON: return " ($ also escapes ':')"; + case DEFAULT: return ""; + case EQUALS: return ""; + case IDENT: return ""; + case INCLUDE: return ""; + case INDENT: return ""; + case NEWLINE: return ""; + case PIPE2: return ""; + case PIPE: return ""; + case RULE: return ""; + case SUBNINJA: return ""; + case TEOF: return ""; + } + return ""; +} + void Lexer::UnreadToken() { ofs_ = last_token_; } |