From 5749be69125dc87ac50742295272a7e21f4f472e Mon Sep 17 00:00:00 2001 From: Mathias Magnusson Date: Sat, 31 May 2025 22:54:26 +0200 Subject: codegen integer literals correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was not as easy as one would expect ☠️ --- src/parse.zig | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/parse.zig') diff --git a/src/parse.zig b/src/parse.zig index e0c1fd0..2149cd7 100644 --- a/src/parse.zig +++ b/src/parse.zig @@ -26,15 +26,6 @@ pub const Expr = struct { }; }; }; - - pub fn getInt(self: *const @This(), file_source: []const u8) u64 { - var value: u64 = 0; - for (file_source[self.loc.start..self.loc.end]) |c| { - std.debug.assert('0' <= c and c <= '9'); - value = value * 10 + c - '0'; - } - return value; - } }; pub fn expression(allocator: Allocator, lexer: *Peekable(Lexer)) error{OutOfMemory}!*Expr { -- cgit v1.2.3