diff options
Diffstat (limited to 'main/parse.go')
-rw-r--r-- | main/parse.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/main/parse.go b/main/parse.go index e9dd012..7c87d15 100644 --- a/main/parse.go +++ b/main/parse.go @@ -33,13 +33,6 @@ func (p *parser) peek() Token { return token } -var segmentTokens map[TokenType]bool = map[TokenType]bool { - TokenHash: true, - TokenAt: true, - TokenDot: true, - TokenLBrack: true, -} - func (p *parser) parseSubex() subex.SubexState { delim := p.next() if delim.typ != TokenSubstituteDelimiter { @@ -69,7 +62,7 @@ func (p *parser) parseBasicCommand(commandChar rune) Command { return NextCommand{} case 'N': return AppendNextCommand{} - case 's': + case 's', 'S': subex := p.parseSubex() var next Command token := p.peek() @@ -79,9 +72,16 @@ func (p *parser) parseBasicCommand(commandChar rune) Command { default: next = p.parseCommand() } - return SubstituteCommand { - subex: subex, - next: next, + if (commandChar == 's') { + return SubstituteValueCommand { + subex: subex, + next: next, + } + } else { + return SubstitutePathCommand { + subex: subex, + next: next, + } } case 'o': return NoopCommand{} |