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

compiler: prompt error if trying to use f for floats

This commit is contained in:
Henrixounez 2019-08-29 19:20:03 +02:00 committed by Alexander Medvednikov
parent 4b9cc1246e
commit 52c2763ee3

View File

@ -146,6 +146,9 @@ fn (s mut Scanner) ident_dec_number() string {
for s.pos < s.text.len && s.text[s.pos].is_digit() { for s.pos < s.text.len && s.text[s.pos].is_digit() {
s.pos++ s.pos++
} }
if !s.inside_string && s.pos < s.text.len && s.text[s.pos] == `f` {
s.error('no `f` is needed for floats')
}
} }
// scan exponential part // scan exponential part