I'm having another go at using Textmate for editing newLISP. While there is much to enjoy, I'm puzzled as to why Textmate is unable to balance simple newLISP code properly. I've more than once had to test code in BBEdit to find an unbalanced p. A simple example:
#!/usr/bin/env newlisp
(set 'open-paren "(")
(set 'close-paren "(")
(define (output s)
(println "(" s) ; a bit primitive :)
)
Textmate can't balance any of this. I've tried both the newLISP bundles I've found on the web, but neither seem to give me the simple behaviour I'd like. Anyone got a bundle that works for this?
TextMate's parenthesis balancing has always been a weak spot. Since TextMate uses regular expressions to do the parsing, it's extremely difficult to balance a set of symbols to an arbitrary nesting depth.
It looks like Seth used PCRE 5, which has "named groups," thus allowing for recursive matching. This feature does not appear to be in the regex library TextMate currently uses.