From 080a24e894f125d4f1741cfdcba7cb722304d209 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Fri, 29 Mar 2024 09:49:26 +0000 Subject: Completely remove the path space The new design uses deeply nested values in the value space instead. --- main/parse.go | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'main/parse.go') 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 { -- cgit v1.2.3