Skip to content

Commit

Permalink
lex: fix floating-point number lexing
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Mar 5, 2024
1 parent 0c4d1dc commit 044cddf
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions std/jule/lex/lex.jule
Original file line number Diff line number Diff line change
Expand Up @@ -186,23 +186,23 @@ loop:
}

fn float_fmt_dotfp(&txt: []byte, mut i: int): str {
// skip .f
i += 2

i += 2 // skip .f
ret float_fmt_e(txt, i)
}

fn float_fmt_dotp(&txt: []byte, mut i: int): str {
// skip .
i++

i++ // skip .
ret float_fmt_e(txt, i)
}

fn float_num(&txt: []byte, mut i: int): (lit: str) {
i++ // Skip dot
if i >= txt.len || txt[i] == '_' {
ret ""
if i >= txt.len {
ret str(txt)
}
if txt[i] == '_' {
i--
ret str(txt[:i])
}
for i < txt.len; i++ {
let b = txt[i]
Expand Down Expand Up @@ -277,7 +277,6 @@ fn is_float_fmt_dotnp(&txt: []byte, mut i: int): bool {
if txt[i] != '.' {
ret false
}

i++
loop:
for i < txt.len; i++ {
Expand Down

0 comments on commit 044cddf

Please sign in to comment.