mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-07 02:54:18 +00:00
Allow text/scanner to scan 0h hex floats
This commit is contained in:
@@ -285,6 +285,7 @@ scan_number :: proc(s: ^Scanner, ch: rune, seen_dot: bool) -> (rune, rune) {
|
||||
case 'o': return "octal literal"
|
||||
case 'z': return "dozenal literal"
|
||||
case 'x': return "hexadecimal literal"
|
||||
case 'h': return "hexadecimal literal"
|
||||
}
|
||||
return "decimal literal"
|
||||
}
|
||||
@@ -360,7 +361,8 @@ scan_number :: proc(s: ^Scanner, ch: rune, seen_dot: bool) -> (rune, rune) {
|
||||
base, prefix = 12, 'z'
|
||||
case 'h':
|
||||
tok = Float
|
||||
fallthrough
|
||||
ch = advance(s)
|
||||
base, prefix = 16, 'h'
|
||||
case 'x':
|
||||
ch = advance(s)
|
||||
base, prefix = 16, 'x'
|
||||
|
||||
Reference in New Issue
Block a user