diff options
Diffstat (limited to 'main/parse.go')
-rw-r--r-- | main/parse.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/main/parse.go b/main/parse.go index 7c87d15..ab22d93 100644 --- a/main/parse.go +++ b/main/parse.go @@ -42,7 +42,13 @@ func (p *parser) parseSubex() subex.SubexState { if subexProgramToken.typ != TokenSubex { panic("Missing subex from substitution") } - reader := subex.NewStringRuneReader(subexProgramToken.val) + var subexProgram string + if delim.val == "=" || delim.val == "~" || delim.val == "\"" || delim.val == "`" { + subexProgram = delim.val + subexProgramToken.val + delim.val + } else { + subexProgram = subexProgramToken.val + } + reader := subex.NewStringRuneReader(subexProgram) subexAST := subex.Parse(reader) subex := subex.CompileTransducer(subexAST) delim = p.next() |