xgo/ast/empty_stmt.go

27 lines
372 B
Go
Raw Normal View History

2019-01-09 10:17:42 +03:00
package ast
import "github.com/d5/tengo/source"
2019-01-09 10:17:42 +03:00
type EmptyStmt struct {
Semicolon source.Pos
2019-01-09 10:17:42 +03:00
Implicit bool
}
func (s *EmptyStmt) stmtNode() {}
func (s *EmptyStmt) Pos() source.Pos {
2019-01-09 10:17:42 +03:00
return s.Semicolon
}
func (s *EmptyStmt) End() source.Pos {
2019-01-09 10:17:42 +03:00
if s.Implicit {
return s.Semicolon
}
return s.Semicolon + 1
}
func (s *EmptyStmt) String() string {
return ";"
}