diff options
Diffstat (limited to 'src/Syntax.zig')
| -rw-r--r-- | src/Syntax.zig | 28 |
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 @@ | |||
| 1 | pub const makefile = @import("Syntax/makefile.zig"); | ||
| 2 | pub const zig = @import("Syntax/zig.zig"); | ||
| 3 | |||
| 4 | const std = @import("std"); | ||
| 5 | |||
| 6 | const Syntax = @This(); | ||
| 7 | |||
| 8 | pub const database = [_]Syntax{makefile.syntax, zig.syntax}; | ||
| 9 | |||
| 10 | pub const Flags = struct { | ||
| 11 | hl_numbers: bool = false, | ||
| 12 | hl_strings: bool = false, | ||
| 13 | }; | ||
| 14 | |||
| 15 | name: []const u8, | ||
| 16 | // TODO: Make these into comptime StringSets, see std.ComptimeStringMap | ||
| 17 | filematch: []const []const u8, | ||
| 18 | keywords1: []const []const u8, | ||
| 19 | keywords2: []const []const u8, | ||
| 20 | singleline_comment_start: ?[]const u8, | ||
| 21 | multiline_comment_start: ?[]const u8, | ||
| 22 | multiline_comment_end: ?[]const u8, | ||
| 23 | separators: []const u8, | ||
| 24 | flags: Flags, | ||
| 25 | |||
| 26 | pub fn isSeparator(self: Syntax, char: u8) bool { | ||
| 27 | return std.ascii.isSpace(char) or std.mem.indexOfScalar(u8, self.separators, char) != null; | ||
| 28 | } | ||