Add '.' and '-' to restricted characters

This means that commands cannot start with these characters.
However, we get the following benefits:
* Negative numbers               > -10
* Ranges with negative numbers   > -10..-1
* Left-unbounded ranges          > ..10
This commit is contained in:
Jakub Žádník
2021-09-05 20:33:53 +03:00
parent 7ae4ca88b6
commit 56c8987e0f
2 changed files with 32 additions and 2 deletions

View File

@ -2103,7 +2103,7 @@ pub fn parse_expression(
match bytes[0] {
b'0' | b'1' | b'2' | b'3' | b'4' | b'5' | b'6' | b'7' | b'8' | b'9' | b'(' | b'{'
| b'[' | b'$' | b'"' | b'\'' => parse_math_expression(working_set, spans),
| b'[' | b'$' | b'"' | b'\'' | b'.' | b'-' => parse_math_expression(working_set, spans),
_ => parse_call(working_set, spans, true),
}
}