This really seems more of a basic programming problem than a CodeMirror problem. Switching the if clauses for P and P. might help, but I think you’ll have a hard time writing a language mode by trial-and-error editing of an existing mode.
I know that I’m going to have a hard time … But I’m not able to escape - since I need it for my job.
As I told you, I managed now to fix the static pattern - but I’ve still my issues with the X. Notation and RS_* where I do not know how to color the literals which I do not know yet - in fact I just want to colorize words which are starting with RS_*…
If you support I can sent you an excellent bottle of Austrian white vine
You can pass a regular expression like /RS_\w+/ to match to match any word starting with RS_. But I have no idea what your other problem is and, wine or no wine, I’m not really prepared to coach you though this.
var regex = new RegExp("(RS_\\w+)", "g");
if (stream.match(regex)) {
return ret("oliv", "oliv");
}
The return ret (…) will be triggered. The String within the editor starts to change color, but in the end it’s red again. Could it be that it will be overloaded by the JS Mode afterwards?