coreutils
coreutils copied to clipboard
`expr`: evaluation should happen "during" parsing
With https://github.com/uutils/coreutils/pull/5586 merged, we can there are a few issues leftover. Here's an interesting one:
> expr '(' 1 / 0
expr: division by zero
In uutils expr, this currently gives a syntax error instead. This is because uutils first parses the entire syntax tree and evaluates it afterwards. GNU does not seem to do that. Instead, they immediately evaluate every subtree they parse. This might actually simplify the code a bit, but will be a pretty big refactor.