Commit Graph

59 Commits

Author SHA1 Message Date
gingerBill a36a8722dc Minimize more thread contention 2025-09-10 19:30:32 +01:00
gingerBill 1e0902677f Multithread min dep set by removing the set itself 2025-09-10 17:29:11 +01:00
Airtz fe7fbfedc0 Fix typo in error_article_table lookup 2025-06-16 12:22:03 +02:00
Jeroen van Rijn 6b4b0cea5d Add table-driven (in)definite article to some errors. 2024-08-20 22:13:31 +02:00
Feoramund 8ed5cb283b Re-implement the error squiggles with visual width 2024-06-29 18:55:12 -04:00
Feoramund d4e2fa0377 Refactor show_error_on_line
This should adequately solve any issues with Unicode alignment by
sidestepping the issue entirely. With this change, we make use of the
built-in ANSI facilities of the terminal to underline the text.

If the terminal does not support underlining, there are still the
fallback bold markers at the start and end of error locations.
2024-06-14 18:28:47 -04:00
Jeroen van Rijn ff4787070d Revert "Merge pull request #3744 from Mango0x45/master"
This reverts commit 45044de0b7, reversing
changes made to 20c17ba6f9.
2024-06-14 00:06:55 +02:00
Jeroen van Rijn c9c7d3270d Merge branch 'master' of https://github.com/Mango0x45/Odin into pr/3744 2024-06-13 17:27:00 +02:00
Thomas Voss 9f7ac1469f Generate ranges of the correct length 2024-06-13 17:24:56 +02:00
Jeroen van Rijn ca9d1f940d Just change squiggle_extra type to i32. 2024-06-13 17:23:30 +02:00
Thomas Voss 9f190f3937 Generate ranges of the correct length 2024-06-13 17:00:13 +02:00
Thomas Voss 657c516360 Pad ‘^~~~^’-style diagnostic ranges properly 2024-06-13 16:23:34 +02:00
Feoramund 8702bf00d5 Remove _ in Syntax_Error verbose message 2024-06-09 22:47:43 -04:00
Laytan Laats e627fcb0e6 fix not printing Error: when terminal has no color support 2024-06-07 16:58:23 +02:00
gingerBill 155516b897 Fix -ignore-warnings 2024-06-06 13:02:08 +01:00
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