update to zig 0.15.0-dev.1048+f43f89a70
This commit is contained in:
parent
d71afb5db8
commit
167a588dee
6 changed files with 11 additions and 11 deletions
|
@ -87,7 +87,7 @@ fn ft_func_name(comptime lang: []const u8) []const u8 {
|
|||
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 {
|
||||
prefix: ?[]const u8 = null,
|
||||
|
|
|
@ -45,12 +45,12 @@ pub fn create(file_type: FileType, allocator: std.mem.Allocator, query_cache: *Q
|
|||
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;
|
||||
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;
|
||||
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 = .{
|
||||
.payload = &state,
|
||||
.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 result = ctx.buffer.get_from_pos(.{ .row = position.row, .col = position.column }, &ctx.result_buf, ctx.metrics);
|
||||
bytes_read.* = @intCast(result.len);
|
||||
|
@ -124,7 +124,7 @@ pub fn refresh_from_string(self: *Self, content: [:0]const u8) !void {
|
|||
const input: Input = .{
|
||||
.payload = &state,
|
||||
.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;
|
||||
const ctx: *State = @ptrCast(@alignCast(payload orelse return ""));
|
||||
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 {
|
||||
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,
|
||||
};
|
||||
pub const Language = struct {
|
||||
var dummy: @This() = .{};
|
||||
pub fn LangFn() callconv(.C) ?*const Language {
|
||||
pub fn LangFn() callconv(.c) ?*const Language {
|
||||
return &dummy;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -91,7 +91,7 @@ const FileType = struct {
|
|||
highlights: [: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 {
|
||||
comptime switch (@typeInfo(Namespace)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue