Closed Zomis closed 8 years ago
See how different IDEs handle something like ()((()()()))
This is how IntelliJ works, which seems to be a good strategy to follow:
Highlight both before and after: ()((()()x()))
Highlight after: ()(x(()()()))
Highlight before: ()((()()())x)
That is, always highlight the innermost match. In case of a end before and a beginning after, highlight both.
Take a look at https://github.com/TomasMikula/RichTextFX/blob/master/richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/JavaKeywords.java and see what can be accomplished with syntax highlighting in Brainfuck.
[
and]
[
and]
and possibly.
and,