Skip to content

Commit 6bd6042

Browse files
author
ralismark
committed
Add line number+diagnostic function
1 parent ab9436a commit 6bd6042

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

tectonic/xetex-output.c

+14
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,20 @@ diagnostic_error_here(const char *format, ...)
5353
return error;
5454
}
5555

56+
// This replaces the "print file+line number" block at the start of errors
57+
diagnostic_t
58+
error_here_with_diagnostic(const char* message)
59+
{
60+
diagnostic_t error = diagnostic_error_here("%s", message);
61+
if (file_line_error_style_p)
62+
print_file_line();
63+
else
64+
print_nl_cstr("! ");
65+
print_cstr(message);
66+
67+
return error;
68+
}
69+
5670
static void
5771
warn_char(int c)
5872
{

tectonic/xetex-xetexd.h

+1
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,7 @@ void flush_math(void);
10251025

10261026
void capture_to_diagnostic(diagnostic_t warning);
10271027
PRINTF_FUNC(1,2) diagnostic_t diagnostic_error_here(const char *format, ...);
1028+
diagnostic_t error_here_with_diagnostic(const char* message);
10281029
void print_ln(void);
10291030
void print_raw_char(UTF16_code s, bool incr_offset);
10301031
void print_char(int32_t s);

0 commit comments

Comments
 (0)