<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/subex/subexast.go
diff options
context:
space:
mode:
Diffstat (limited to 'subex/subexast.go')
-rw-r--r--subex/subexast.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/subex/subexast.go b/subex/subexast.go
index ee7a959..dd98aa9 100644
--- a/subex/subexast.go
+++ b/subex/subexast.go
@@ -359,3 +359,16 @@ func (ast SubexASTEmpty) compileWith(next SubexState) SubexState {
func (ast SubexASTEmpty) String() string {
return "()"
}
+
+// Discards the output from the content subex
+type SubexASTDiscard struct {
+ Content SubexAST
+}
+func (ast SubexASTDiscard) compileWith(next SubexState) SubexState {
+ return &SubexCaptureBeginState {
+ next: ast.Content.compileWith(&SubexDiscardState {next}),
+ }
+}
+func (ast SubexASTDiscard) String() string {
+ return fmt.Sprintf("(%v)$_", ast.Content)
+}