Brace matching problem

In my Scheme language plugin, I've implemented a PairedBraceMatcher, which works great in normal editors. However it doesn't work in my language console, and I can't figure out why - none of the methods are called. It seems to be related to if the current state of the console is valid or not:

> (

Doesn't add a matching paren here

> (define x (

Or here. But if I close the two parens, making the construct valid, then syntax highlighting kicks in and things start working:

> (define x ())

This is now valid, it gets highlighted correctly, and parens are correctly inserted:

> (define x (()))

I checked that my parser doesn't return an error on empty file, I'm not sure what else to look for.

1 comment
Comment actions Permalink

I found the problem, my lexer (for reasons long forgotten) returned an EOF token at the end of parsing instead of null, and this was breaking the brace matching logic.


Please sign in to leave a comment.