func (l *lexer) onechar(quote rune) (r rune, b byte, ok bool) {
	c := l.getr()
	switch c {
	case EOF:
		yyerror("eof in string")
		l.ungetr()
		return

	case '\n':
		yyerror("newline in string")
		l.ungetr()
		return

	case '\\':
		break

	case quote:
		return

	default:
		return c, 0, true
	}

	c = l.getr()
	switch c {
	case 'x':
		return 0, byte(l.hexchar(2)), true

	case 'u':
		return l.unichar(4), 0, true

	case 'U':
		return l.unichar(8), 0, true

	case '0', '1', '2', '3', '4', '5', '6', '7':
		x := c - '0'
		for i := 2; i > 0; i-- {
			c = l.getr()
			if c >= '0' && c <= '7' {
				x = x*8 + c - '0'
				continue
			}

			yyerror("non-octal character in escape sequence: %c", c)
			l.ungetr()
		}

		if x > 255 {
			yyerror("octal escape value > 255: %d", x)
		}

		return 0, byte(x), true

	case 'a':
		c = '\a'
	case 'b':
		c = '\b'
	case 'f':
		c = '\f'
	case 'n':
		c = '\n'
	case 'r':
		c = '\r'
	case 't':
		c = '\t'
	case 'v':
		c = '\v'
	case '\\':
		c = '\\'

	default:
		if c != quote {
			yyerror("unknown escape sequence: %c", c)
		}
	}

	return c, 0, true
}
// onechar lexes a single character within a rune or interpreted string literal,
// handling escape sequences as necessary.
onechar lexes a single character within a rune or interpreted string literal,
handling escape sequences as necessary.
// onechar lexes a single character within a rune or interpreted string literal // handling escape sequences as necessary .
func (l *lexer) onechar(quote rune) (r rune, b byte, ok bool) {
	c := l.getr()
	switch c {
	case EOF:
		yyerror("eof in string")
		l.ungetr()
		return
	case '\n':
		yyerror("newline in string")
		l.ungetr()
		return
	case '\\':
		break
	case quote:
		return
	default:
		return c, 0, true
	}
	c = l.getr()
	switch c {
	case 'x':
		return 0, byte(l.hexchar(2)), true
	case 'u':
		return l.unichar(4), 0, true
	case 'U':
		return l.unichar(8), 0, true
	case '0', '1', '2', '3', '4', '5', '6', '7':
		x := c - '0'
		for i := 2; i > 0; i-- {
			c = l.getr()
			if c >= '0' && c <= '7' {
				x = x*8 + c - '0'
				continue
			}
			yyerror("non-octal character in escape sequence: %c", c)
			l.ungetr()
		}
		if x > 255 {
			yyerror("octal escape value > 255: %d", x)
		}
		return 0, byte(x), true
	case 'a':
		c = '\a'
	case 'b':
		c = '\b'
	case 'f':
		c = '\f'
	case 'n':
		c = '\n'
	case 'r':
		c = '\r'
	case 't':
		c = '\t'
	case 'v':
		c = '\v'
	case '\\':
		c = '\\'
	default:
		if c != quote {
			yyerror("unknown escape sequence: %c", c)
		}
	}
	return c, 0, true
}
func ( l * lexer ) onechar ( quote rune ) ( r rune , b byte , ok bool ) { c := l . getr ( ) switch c { case EOF : yyerror ( " " ) l . ungetr ( ) return case '\n' : yyerror ( " " ) l . ungetr ( ) return case '\\' : break case quote : return default : return c , 0 , true } c = l . getr ( ) switch c { case 'x' : return 0 , byte ( l . hexchar ( 2 ) ) , true case 'u' : return l . unichar ( 4 ) , 0 , true case 'U' : return l . unichar ( 8 ) , 0 , true case '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' : x := c - '0' for i := 2 ; i > 0 ; i -- { c = l . getr ( ) if c >= '0' && c <= '7' { x = x * 8 + c - '0' continue } yyerror ( " " , c ) l . ungetr ( ) } if x > 255 { yyerror ( " " , x ) } return 0 , byte ( x ) , true case 'a' : c = '\a' case 'b' : c = '\b' case 'f' : c = '\f' case 'n' : c = '\n' case 'r' : c = '\r' case 't' : c = '\t' case 'v' : c = '\v' case '\\' : c = '\\' default : if c != quote { yyerror ( " " , c ) } } return c , 0 , true }
onechar lexes a single character within a rune or interpreted string literal,
handling escape sequences as necessary.
onechar lexes a single character within a rune or interpreted string literal handling escape sequences as necessary .