Substitute and parseCommand: The now recognise variables and deal with them as needed
This commit is contained in:
parent
8a5e6c3cea
commit
d502efaeb1
|
@ -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 = ""
|
||||
|
|
Loading…
Reference in New Issue