update to zig 0.15.0-dev.1048+f43f89a70
This commit is contained in:
parent
e638862997
commit
05d8fe3708
6 changed files with 11 additions and 11 deletions
|
@ -25,8 +25,8 @@ pub fn build(b: *std.Build) void {
|
||||||
.name = "ts_bin_query_gen",
|
.name = "ts_bin_query_gen",
|
||||||
.root_module = b.createModule(.{
|
.root_module = b.createModule(.{
|
||||||
.root_source_file = b.path("src/ts_bin_query_gen.zig"),
|
.root_source_file = b.path("src/ts_bin_query_gen.zig"),
|
||||||
.target = target,
|
.target = b.graph.host,
|
||||||
.optimize = optimize,
|
.optimize = .Debug,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
ts_bin_query_gen.linkLibC();
|
ts_bin_query_gen.linkLibC();
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
.name = .flow_syntax,
|
.name = .flow_syntax,
|
||||||
.version = "0.1.0",
|
.version = "0.1.0",
|
||||||
.fingerprint = 0x3ba2584ea1cec85f,
|
.fingerprint = 0x3ba2584ea1cec85f,
|
||||||
.minimum_zig_version = "0.14.1",
|
.minimum_zig_version = "0.15.0-dev.1048+f43f89a70",
|
||||||
|
|
||||||
.dependencies = .{
|
.dependencies = .{
|
||||||
.tree_sitter = .{
|
.tree_sitter = .{
|
||||||
|
|
|
@ -87,7 +87,7 @@ fn ft_func_name(comptime lang: []const u8) []const u8 {
|
||||||
return &func_name;
|
return &func_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const LangFn = *const fn () callconv(.C) ?*const treez.Language;
|
pub const LangFn = *const fn () callconv(.c) ?*const treez.Language;
|
||||||
|
|
||||||
pub const FirstLineMatch = struct {
|
pub const FirstLineMatch = struct {
|
||||||
prefix: ?[]const u8 = null,
|
prefix: ?[]const u8 = null,
|
||||||
|
|
|
@ -45,12 +45,12 @@ pub fn create(file_type: FileType, allocator: std.mem.Allocator, query_cache: *Q
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn static_create_file_type(allocator: std.mem.Allocator, lang_name: []const u8, query_cache: *QueryCache) !*Self {
|
pub fn create_file_type_static(allocator: std.mem.Allocator, lang_name: []const u8, query_cache: *QueryCache) !*Self {
|
||||||
const file_type = FileType.get_by_name_static(lang_name) orelse return error.NotFound;
|
const file_type = FileType.get_by_name_static(lang_name) orelse return error.NotFound;
|
||||||
return create(file_type, allocator, query_cache);
|
return create(file_type, allocator, query_cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn static_create_guess_file_type_static(allocator: std.mem.Allocator, content: []const u8, file_path: ?[]const u8, query_cache: *QueryCache) !*Self {
|
pub fn create_guess_file_type_static(allocator: std.mem.Allocator, content: []const u8, file_path: ?[]const u8, query_cache: *QueryCache) !*Self {
|
||||||
const file_type = FileType.guess_static(file_path, content) orelse return error.NotFound;
|
const file_type = FileType.guess_static(file_path, content) orelse return error.NotFound;
|
||||||
return create(file_type, allocator, query_cache);
|
return create(file_type, allocator, query_cache);
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ pub fn refresh_from_buffer(self: *Self, buffer: anytype, metrics: anytype) !void
|
||||||
const input: Input = .{
|
const input: Input = .{
|
||||||
.payload = &state,
|
.payload = &state,
|
||||||
.read = struct {
|
.read = struct {
|
||||||
fn read(payload: ?*anyopaque, _: u32, position: treez.Point, bytes_read: *u32) callconv(.C) [*:0]const u8 {
|
fn read(payload: ?*anyopaque, _: u32, position: treez.Point, bytes_read: *u32) callconv(.c) [*:0]const u8 {
|
||||||
const ctx: *State = @ptrCast(@alignCast(payload orelse return ""));
|
const ctx: *State = @ptrCast(@alignCast(payload orelse return ""));
|
||||||
const result = ctx.buffer.get_from_pos(.{ .row = position.row, .col = position.column }, &ctx.result_buf, ctx.metrics);
|
const result = ctx.buffer.get_from_pos(.{ .row = position.row, .col = position.column }, &ctx.result_buf, ctx.metrics);
|
||||||
bytes_read.* = @intCast(result.len);
|
bytes_read.* = @intCast(result.len);
|
||||||
|
@ -124,7 +124,7 @@ pub fn refresh_from_string(self: *Self, content: [:0]const u8) !void {
|
||||||
const input: Input = .{
|
const input: Input = .{
|
||||||
.payload = &state,
|
.payload = &state,
|
||||||
.read = struct {
|
.read = struct {
|
||||||
fn read(payload: ?*anyopaque, _: u32, position: treez.Point, bytes_read: *u32) callconv(.C) [*:0]const u8 {
|
fn read(payload: ?*anyopaque, _: u32, position: treez.Point, bytes_read: *u32) callconv(.c) [*:0]const u8 {
|
||||||
bytes_read.* = 0;
|
bytes_read.* = 0;
|
||||||
const ctx: *State = @ptrCast(@alignCast(payload orelse return ""));
|
const ctx: *State = @ptrCast(@alignCast(payload orelse return ""));
|
||||||
const pos = (find_line_begin(ctx.content, position.row) orelse return "") + position.column;
|
const pos = (find_line_begin(ctx.content, position.row) orelse return "") + position.column;
|
||||||
|
|
|
@ -23,12 +23,12 @@ pub const InputEncoding = enum(c_uint) {
|
||||||
};
|
};
|
||||||
pub const Input = extern struct {
|
pub const Input = extern struct {
|
||||||
payload: ?*anyopaque,
|
payload: ?*anyopaque,
|
||||||
read: ?*const fn (payload: ?*anyopaque, byte_index: u32, position: Point, bytes_read: *u32) callconv(.C) [*:0]const u8,
|
read: ?*const fn (payload: ?*anyopaque, byte_index: u32, position: Point, bytes_read: *u32) callconv(.c) [*:0]const u8,
|
||||||
encoding: InputEncoding,
|
encoding: InputEncoding,
|
||||||
};
|
};
|
||||||
pub const Language = struct {
|
pub const Language = struct {
|
||||||
var dummy: @This() = .{};
|
var dummy: @This() = .{};
|
||||||
pub fn LangFn() callconv(.C) ?*const Language {
|
pub fn LangFn() callconv(.c) ?*const Language {
|
||||||
return &dummy;
|
return &dummy;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -91,7 +91,7 @@ const FileType = struct {
|
||||||
highlights: [:0]const u8,
|
highlights: [:0]const u8,
|
||||||
injections: ?[:0]const u8,
|
injections: ?[:0]const u8,
|
||||||
};
|
};
|
||||||
const LangFn = *const fn () callconv(.C) ?*const treez.Language;
|
const LangFn = *const fn () callconv(.c) ?*const treez.Language;
|
||||||
|
|
||||||
fn load_file_types(comptime Namespace: type) []const FileType {
|
fn load_file_types(comptime Namespace: type) []const FileType {
|
||||||
comptime switch (@typeInfo(Namespace)) {
|
comptime switch (@typeInfo(Namespace)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue