So, I have this language that I have been developing. It uses Regex's to "translate" Hsuya's(My language) code to JavaScript. This works well and all but, I want to make it have errors. If anyone could help me with that, that would be great!

You are viewing a single comment. View All
Answered by Coder100 [earned 5 cycles]
View Answer

@AJK4 Btw, I'd recommend using Coder100's answer, and using a parsing/lexing library instead of RegEx. You don't have to reinvent the wheel and parse by hand (it may even slow you down in fact), but ECMAScript RegEx won't help, recursive RegEx would be better, ex: PCRE syntax, but JS doesn't have anything else.

Just try to get a better parser that can stop when something isn't correct, so you can handle it yourself, or throw an error and abort the program.