This commit is contained in:
gingerBill
2025-05-24 14:18:22 +01:00
2 changed files with 5 additions and 3 deletions

View File

@@ -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'
@@ -447,7 +449,7 @@ scan_string :: proc(s: ^Scanner, quote: rune) -> (n: int) {
ch := advance(s)
for ch != quote {
if ch == '\n' || ch < 0 {
error(s, "literal no terminated")
error(s, "literal not terminated")
return
}
if ch == '\\' {

View File

@@ -87,7 +87,7 @@ foreign lib {
RWseek :: proc(ctx: ^RWops, offset: i64, whence: c.int) -> i64 ---
RWtell :: proc(ctx: ^RWops) -> i64 ---
RWread :: proc(ctx: ^RWops, ptr: rawptr, size: c.size_t, maxnum: c.size_t) -> c.size_t ---
RWwrite :: proc(ctx: ^RWops, size: c.size_t, num: c.size_t) -> c.size_t ---
RWwrite :: proc(ctx: ^RWops, ptr: rawptr, size: c.size_t, num: c.size_t) -> c.size_t ---
RWclose :: proc(ctx: ^RWops) -> c.int ---
LoadFile_RW :: proc(src: ^RWops, datasize: ^c.size_t, freesrc: bool) -> rawptr ---