Unify command tokens: remove TK_COMMAND_INTERP and TK_INTERACTIVE_INTERP

Use cmd_mode (already on LexState) to signal whether interpolation
follows, instead of separate *_INTERP token variants. This eliminates
duplicate simple/interpolated code paths in the parser — commandexp()
and interactivestat() now each use a single unified loop that checks
cmd_mode != 0. A shared parseinterp() helper handles each ${expr}
interpolation cycle.
This commit is contained in:
Cormac Shannon
2026-03-12 23:01:31 +00:00
parent f09a033160
commit 5135b16375
3 changed files with 80 additions and 160 deletions

4
llex.h
View File

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