1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

improve invalid character errorrs

This commit is contained in:
Alexander Medvednikov 2019-12-08 12:57:40 +03:00
parent 8b0de95c0a
commit 6ec626c5e9

View File

@ -645,9 +645,6 @@ fn (s mut Scanner) scan() ScanRes {
}
}
mut msg := 'invalid character `${c.str()}`'
if c == `"` {
msg += ', use \' to denote strings'
}
s.error(msg)
return s.end_of_file()
}
@ -763,7 +760,8 @@ fn (s mut Scanner) ident_char() string {
if len != 1 {
u := c.ustring()
if u.len != 1 {
s.error('invalid character literal (more than one character: $len)')
s.error('invalid character literal (more than one character)\n' +
'use quotes for strings, backticks for characters')
}
}
if c == '\\`' {