diff options
Diffstat (limited to 'src/zilch/Env/Function.zig')
| -rw-r--r-- | src/zilch/Env/Function.zig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/zilch/Env/Function.zig b/src/zilch/Env/Function.zig new file mode 100644 index 0000000..c37b1c7 --- /dev/null +++ b/src/zilch/Env/Function.zig @@ -0,0 +1,15 @@ +const std = @import("std"); + +const Self = @This(); + +content: []const u8, +id: u32, +await: bool, + +pub fn from(content: []const u8) Self { + return .{ + .content = content, + .id = std.hash.XxHash32.hash(4654, content), + .await = std.mem.startsWith(u8, content, "async ") or std.mem.startsWith(u8, content, "async("), + }; +} |