github.com/arnodel/golua@v0.0.0-20230215163904-e0b5347eaaa1/ast/etc.go (about) 1 package ast 2 3 import ( 4 "github.com/arnodel/golua/token" 5 ) 6 7 // Etc is the "..." expression node (ellipsis). 8 type Etc struct { 9 Location 10 } 11 12 var _ ExpNode = Etc{} 13 var _ TailExpNode = Etc{} 14 15 // NewEtc returns an Etc instance at the location given by the passed token. 16 func NewEtc(tok *token.Token) Etc { 17 return Etc{Location: LocFromToken(tok)} 18 } 19 20 // ProcessExp uses the given ExpProcessor to process the receiver. 21 func (e Etc) ProcessExp(p ExpProcessor) { 22 p.ProcessEtcExp(e) 23 } 24 25 // ProcessTailExp uses the given TailExpProcessor to process the reveiver. 26 func (e Etc) ProcessTailExp(p TailExpProcessor) { 27 p.ProcessEtcTailExp(e) 28 } 29 30 // HWrite prints a tree representation of the node. 31 func (e Etc) HWrite(w HWriter) { 32 w.Writef("...") 33 }