mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Fix #4530
This commit is contained in:
+5
-1
@@ -370,7 +370,11 @@ gb_internal ExactValue exact_value_from_basic_literal(TokenKind kind, String con
|
|||||||
}
|
}
|
||||||
case Token_Rune: {
|
case Token_Rune: {
|
||||||
Rune r = GB_RUNE_INVALID;
|
Rune r = GB_RUNE_INVALID;
|
||||||
utf8_decode(string.text, string.len, &r);
|
if (string.len == 1) {
|
||||||
|
r = cast(Rune)string.text[0];
|
||||||
|
} else {
|
||||||
|
utf8_decode(string.text, string.len, &r);
|
||||||
|
}
|
||||||
return exact_value_i64(r);
|
return exact_value_i64(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -718,12 +718,12 @@ gb_internal bool unquote_char(String s, u8 quote, Rune *rune, bool *multiple_byt
|
|||||||
Rune r = -1;
|
Rune r = -1;
|
||||||
isize size = utf8_decode(s.text, s.len, &r);
|
isize size = utf8_decode(s.text, s.len, &r);
|
||||||
*rune = r;
|
*rune = r;
|
||||||
*multiple_bytes = true;
|
if (multiple_bytes) *multiple_bytes = true;
|
||||||
*tail_string = make_string(s.text+size, s.len-size);
|
if (tail_string) *tail_string = make_string(s.text+size, s.len-size);
|
||||||
return true;
|
return true;
|
||||||
} else if (s[0] != '\\') {
|
} else if (s[0] != '\\') {
|
||||||
*rune = s[0];
|
*rune = s[0];
|
||||||
*tail_string = make_string(s.text+1, s.len-1);
|
if (tail_string) *tail_string = make_string(s.text+1, s.len-1);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -809,10 +809,10 @@ gb_internal bool unquote_char(String s, u8 quote, Rune *rune, bool *multiple_byt
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*rune = r;
|
*rune = r;
|
||||||
*multiple_bytes = true;
|
if (multiple_bytes) *multiple_bytes = true;
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
*tail_string = s;
|
if (tail_string) *tail_string = s;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user