From 822c7f370007b4e9b517a24af1cc8c4f6b8fa824 Mon Sep 17 00:00:00 2001 From: John Breaux Date: Wed, 31 Jul 2024 11:36:37 -0500 Subject: [PATCH] parser: Parse char immediates into Expr::Number --- src/parser.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parser.rs b/src/parser.rs index 9f49ccf..a02892d 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -173,6 +173,10 @@ impl<'t> Parser<'t> { self.take(); Expr::Number(n) } + Kind::Char(c) => { + self.take(); + Expr::Number(c as _) + } Kind::Identifier => { self.take(); Expr::Ident(lexeme)