~jamii/focus

234f64671383b0637312207fda154839e37400e2 — Jamie Brandon 2 years ago 3987b3e
Add nix comments
1 files changed, 4 insertions(+), 1 deletions(-)

M lib/focus/language.zig
M lib/focus/language.zig => lib/focus/language.zig +4 -1
@@ 12,6 12,7 @@ pub const Language = enum {
    Julia,
    Javascript,
    Imp2,
    Nix,
    Unknown,

    pub fn fromFilename(filename: []const u8) Language {


@@ 28,6 29,8 @@ pub const Language = enum {
            return .Javascript
        else if (std.mem.endsWith(u8, filename, ".imp2"))
            return .Imp2
        else if (std.mem.endsWith(u8, filename, ".nix"))
            return .Nix
        else
            return .Unknown;
    }


@@ 35,7 38,7 @@ pub const Language = enum {
    pub fn commentString(self: Language) ?[]const u8 {
        return switch (self) {
            .Zig, .Java, .Javascript, .Imp2 => "//",
            .Shell, .Julia => "#",
            .Shell, .Julia, .Nix => "#",
            .Unknown => null,
        };
    }