mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
scanner: fix special case - e
or E
at the end
This commit is contained in:
parent
b17ade1257
commit
f859c7f93e
@ -223,9 +223,10 @@ fn (s mut Scanner) ident_dec_number() string {
|
||||
// scan exponential part
|
||||
mut has_exponential_part := false
|
||||
if s.expect('e', s.pos) || s.expect('E', s.pos) {
|
||||
exp_start_pos := (s.pos++)
|
||||
s.pos++
|
||||
exp_start_pos := s.pos
|
||||
|
||||
if s.text[s.pos] in [`-`, `+`] {
|
||||
if s.pos < s.text.len && s.text[s.pos] in [`-`, `+`] {
|
||||
s.pos++
|
||||
}
|
||||
|
||||
|
@ -219,8 +219,9 @@ fn (s mut Scanner) ident_dec_number() string {
|
||||
// scan exponential part
|
||||
mut has_exponential_part := false
|
||||
if s.expect('e', s.pos) || s.expect('E', s.pos) {
|
||||
exp_start_pos := (s.pos++)
|
||||
if s.text[s.pos] in [`-`, `+`] {
|
||||
s.pos++
|
||||
exp_start_pos := s.pos
|
||||
if s.pos < s.text.len && s.text[s.pos] in [`-`, `+`] {
|
||||
s.pos++
|
||||
}
|
||||
for s.pos < s.text.len && s.text[s.pos].is_digit() {
|
||||
|
Loading…
Reference in New Issue
Block a user