basic expression interpreter

This commit is contained in:
basil 2025-06-08 16:03:02 -04:00
parent eebaadc16e
commit b244f7e3b2
Signed by: basil
SSH key fingerprint: SHA256:y04xIFL/yqNaG9ae9Vl95vELtHfApGAIoOGLeVLP/fE
5 changed files with 186 additions and 16 deletions

View file

@ -45,7 +45,7 @@ func (p *Printer) Parenthesize(name string, expressions ...Expr) string {
val := "(" + name
for _, e := range expressions {
exprStr, ok := (e.accept(p)).(string)
exprStr, ok := (e.Accept(p)).(string)
if !ok {
panic("badly implemented visitor")
}
@ -58,7 +58,7 @@ func (p *Printer) Parenthesize(name string, expressions ...Expr) string {
}
func (p *Printer) Print(e Expr) string {
str, ok := (e.accept(p)).(string)
str, ok := (e.Accept(p)).(string)
if !ok {
panic("badly implemented visitor")
}