Commit Graph

44 Commits

Author SHA1 Message Date
gingerBill
b2dc5cc812 Fix error reporting for enforce new switch/for syntax 2024-05-16 15:32:15 +01:00
gingerBill
8808e5584a If only warnings exist on print_all_errors, next time it is called, clear the error list.
This is mostly only syntax errors too
2024-05-13 13:26:22 +01:00
Laytan
98827c867d fix duplicate suggestions and add missing newline 2024-05-09 19:21:39 +02:00
gingerBill
1818df786d Free memory for the error messages just in case 2024-05-07 11:21:12 +01:00
gingerBill
b23f1dd5ff Merge neighbouring error messages with the same location 2024-05-07 11:19:16 +01:00
gingerBill
1e5267c8e7 Merge pull request #3532 from laytan/fix-invalid-json
fix invalid JSON when an error does not have a position
2024-05-05 16:48:12 +01:00
Laytan Laats
ee818304f3 fix invalid JSON when an error does not have a position 2024-05-05 00:01:14 +02:00
Feoramund
67b786c738 Fix more race conditions in error reporting 2024-05-01 16:41:02 -04:00
Feoramund
f1c13d6bd8 Fix race condition in error_va
If the error count exceeded `MAX_ERROR_COLLECTOR_COUNT`, multiple
threads could print and exit simultaneously, causing a segfault.

This change moves the mutex lock back before the conditional.
2024-04-28 14:03:11 -04:00
Feoramund
ebfbe4d260 Clear unused global_error_collector.curr_error
This should cleanly prevent acknowledging duplicate errors on the same
position as seems to be the intent based on the prior `else if`
condition.
2024-04-28 06:44:28 -04:00
gingerBill
04278cd654 Remove line info in message with -json-errors 2024-04-24 17:13:53 +01:00
gingerBill
8a0f9ae108 Print to string buffer before printing errors 2024-04-16 13:15:23 +01:00
gingerBill
2e29687cee Fix #3425 2024-04-15 10:28:14 +01:00
gingerBill
46b9bd8c0e Improve error messages for switch and for r-values with a suggestion 2024-04-12 13:35:14 +01:00
gingerBill
16dc79fc5c Add "type" field to -json-errors 2024-04-08 13:36:23 +01:00
gingerBill
a9bfb3ac2e Clarity warning and error printing 2024-04-02 23:39:14 +01:00
gingerBill
692a47f080 Fix printing of warnings 2024-04-02 23:36:36 +01:00
gingerBill
53b02c5e6f Fix printing errors issue 2024-03-25 14:46:45 +00:00
gingerBill
cab53e12b7 Add assert message to tell me people to report the bug 2024-03-24 13:53:09 +00:00
gingerBill
1951bc45a6 Fix #3133 by show the line of the syntax error 2024-03-20 13:55:47 +00:00
gingerBill
e4c502e79b Add offset (in bytes) field to -json-errors 2024-03-20 11:06:02 +00:00
gingerBill
433109ff52 Replace gb_exit(1) with exit_with_errors() where appropriate 2024-03-19 16:29:45 +00:00
gingerBill
ba428fecdb Add -json-errors 2024-03-19 16:25:09 +00:00
gingerBill
17cc7a2c5e General clean-up for error.cpp 2024-03-19 15:42:59 +00:00
gingerBill
9a2fc6cf4c Serialize errors to make them sortable, deterministic, and generally more control 2024-03-19 15:34:29 +00:00
Tarık B
0b78544796 Fix various mismatches with the specified -max-error-count flag 2023-09-22 17:12:16 +02:00
gingerBill
c91898a888 Remove #relative slices; Replace with #relative multi-pointers 2023-08-05 16:05:39 +01:00
gingerBill
6568625dea Fix line error printing for error messages 2023-06-19 22:12:47 +01:00
gingerBill
bb4ff84a4a Add extra mutex for error block stuff 2023-05-16 11:52:02 +01:00
gingerBill
68dde07d5d Require parentheses around certain uses of or_return expressions 2023-04-27 11:13:05 +01:00
gingerBill
70ce878dfb Add -max-error-count:<integer> 2023-04-04 12:11:12 +01:00
gingerBill
1f17a391c6 Improve error line squiggle logic 2023-02-27 15:58:32 +00:00
gingerBill
a9182cfd8c Allow compound literals to access fields through using 2023-02-26 13:26:35 +00:00
gingerBill
245a6697ef Improve truncated verbose line error 2023-02-22 22:57:11 +00:00
gingerBill
6226c2978d Change padding of showing the error in line 2023-02-22 22:04:00 +00:00
gingerBill
6a6d7701f9 Improve error bounds for check_comparison 2023-02-22 21:50:49 +00:00
gingerBill
6aa54cbe9a Begin work on adding colours to error messages on Windows Terminals 2023-02-22 12:31:51 +00:00
gingerBill
090e30f07b Make -verbose-errors the default; -terse-errors to disable it 2023-02-22 11:48:10 +00:00
gingerBill
f5d507a9b9 Improve errors about conversions of constant integers 2023-02-22 11:30:08 +00:00
gingerBill
5c519f0e8d Remove the synchronization primitive init/destroy calls 2023-01-01 16:19:21 +00:00
gingerBill
ac5f5a33e9 gb_internal a lot 2022-12-18 21:17:07 +00:00
gingerBill
081a5a52a6 Add ODIN_ERROR_POS_STYLE environment variable
Allowing for two different error message styles:
default or odin
    path(line:column) message
unix
    path:line:column: message
2022-01-26 16:09:22 +00:00
gingerBill
56b4e0a3c3 Fix #1267 2022-01-23 15:40:46 +00:00
gingerBill
6f3e450c50 Move error handling code to a separate file 2022-01-10 14:03:36 +00:00