summaryrefslogtreecommitdiff
path: root/src/Syntax.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Syntax.zig')
-rw-r--r--src/Syntax.zig28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Syntax.zig b/src/Syntax.zig
new file mode 100644
index 0000000..ce3f432
--- /dev/null
+++ b/src/Syntax.zig
@@ -0,0 +1,28 @@
1pub const makefile = @import("Syntax/makefile.zig");
2pub const zig = @import("Syntax/zig.zig");
3
4const std = @import("std");
5
6const Syntax = @This();
7
8pub const database = [_]Syntax{makefile.syntax, zig.syntax};
9
10pub const Flags = struct {
11 hl_numbers: bool = false,
12 hl_strings: bool = false,
13};
14
15name: []const u8,
16// TODO: Make these into comptime StringSets, see std.ComptimeStringMap
17filematch: []const []const u8,
18keywords1: []const []const u8,
19keywords2: []const []const u8,
20singleline_comment_start: ?[]const u8,
21multiline_comment_start: ?[]const u8,
22multiline_comment_end: ?[]const u8,
23separators: []const u8,
24flags: Flags,
25
26pub fn isSeparator(self: Syntax, char: u8) bool {
27 return std.ascii.isSpace(char) or std.mem.indexOfScalar(u8, self.separators, char) != null;
28}