import (
"bytes"
+ "fmt"
"go/token"
"path/filepath"
"strconv"
tok = S.switch3(token.OR, token.OR_ASSIGN, '|', token.LOR)
default:
if S.mode&AllowIllegalChars == 0 {
- S.error(offs, "illegal character "+strconv.QuoteRune(ch))
+ S.error(offs, fmt.Sprintf("illegal character %#U", ch))
}
insertSemi = S.insertSemi // preserve insertSemi info
}
pos int
err string
}{
- {"\a", token.ILLEGAL, 0, "illegal character '\\a'"},
- {`#`, token.ILLEGAL, 0, "illegal character '#'"},
- {`…`, token.ILLEGAL, 0, "illegal character '…'"},
+ {"\a", token.ILLEGAL, 0, "illegal character U+0007"},
+ {`#`, token.ILLEGAL, 0, "illegal character U+0023 '#'"},
+ {`…`, token.ILLEGAL, 0, "illegal character U+2026 '…'"},
{`' '`, token.CHAR, 0, ""},
{`''`, token.CHAR, 0, "illegal character literal"},
{`'\8'`, token.CHAR, 2, "unknown escape sequence"},