Add environment variable access with $NAME syntax

Lexes $NAME as TK_ENVVAR, compiles reads as __getenv("NAME") calls
and writes ($NAME = expr) as __setenv("NAME", expr) calls. Runtime
functions wrap getenv/setenv/unsetenv with automatic tostring coercion.
This commit is contained in:
Cormac Shannon
2026-02-28 18:08:09 +00:00
parent a773398cab
commit 882a90be48
4 changed files with 94 additions and 17 deletions

3
llex.h
View File

@@ -41,7 +41,8 @@ enum RESERVED {
TK_DBCOLON, TK_EOS,
TK_FLT, TK_INT, TK_NAME, TK_STRING,
TK_COMMAND,
TK_COMMAND_INTERP
TK_COMMAND_INTERP,
TK_ENVVAR
};
/* number of reserved words */