aboutsummaryrefslogtreecommitdiff
path: root/src/zilch/Env/Function.zig
blob: c37b1c7110c7866fd41a12994ccc8948b7c9465d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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("),
    };
}