add builtin data for 0.8.0 and 0.8.1

This commit is contained in:
Meghan Denny 2021-09-30 17:53:14 -07:00
parent a75276defc
commit dc8affe122
4 changed files with 3544 additions and 1 deletions

View File

@ -12,7 +12,7 @@ pub fn build(b: *std.build.Builder) !void {
exe_options.addOption( exe_options.addOption(
[]const u8, []const u8,
"data_version", "data_version",
b.option([]const u8, "data_version", "The data version - 0.7.0, 0.7.1 or master.") orelse "master", b.option([]const u8, "data_version", "The Zig version your compiler is.") orelse "master",
); );
exe.addPackage(.{ .name = "known-folders", .path = .{ .path = "src/known-folders/known-folders.zig" } }); exe.addPackage(.{ .name = "known-folders", .path = .{ .path = "src/known-folders/known-folders.zig" } });

1770
src/data/0.8.0.zig Normal file

File diff suppressed because it is too large Load Diff

1770
src/data/0.8.1.zig Normal file

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,8 @@ const known_folders = @import("known-folders");
const data = blk: { const data = blk: {
if (std.mem.eql(u8, build_options.data_version, "0.7.0")) break :blk @import("data/0.7.0.zig"); if (std.mem.eql(u8, build_options.data_version, "0.7.0")) break :blk @import("data/0.7.0.zig");
if (std.mem.eql(u8, build_options.data_version, "0.7.1")) break :blk @import("data/0.7.1.zig"); if (std.mem.eql(u8, build_options.data_version, "0.7.1")) break :blk @import("data/0.7.1.zig");
if (std.mem.eql(u8, build_options.data_version, "0.8.0")) break :blk @import("data/0.8.0.zig");
if (std.mem.eql(u8, build_options.data_version, "0.8.1")) break :blk @import("data/0.8.1.zig");
if (std.mem.eql(u8, build_options.data_version, "master")) break :blk @import("data/master.zig"); if (std.mem.eql(u8, build_options.data_version, "master")) break :blk @import("data/master.zig");
@compileError("invalid data_version provided"); @compileError("invalid data_version provided");
}; };
@ -562,6 +564,7 @@ pub fn identifierFromPosition(pos_index: usize, handle: DocumentStore.Handle) []
if (end_idx <= start_idx) return &[0]u8{}; if (end_idx <= start_idx) return &[0]u8{};
return text[start_idx..end_idx]; return text[start_idx..end_idx];
} }
fn isSymbolChar(char: u8) bool { fn isSymbolChar(char: u8) bool {
return std.ascii.isAlNum(char) or char == '_'; return std.ascii.isAlNum(char) or char == '_';
} }