Make word functions take const params
Don't perform pathname expansion on quoted strings
shell/word: preserve AST in split_fields
Instead of converting fields to strings, keep them as words. This is necessary
for preventing pathname expansion from expanding quoted words.
shell/task/word: handle empty names in parameter_get_value
shell/task/word: add parameter leading hash op
shell/task/word: add parameter plus op
shell/task/word: substitute null in case no word is given
shell/task/word: implement parameter minus operator
test/arithm: reset variable before assignment tests
shell/arithm: implement variables
parser/arithm: parse variables
test/pipeline: disable early close test
This test doesn't work, because variables in arithmetic expressions are not yet
arithm: introduce mrsh_arithm_variable
parser/arithm: fix assignments with operators
We need to peek the assignment variable *and* the assignment operator
(otherwise we have no guarantee it's an assignment).
The previous logic was wrong and assumed "=" was in front of all assignment
shell/arithm: fix assignments with operators
The variable got assigned the rvalue instead of the result of the operation.
parser/arithm: fix addend and factor left-associativity
Instead of calling ourselves recursively, call the inner parser in a loop. This
is described in .
parser/arithm: fix && and ||
"&" and "|" have higher priority, so they were consuming the first character of
"&&" and "||", leaving a trailing "&" or "|".
parser/arithm: fix comparison operators
> and < were recognized before >= and <=. For this reason, >= and <= were never
parsed (since they are prefixes of < and >).
builtin/hash: new utility
This implements a minimal hash(1) utility, without any caching.
builtin/pwd: implement -L and -P
Note that this is mostly a placation, because mrsh manages the PWD
variable and ensures that none of the conditions -P or -L are meant to
address will occur.