Codemirror is an excellent JS library for syntax coloring & highlighter etc. I have created a very simple 'macro' language for my project and want to use codemirror for it. However, writing a new mode / lexicon parser for codemirror is not a simple task. Good news though, the excellent codemirror-grammar makes it a relatively simple task to achieve this without being a regexp ninja - it uses a JSON formatted definition file which is very approachable with an easy learning curve. Frustratingly, the docs are not fabulous.
My question is, how can I tell codemirror-grammar that the keywords list should be case-insensitive, for example:
MacroVersion should be matched by 'macroversion'.
Currently 'MacroVersion' is not being highlighted. Image below.
What have I tried so far: I looked at the source code for codemirror-grammar and though not fully understanding it I thought there seemed to be a token as in the highlight below for case sensitivity.
I have also looked at other sample codemirror-grammar language examples but have not found a cut-paste solution there.
Research / other SO questions for codemirror:
CodeMirror autocomplete: Case In Sensitive Search : Not a duplicated as is specific to python mode.js and requires source code change in mode file, whereas codemirror-grammar does not have the mode js file.