<- 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.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/subex/subexast.go b/subex/subexast.go
index 431ea26..abf0ca6 100644
--- a/subex/subexast.go
+++ b/subex/subexast.go
@@ -190,8 +190,9 @@ type SubexASTSum struct {
}
func (ast SubexASTSum) compileWith(next SubexState) SubexState {
return &SubexCaptureBeginState {
- next: ast.content.compileWith(&SubexSumEndState {
+ next: ast.content.compileWith(&SubexArithmeticEndState {
next: next,
+ calculate: sumValues,
}),
}
}
@@ -202,8 +203,9 @@ type SubexASTProduct struct {
}
func (ast SubexASTProduct) compileWith(next SubexState) SubexState {
return &SubexCaptureBeginState {
- next: ast.content.compileWith(&SubexProductEndState {
+ next: ast.content.compileWith(&SubexArithmeticEndState {
next: next,
+ calculate: multiplyValues,
}),
}
}