fix error messages on bash 'function'
This commit is contained in:
parent
86a4d4a118
commit
064c37b4ee
2 changed files with 3 additions and 2 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#define ARG_END " \t\n;#()&|<>"
|
||||
#define VARNAME_END " \t\n;#()&|=\"'\\{}/-+"
|
||||
#define BLOCK_TOKEN_END " \t\n;#()&|=\"'\\"
|
||||
#define BASH_BLOCK_END " \t\n;#()&|=\"'\\{}"
|
||||
#define COMMAND_SEPARATOR "\n;"
|
||||
#define CONTROL_END "#)"
|
||||
#define PIPELINE_END "\n;#()&"
|
||||
|
|
|
|||
|
|
@ -1849,10 +1849,10 @@ std::pair<block*, parse_context> parse_block(parse_context ctx)
|
|||
newct.has_errored=true;
|
||||
}
|
||||
newct.i = skip_unread(newct);
|
||||
auto wp2=get_word(newct, VARNAME_END);
|
||||
auto wp2=get_word(newct, BASH_BLOCK_END);
|
||||
if(!valid_name(wp2.first))
|
||||
{
|
||||
parse_error( strf("Bad function name: '%s'", word.c_str()), newct );
|
||||
parse_error( strf("Bad function name: '%s'", wp2.first.c_str()), newct );
|
||||
}
|
||||
|
||||
newct.i = wp2.second;
|
||||
|
|
|
|||
Loading…
Reference in a new issue