>>106527782
>Probably ignoring brackets inside of strings and comments, and escaped end quote characters?
I got that down
>single line comments being extended with a backslash.
Isn't that a C99 thing? I'm writing ANSI C. I detect comments by looking at the current character to see if it's * and checking if the previous character was a /. Then there's the inverse for checking when you exit the comment. It supports multi line but only in that format
I also implemented telling the user where the syntax error was in (line,column) coordinates, because I think it's stupid to just tell them there's an error instead of where exactly it is.
Output example:
Ya dun fuck'd up. C comments don't nest. @ (2, 1)
Ya dun fuck'd up. C comments don't nest. @ (3, 47)
Ya dun fuck'd up. C comments don't nest. @ (4, 47)
Ya dun fuck'd up. Comment ended without starting. @ (5, 43)
Ya dun fuck'd up. C comments don't nest. @ (11, 1)
Ya dun fuck'd up. Parens closed but never opened. @ (16, 4)
Ya dun fuck'd up. Parens opened but never closed. @ (18, 4)
Ya dun fuck'd up. Parens opened but never closed. @ (18, 3)
Ya dun fuck'd up. Bracket opened but never closed. @ (20, 1)
Ya dun fuck'd up. Brace opened but never closed. @ (19, 1)
This was tricky however because there is no limit to how many parentheses the user might want to nest, so being able to match a ( with a ) in a sea of thousands of them isn't trivial. So I i implemented a failsafe where if the file being fed to the program detects more than X open parentheses at any given time, it gives up on the coordinates and resorts to more simple reporting.
>>106527799
Me dumb.