mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-30 07:01:22 -03:00
math: Print special error for logical operators
Until now, something like `math '7 = 2'` would complain about a "missing" operator. Now we print an error about logical operators not being supported and point the user towards `test`. Fixes #6096
This commit is contained in:
@@ -306,6 +306,15 @@ void next_token(state *s) {
|
||||
case '\n':
|
||||
case '\r':
|
||||
break;
|
||||
case '=':
|
||||
case '>':
|
||||
case '<':
|
||||
case '&':
|
||||
case '|':
|
||||
case '!':
|
||||
s->type = TOK_ERROR;
|
||||
s->error = TE_ERROR_LOGICAL_OPERATOR;
|
||||
break;
|
||||
default:
|
||||
s->type = TOK_ERROR;
|
||||
s->error = TE_ERROR_MISSING_OPERATOR;
|
||||
|
||||
Reference in New Issue
Block a user