compiler-in-go/pkg/ast/block.go
jmug 9c32fe1d31 Rename module to "compiler-in-go"
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
2025-01-13 19:56:56 -08:00

24 lines
458 B
Go

package ast
import (
"bytes"
"code.jmug.me/jmug/compiler-in-go/pkg/token"
)
type BlockStatement struct {
Token token.Token // The `{` token.
Statements []Statement
}
func (bs *BlockStatement) statementNode() {}
func (bs *BlockStatement) TokenLiteral() string {
return bs.Token.Literal
}
func (bs *BlockStatement) String() string {
var out bytes.Buffer
for _, s := range bs.Statements {
out.WriteString(s.String())
}
return out.String()
}