diff --git a/doc_src/doc.hdr b/doc_src/doc.hdr index e1ef257ce..3a2d29d09 100644 --- a/doc_src/doc.hdr +++ b/doc_src/doc.hdr @@ -990,8 +990,6 @@ g++, javac, java, gcj, lpr, doxygen, whois, find) - Check keybinding commands for output - if non has happened, don't repaint to reduce flicker - The jobs builtin should be able to give information on a specific job, such as the pids of the processes in the job - Syntax highlighting should mark cd to non-existing directories as an error -- the code for printing the prompt should know about the most common escape sequences -- redo the jobs command - wait shellscript \subsection todo-possible Possible features diff --git a/parser.c b/parser.c index 001d5caa1..b7c870122 100644 --- a/parser.c +++ b/parser.c @@ -103,6 +103,21 @@ The fish parser. Contains functions for parsing code. */ #define WILDCARD_ERR_MSG L"Warning: No match for wildcard %ls" +/** + Error when using case builtin outside of switch block +*/ +#define INVALID_CASE_ERR_MSG L"'case' builtin not inside of switch block" + +/** + Error when using loop control builtins (break or continue) outside of loop +*/ +#define INVALID_LOOP_ERR_MSG L"Loop control command while not inside of loop" + +/** + Error when using else builtin outside of if block +*/ +#define INVALID_ELSE_ERR_MSG L"'else' builtin not inside of if block" + /** Error message for Posix-style assignment */ @@ -2288,7 +2303,7 @@ int parser_test( wchar_t * buff, { error( SYNTAX_ERROR, tok_get_pos( &tok ), - L"'case' builtin not inside of switch block" ); + INVALID_CASE_ERR_MSG ); print_errors(); } @@ -2321,7 +2336,7 @@ int parser_test( wchar_t * buff, { error( SYNTAX_ERROR, tok_get_pos( &tok ), - L"Loop control command while not inside of loop" ); + INVALID_LOOP_ERR_MSG ); print_errors(); } } @@ -2339,7 +2354,8 @@ int parser_test( wchar_t * buff, { error( SYNTAX_ERROR, tok_get_pos( &tok ), - L"'else' builtin not inside of if block" ); + INVALID_ELSE_ERR_MSG ); + print_errors(); } }