char literals

This commit is contained in:
2025-06-16 17:29:52 +02:00
parent 2b6f39135a
commit e15715f86d
5 changed files with 31 additions and 15 deletions

View File

@@ -511,6 +511,13 @@ Array.free:
TokenType::Number => {
emit!(&mut self.output, " mov rax, {}", token.lexeme);
}
TokenType::Char => {
emit!(
&mut self.output,
" mov rax, {}",
token.lexeme.chars().nth(1).unwrap() as u8
);
}
TokenType::String => {
// TODO: actual string parsing in the tokenizer
let value = &token.lexeme[1..token.lexeme.len() - 1]