Imply #no_capture to all variadic parameters

This commit is contained in:
gingerBill
2024-07-14 12:19:47 +01:00
parent 891cf54b5c
commit 8642d719f0
25 changed files with 125 additions and 117 deletions
+6 -6
View File
@@ -5,8 +5,8 @@ import "core:odin/tokenizer"
import "core:fmt"
Warning_Handler :: #type proc(pos: tokenizer.Pos, fmt: string, #no_capture args: ..any)
Error_Handler :: #type proc(pos: tokenizer.Pos, fmt: string, #no_capture args: ..any)
Warning_Handler :: #type proc(pos: tokenizer.Pos, fmt: string, args: ..any)
Error_Handler :: #type proc(pos: tokenizer.Pos, fmt: string, args: ..any)
Flag :: enum u32 {
Optional_Semicolons,
@@ -67,25 +67,25 @@ Import_Decl_Kind :: enum {
default_warning_handler :: proc(pos: tokenizer.Pos, msg: string, #no_capture args: ..any) {
default_warning_handler :: proc(pos: tokenizer.Pos, msg: string, args: ..any) {
fmt.eprintf("%s(%d:%d): Warning: ", pos.file, pos.line, pos.column)
fmt.eprintf(msg, ..args)
fmt.eprintf("\n")
}
default_error_handler :: proc(pos: tokenizer.Pos, msg: string, #no_capture args: ..any) {
default_error_handler :: proc(pos: tokenizer.Pos, msg: string, args: ..any) {
fmt.eprintf("%s(%d:%d): ", pos.file, pos.line, pos.column)
fmt.eprintf(msg, ..args)
fmt.eprintf("\n")
}
warn :: proc(p: ^Parser, pos: tokenizer.Pos, msg: string, #no_capture args: ..any) {
warn :: proc(p: ^Parser, pos: tokenizer.Pos, msg: string, args: ..any) {
if p.warn != nil {
p.warn(pos, msg, ..args)
}
p.file.syntax_warning_count += 1
}
error :: proc(p: ^Parser, pos: tokenizer.Pos, msg: string, #no_capture args: ..any) {
error :: proc(p: ^Parser, pos: tokenizer.Pos, msg: string, args: ..any) {
if p.err != nil {
p.err(pos, msg, ..args)
}