clean
This commit is contained in:
@@ -3,6 +3,10 @@ const types = @import("types.zig");
|
||||
const Type = types.Type;
|
||||
const unescape = @import("unescape.zig");
|
||||
|
||||
fn baseName(name: []const u8) []const u8 {
|
||||
return if (std.mem.lastIndexOfScalar(u8, name, '.')) |idx| name[idx + 1 ..] else name;
|
||||
}
|
||||
|
||||
/// Runtime value for comptime evaluation.
|
||||
/// Replaces codegen's JitResult with richer type support.
|
||||
pub const Value = union(enum) {
|
||||
@@ -651,7 +655,7 @@ pub const Compiler = struct {
|
||||
|
||||
if (callee_name) |name| {
|
||||
// Check if it's a builtin
|
||||
const base = if (std.mem.lastIndexOfScalar(u8, name, '.')) |idx| name[idx + 1 ..] else name;
|
||||
const base = baseName(name);
|
||||
if (std.meta.stringToEnum(BuiltinId, base)) |id| {
|
||||
try self.emit(.{ .call_builtin = .{ .id = id, .arg_count = @intCast(call_node.args.len) } });
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user