diff options
author | Charlie Stanton <charlie@shtanton.xyz> | 2024-03-29 09:49:26 +0000 |
---|---|---|
committer | Charlie Stanton <charlie@shtanton.xyz> | 2024-03-29 09:49:26 +0000 |
commit | 080a24e894f125d4f1741cfdcba7cb722304d209 (patch) | |
tree | 78c12af110a8a239b6a3b1f828e4f193fcb8cd32 /main/parse.go | |
parent | 510a8c95ce112617c33f8dfb865e752db0716cb1 (diff) | |
download | stred-go-080a24e894f125d4f1741cfdcba7cb722304d209.tar |
Completely remove the path space
The new design uses deeply nested values in the value space instead.
Diffstat (limited to 'main/parse.go')
-rw-r--r-- | main/parse.go | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/main/parse.go b/main/parse.go index 141ae7e..9c7a437 100644 --- a/main/parse.go +++ b/main/parse.go @@ -65,23 +65,14 @@ func (p *parser) parseBasicCommand(commands []Command, commandChar rune) []Comma return append(commands, PrintValueCommand{}) case 'd': return append(commands, DeleteValueCommand{}) - case 'D': - return append(commands, DeletePathCommand{}) case 'n': return append(commands, NextCommand{}) case 'N': return append(commands, AppendNextCommand{}) - case 's', 'S': + case 's': ast := p.parseSubex() subex := subex.CompileTransducer(ast) - switch commandChar { - case 's': - return append(commands, SubstituteValueCommand {subex}, JumpCommand {len(commands) + 3}) - case 'S': - return append(commands, SubstitutePathCommand {subex}, JumpCommand {len(commands) + 3}) - default: - panic("Unreachable!?!?") - } + return append(commands, SubstituteValueCommand {subex}, JumpCommand {len(commands) + 3}) case 'o': return append(commands, NoopCommand{}) case 'x': @@ -96,10 +87,6 @@ func (p *parser) parseBasicCommand(commands []Command, commandChar rune) []Comma return append(commands, SwapZRegCommand{}) case 'Z': return append(commands, AppendZRegCommand{}) - case 'k': - return append(commands, SwapPathCommand{}) - case 'K': - return append(commands, AppendPathCommand{}) case ':': labelToken := p.next() if labelToken.typ != TokenLabel { |