Would be better to do this.HighlightRules = GherkinHighlightRules; instead.
see https://github.com/pnevels/ace/blob/master/lib/ace/mode/javascript.js#L45