compiler: prompt error if trying to use f for floats

pull/1787/head
Henrixounez 2019-08-29 19:20:03 +02:00 committed by Alexander Medvednikov
parent 4b9cc1246e
commit 52c2763ee3
1 changed files with 3 additions and 0 deletions

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() {
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