Hi List, I've encountered some issues with Ruby Regexp's and interpolation, specifically Embedded code with #{}. Ruby allows embedded code inside Regexp literals, but the Ruby Bundle doesn't seem to recognise that fully. So I've changed the scope selector for the “Embedded Code…” snippet to (string.quoted.double.ruby|string.interpolated.ruby| string.regexp.classic.ruby|string.regexp.mod-r.ruby) - string source to make it behave like it should. Unfortunately I don't know enough about TextMate Language Grammars to correct the erroneous Syntax Highlighting (i assume in the interpolated_ruby section. Here's the current situation:
/#{code}/, %r{#{code}} - #{} gets correctly highlighted as source.ruby.embedded.source /[#{}]/ doesn't get highlighted (incorrectly)
There's also the /o option to regex which changes how #{} blocks are interpolated, but that can probably be ignored.
Would be great if someone with more language-grammar-fu could correct that. —G
On Jan 29, 2008, at 7:52 PM, Gerrit Kaiser wrote:
Hi List,
Hello.
I've encountered some issues with Ruby Regexp's and interpolation, specifically Embedded code with #{}. Ruby allows embedded code inside Regexp literals, but the Ruby Bundle doesn't seem to recognise that fully. So I've changed the scope selector for the “Embedded Code…” snippet…
So your goal is to make it so that when you type a # in a regex literal you get the full #{}?
There's also the /o option to regex which changes how #{} blocks are interpolated, but that can probably be ignored.
The /o option means that the regex is only compiled once and will be reused without reevaluating the expression in the future. What affect would you like TextMate to glean from this?
James Edward Gray II