support character literals in native compiler

This commit is contained in:
dzaima 2023-02-02 22:52:02 +02:00
parent 356093e313
commit dbe4c0b51a

View File

@ -95,6 +95,12 @@ NOINLINE B nc_tokenize(B prims, B sysvs, u32* chars, usz len, bool* hasBlock) {
i++;
break;
}
case '\'': { // character literal
if (i+1 >= len || chars[i+1] != '\'') thrM("Native compiler: Unclosed character literal");
val = nc_literal(m_c32(chars[i]));
i+= 2;
break;
}
case '#': { // comments
while (i<len && chars[i]!='\n') i++;
val = m_c32(','); i++;