aboutsummaryrefslogtreecommitdiff
path: root/src/parse.zig
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2025-05-31 22:54:26 +0200
committerMathias Magnusson <mathias@magnusson.space>2025-05-31 22:54:26 +0200
commit5749be69125dc87ac50742295272a7e21f4f472e (patch)
treecf0aa4776eda997f94ef35e06e41f16678aedebd /src/parse.zig
parent590a76edb6a88f754a43e96f16f2fc73845238b5 (diff)
downloadhuginn-5749be69125dc87ac50742295272a7e21f4f472e.tar.gz
codegen integer literals correctly
This was not as easy as one would expect ☠️
Diffstat (limited to 'src/parse.zig')
-rw-r--r--src/parse.zig9
1 files changed, 0 insertions, 9 deletions
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 {