Skip to content

Commit

Permalink
Merge pull request #5429 from bajrangCoder/master
Browse files Browse the repository at this point in the history
added ziglang support
  • Loading branch information
akoreman authored Jan 29, 2024
2 parents a2ab916 + d202d5d commit 137aac1
Show file tree
Hide file tree
Showing 4 changed files with 476 additions and 1 deletion.
6 changes: 6 additions & 0 deletions demo/kitchen-sink/docs/zig.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const std = @import("std");

pub fn main() !void {
const stdout = std.io.getStdOut().writer();
try stdout.print("Hello, {s}!\n", .{"world"});
}
3 changes: 2 additions & 1 deletion src/ext/modelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ var supportedModes = {
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
XQuery: ["xq"],
YAML: ["yaml|yml"],
Zeek: ["zeek|bro"]
Zeek: ["zeek|bro"],
Zig: ["zig"]
};

var nameOverrides = {
Expand Down
20 changes: 20 additions & 0 deletions src/mode/zig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"use strict";

var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var ZigHighlightRules = require("./zig_highlight_rules").ZigHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;

var Mode = function() {
this.HighlightRules = ZigHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);

(function() {
this.lineCommentStart = "//";
this.$id = "ace/mode/zig";
}).call(Mode.prototype);

exports.Mode = Mode;
Loading

0 comments on commit 137aac1

Please sign in to comment.