From d502efaeb10edc095692fe50bffdca1376a24308 Mon Sep 17 00:00:00 2001 From: Sekulum Forka Date: Tue, 11 May 2021 18:38:32 +0200 Subject: [PATCH] Substitute and parseCommand: The now recognise variables and deal with them as needed --- src/fsh.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fsh.nim b/src/fsh.nim index 6e20213..a1f5bd1 100644 --- a/src/fsh.nim +++ b/src/fsh.nim @@ -158,6 +158,7 @@ proc substitute(strm: Stream, delim=";\p"): string = stderr.write("Extra closing bracket") of '\\': result.add(strm.readChar()) + of '$': result.add(strm.readVariable.evalVariable) else: result.add(c) @@ -177,6 +178,7 @@ proc parseCommand(cmd: string): seq[string] = newitem.add(strm.readInterpelation.eval) of '"': newitem.add(strm.readSubstitution.newStringStream.substitute) + of '$': result.add(strm.readVariable.evalVariable) of ' ': result.add(newitem) newitem = ""