shell/arithm: implement assignments

The parser still chokes on assignments with an operation.
shell/arithm: strip mrsh_ prefix for static functions

The mrsh_ prefix is reserved for exported, public functions.
shell: make mrsh_run_arithm_expr take a mrsh_state

This function needs access to the shell's state to assign to variables.
builtins: implement return
mrsh_state: move loop control into call frame
mrsh_state: rename args field to frame
unspecified builtins: add missing newline
frontend/readline: fix undefined rl_replace_line with editline

editline doesn't define rl_replace_line. I haven't found a good way to make
SIGINT handling work with editline, let's just disable it for now.

Fixes: 763feb2ee5dd ("readline: reset on SIGINT")
readline: reset on SIGINT
builtin/export: expand tildes in value

Fixes the following:

export PATH=~/bin:$PATH
5fd9b005 — Martin Kühl 3 months ago
configure: Only add -I CFLAGS from readline (#116)

Adding the readline CFLAGS to our own can define undesired symbols,
like for _GNU_SOURCE and _XOPEN_SOURCE.
We take extra precautions to remove _GNU_SOURCE
but a stray _XOPEN_SOURCE can break our build due to redefined symbols.

This change modifies the pkgconfig invocation
to only add the -I CFLAGS of the readline package,
which don't include symbol definitions
and spares us the trouble of having to remove them.

Closes: https://github.com/emersion/mrsh/issues/115
Change fprintf(stderr, …, strerror(errno)) to perror
shell/job: fix setpgid failed if session leader

The process group ID of a session leader cannot change.
Print warning when failing to enable job control
shell/task: perform pathname expansion on for loop words

Closes: https://github.com/emersion/mrsh/issues/83
builtin/set: implement set -o to print all options
shell/task: simplify case clause matching
shell/task: fix case not handling quoted strings

Executing a case with a quoted string in a pattern resulted in:

    mrsh: ../ast.c:343: mrsh_word_get_string: Assertion `word->type == MRSH_WORD_STRING' failed.
Partially implement arithmetic expansion

The only expansion missing is assignment expansion, which requires more
discussion.

Additionally, the parser is missing variable support, e.g. $((var+1)).
test/loop: print exit in loop test description
Next