5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-23 16:21:37 +00:00
matterbridge/vendor/github.com/d5/tengo/compiler/ast/char_lit.go

27 lines
566 B
Go
Raw Normal View History

package ast
import "github.com/d5/tengo/compiler/source"
// CharLit represents a character literal.
type CharLit struct {
Value rune
ValuePos source.Pos
Literal string
}
func (e *CharLit) exprNode() {}
// Pos returns the position of first character belonging to the node.
func (e *CharLit) Pos() source.Pos {
return e.ValuePos
}
// End returns the position of first character immediately after the node.
func (e *CharLit) End() source.Pos {
return source.Pos(int(e.ValuePos) + len(e.Literal))
}
func (e *CharLit) String() string {
return e.Literal
}