Ejemplo n.º 1
0
func newLexCharLitFromRune(c rune) *LexCharLit {
	cl := &LexCharLit{
		Val: c,
		s:   util.RuneToString(c),
	}
	cl.Lit = []byte(cl.s)
	return cl
}
Ejemplo n.º 2
0
func newLexCharLit(tok interface{}) *LexCharLit {
	c := new(LexCharLit)
	t := tok.(*token.Token)

	c.Val = util.LitToRune(t.Lit)
	c.Lit = t.Lit
	c.s = util.RuneToString(c.Val)

	return c
}
Ejemplo n.º 3
0
func (this CharRange) String() string {
	return fmt.Sprintf("[%s,%s]", util.RuneToString(this.From), util.RuneToString(this.To))
}