Ace editor custom error checking

1.3k views Asked by At

I created a new language mode in my editor with a few keywords: Ben, Tom, Brian and operands: AND OR ( ). Also, I need a custom error checker. I tried to change json worker which I have been inlcuded in my mode.

Everything I need is this: (Ben AND TOM) OR Brian - this is correct, everything else, like undefined keywords or incorecct syntax like BEN AND AND TOM, or BEN AND OR TOM- should treat as error. Does anyone have some idea?

1

There are 1 answers

1
a user On

There is no easy way to do this. You need to create a parser for your language to detect errors and send locations to ace. There are some libraries that can help you with this. e.g http://lakhin.com/projects/papa-carlo/demo/, but even with that, it's not a trivial task