parse: lex: fix string state not terminating when encountering a dquote
This commit is contained in:
@@ -14,13 +14,10 @@ static enum bshell_status string_symbol(struct lex_ctx *ctx)
|
||||
struct lex_token *tok = NULL;
|
||||
|
||||
switch (sym->id) {
|
||||
case SYM_DOLLAR_LEFT_PAREN:
|
||||
status = push_symbol(ctx, sym->id);
|
||||
if (status != BSHELL_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
|
||||
case SYM_DQUOTE:
|
||||
return BSHELL_SUCCESS;
|
||||
case SYM_DOLLAR_LEFT_PAREN:
|
||||
return push_symbol(ctx, sym->id);
|
||||
case SYM_DOLLAR:
|
||||
status = read_var(ctx, TOK_VAR, &tok);
|
||||
if (status != BSHELL_SUCCESS) {
|
||||
@@ -130,6 +127,7 @@ static const unsigned int symbols[] = {
|
||||
SYM_DOLLAR,
|
||||
SYM_DOLLAR_LEFT_PAREN,
|
||||
SYM_DOLLAR_LEFT_BRACE,
|
||||
SYM_DQUOTE,
|
||||
SYM_NONE,
|
||||
};
|
||||
|
||||
@@ -139,4 +137,5 @@ const struct lex_state_type lex_string_state = {
|
||||
.s_end = string_end,
|
||||
.s_pump_token = string_pump_token,
|
||||
.s_links = links,
|
||||
.s_symbols = symbols,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user