From 6ec626c5e959cbdb9b5b0fa11ab7d65b7f44cc57 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sun, 8 Dec 2019 12:57:40 +0300 Subject: [PATCH] improve invalid character errorrs --- vlib/compiler/scanner.v | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vlib/compiler/scanner.v b/vlib/compiler/scanner.v index 91d171cd4c..b3eaa356fe 100644 --- a/vlib/compiler/scanner.v +++ b/vlib/compiler/scanner.v @@ -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 == '\\`' {