Search code examples
ace-editor

Ace Editor - Syntax rule to get consecutive tokens of same value?


Consider the following text:

Formula1(Formula2(1))

I need each right parenthesis to be its own token.

My current rule is the following:

{
    token: "parenthesis.right",
    regex: "\\)"
},

But this generates one token with value "))" and I need 2 consecutive tokens each with value ")".

How do I do that?

Thanks


Solution

  • Add merge: false to the rule. see https://github.com/ajaxorg/ace/blob/v1.2.3/lib/ace/tokenizer.js#L306