aboutsummaryrefslogtreecommitdiff
path: root/core/encoding/xml
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-07-31 11:46:40 +0100
committergingerBill <bill@gingerbill.org>2023-07-31 11:46:40 +0100
commit44ea82f8452876c4890884506111e243b8b2a541 (patch)
tree60125606c148c6c2fa44d921936cdb7157a6046a /core/encoding/xml
parent0de7df9eab9b256e0d1c8da7c9fc8c422c5ac1a7 (diff)
Clean up usage of `using` throughout core and vendor
Diffstat (limited to 'core/encoding/xml')
-rw-r--r--core/encoding/xml/tokenizer.odin32
1 files changed, 16 insertions, 16 deletions
diff --git a/core/encoding/xml/tokenizer.odin b/core/encoding/xml/tokenizer.odin
index d225c5d90..cd055475c 100644
--- a/core/encoding/xml/tokenizer.odin
+++ b/core/encoding/xml/tokenizer.odin
@@ -125,38 +125,38 @@ error :: proc(t: ^Tokenizer, offset: int, msg: string, args: ..any) {
}
@(optimization_mode="speed")
-advance_rune :: proc(using t: ^Tokenizer) {
+advance_rune :: proc(t: ^Tokenizer) {
#no_bounds_check {
/*
Already bounds-checked here.
*/
- if read_offset < len(src) {
- offset = read_offset
- if ch == '\n' {
- line_offset = offset
- line_count += 1
+ if t.read_offset < len(t.src) {
+ t.offset = t.read_offset
+ if t.ch == '\n' {
+ t.line_offset = t.offset
+ t.line_count += 1
}
- r, w := rune(src[read_offset]), 1
+ r, w := rune(t.src[t.read_offset]), 1
switch {
case r == 0:
error(t, t.offset, "illegal character NUL")
case r >= utf8.RUNE_SELF:
- r, w = #force_inline utf8.decode_rune_in_string(src[read_offset:])
+ r, w = #force_inline utf8.decode_rune_in_string(t.src[t.read_offset:])
if r == utf8.RUNE_ERROR && w == 1 {
error(t, t.offset, "illegal UTF-8 encoding")
- } else if r == utf8.RUNE_BOM && offset > 0 {
+ } else if r == utf8.RUNE_BOM && t.offset > 0 {
error(t, t.offset, "illegal byte order mark")
}
}
- read_offset += w
- ch = r
+ t.read_offset += w
+ t.ch = r
} else {
- offset = len(src)
- if ch == '\n' {
- line_offset = offset
- line_count += 1
+ t.offset = len(t.src)
+ if t.ch == '\n' {
+ t.line_offset = t.offset
+ t.line_count += 1
}
- ch = -1
+ t.ch = -1
}
}
}