github.com/arnodel/golua@v0.0.0-20230215163904-e0b5347eaaa1/ast/emptystat.go (about) 1 package ast 2 3 import ( 4 "github.com/arnodel/golua/token" 5 ) 6 7 // EmptyStat is a statement expression containing an empty statement. 8 type EmptyStat struct { 9 Location 10 } 11 12 var _ Stat = EmptyStat{} 13 14 // NewEmptyStat returns an EmptyStat instance (located from the given token). 15 func NewEmptyStat(tok *token.Token) EmptyStat { 16 return EmptyStat{Location: LocFromToken(tok)} 17 } 18 19 // ProcessStat uses the given StatProcessor to process the receiver. 20 func (s EmptyStat) ProcessStat(p StatProcessor) { 21 p.ProcessEmptyStat(s) 22 } 23 24 // HWrite prints a tree representation of the node. 25 func (s EmptyStat) HWrite(w HWriter) { 26 w.Writef("empty stat") 27 }