diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2014-01-13 02:24:11 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2014-01-13 02:24:11 -0800 |
commit | 95f87cdd56602fe7c2746519f875741c325d2df8 (patch) | |
tree | de2756889e04deac7c62a3eefaa7c86c3f713147 /parser.cpp | |
parent | 746cc4c10b40cff7d0c88eac2448864506d8098b (diff) |
Support for special && and || error messages in new parser
Diffstat (limited to 'parser.cpp')
-rw-r--r-- | parser.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -78,15 +78,8 @@ The fish parser. Contains functions for parsing and evaluating code. */ #define BLOCK_END_ERR_MSG _( L"Could not locate end of block. The 'end' command is missing, misspelled or a ';' is missing.") -/** - Error message when a non-string token is found when expecting a command name -*/ -#define CMD_OR_ERR_MSG _( L"Expected a command name, got token of type '%ls'. Did you mean 'COMMAND; or COMMAND'? See the help section for the 'or' builtin command by typing 'help or'.") - -/** - Error message when a non-string token is found when expecting a command name -*/ -#define CMD_AND_ERR_MSG _( L"Expected a command name, got token of type '%ls'. Did you mean 'COMMAND; and COMMAND'? See the help section for the 'and' builtin command by typing 'help and'.") +/** Error message when a non-string token is found when expecting a command name */ +#define CMD_ERR_MSG _( L"Expected a command name, got token of type '%ls'") /** Error message when encountering an illegal command name @@ -1692,8 +1685,7 @@ int parser_t::parse_job(process_t *p, job_t *j, tokenizer_t *tok) { error(SYNTAX_ERROR, tok_get_pos(tok), - CMD_OR_ERR_MSG, - tok_get_desc(tok_last_type(tok))); + CMD_OR_ERR_MSG); } else { @@ -2530,8 +2522,7 @@ void parser_t::eval_job(tokenizer_t *tok) { error(SYNTAX_ERROR, tok_get_pos(tok), - CMD_AND_ERR_MSG, - tok_get_desc(tok_last_type(tok))); + CMD_AND_ERR_MSG); } else { |