Skip to content

Commit

Permalink
compiler: prompt error if trying to use f for floats
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrixounez authored and medvednikov committed Aug 29, 2019
1 parent 4b9cc12 commit 52c2763
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/scanner.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52c2763

Please sign in to comment.