Update log_on_line to take Location* instead of individual fields

This commit is contained in:
2026-04-24 22:13:29 +02:00
parent 26a1d0285e
commit 902e2f0325
4 changed files with 25 additions and 18 deletions
+5 -6
View File
@@ -4,6 +4,8 @@
#ifndef LOG_H
#define LOG_H
#include "location.h"
/**
* A method that can log an error.
*/
@@ -22,14 +24,11 @@ void log_error(const char* msg);
/**
* Logs a pretty error with additional information about the line where the error occurred.
*
* @param filename The name of the file where the error occurred.
* @param line_text The entire line of text where the error occurred.
* @param line The line number where the error occurred.
* @param from The column number where the error starts.
* @param to The column number where the error ends.
* @param loc The location where the error occurred.
* @param to_column The column number where the error ends.
* @param msg The error message to log. This can contain format specifiers like printf, and the additional arguments will be formatted into the message.
* @param ... Additional arguments to format into the error message.
*/
void log_on_line(const char* filename, const char* line_text, int line, int from, int to, const char* msg, ...);
void log_on_line(Location* loc, int to_column, const char* msg, ...);
#endif