<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/main/parse.go
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2024-04-23 20:25:49 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2024-04-23 20:25:49 +0100
commit7084f5e1ceb61eab199512410048ad53e3ea08d7 (patch)
tree54db2851f4eb4b06998e00173d0bf30b9991d43f /main/parse.go
parent663dd2ede81e6415a3c16a46d8e9cfa2e209238f (diff)
downloadstred-go-7084f5e1ceb61eab199512410048ad53e3ea08d7.tar
Add full merge command
Diffstat (limited to 'main/parse.go')
-rw-r--r--main/parse.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/parse.go b/main/parse.go
index 36917ac..36bd3ee 100644
--- a/main/parse.go
+++ b/main/parse.go
@@ -77,6 +77,10 @@ func (p *parser) parseBasicCommand(commands []Command, commandChar rune) []Comma
return append(commands, SubstituteAppendNextCommand {subex}, JumpCommand {len(commands) + 3})
case 'm':
return append(commands, MergeCommand{})
+ case 'M':
+ ast := p.parseSubex()
+ subex := subex.CompileTransducer(ast)
+ return append(commands, FullMergeCommand {subex}, JumpCommand {len(commands) + 3})
case 's':
ast := p.parseSubex()
subex := subex.CompileTransducer(ast)