Hi,
Having now upgraded, the themes editor is great. TM just gets better and better.
The old Perl bundle contained a definition to treat the following equally:
qq(Hello World); qq{Hello World}; qq|Hello World|;
This latter form, although a little weird, is nonetheless valid Perl, and something I use all the time. The new Perl bundle recognises the former two perfectly, but not the latter.
The naive experiments I've made in the bundle editor haven't gotten me anywhere, so I was hoping someone would be able to talk me through how to get my beloved qq|| working in the new Perl bundle.
Many thanks in advance!
Cheers, Andrew.
On Jun 23, 2005, at 5:05 AM, Andrew Green wrote:
qq(Hello World); qq{Hello World}; qq|Hello World|;
This latter form, although a little weird, is nonetheless valid Perl, and something I use all the time. The new Perl bundle recognises the former two perfectly, but not the latter.
In the language editor, look for the following for the Perl language: name = "string.unquoted.qq.perl";
Change begin = "qq([^\(\{\[])"; to begin = "qq([^\(\{\[\|])"; ^^^
There is a note in the svn log regarding pipes (|) not working, however. There's also a note about "arbitrary" quote characters, but that obviously isn't implemented in the current (r1220) revision of the syntax.
-- __ ____ / / / __/ Brian Lalor "If you still have gas, you're not lost." / _ /__ \ blalor@bravo5.org -- Jacques Strappe /_.__/____/ http://bravo5.org/
On 23/06/2005, at 14.48, Brian Lalor wrote:
In the language editor, look for the following for the Perl language: name = "string.unquoted.qq.perl";
Change begin = "qq([^\(\{\[])"; to begin = "qq([^\(\{\[\|])"; ^^^
Actually this is for generic qq<char> and _excludes_ the paired characters (since it uses <char> in the end pattern, which doesn't work for the paired ones).
There is a note in the svn log regarding pipes (|) not working
Oh… must have missed that note. This is actually a TM bug (which I wasn't aware of). It interprets special characters in the back- reference, resulting in | not being matched literally.
I'll fix that for 1.1b14 — until then, a special rule to handle | can be made, similar to the special rules for the brackets.
Oh… must have missed that note. This is actually a TM bug (which I wasn't aware of). It interprets special characters in the back- reference, resulting in | not being matched literally.
Darn it, I knew there was something wrong! :)
I'll fix that for 1.1b14 — until then, a special rule to handle | can be made, similar to the special rules for the brackets.
I tried a special rule
{ name = "string.quoted.double.q-pipe.perl"; begin = "\bq[qwx]*\|"; end = "\|"; patterns = ( { match = "(\b(.*)\b)"; } ); },
It didn't work either. Confusion.
best, Eric
--- Eric Hsu, Assistant Professor of Mathematics San Francisco State University erichsu@math.sfsu.edu http://math.sfsu.edu/hsu
On 23/06/2005, at 18.14, Eric Hsu wrote:
I tried a special rule { name = "string.quoted.double.q-pipe.perl"; begin = "\bq[qwx]*\|"; end = "\|"; patterns = ( { match = "(\b(.*)\b)"; } ); },
It didn't work either. Confusion.
Because it's placed _below_ the general rule, and the general one doesn't exclude |.
What's the patterns about btw?
Because it's placed _below_ the general rule, and the general one doesn't exclude |.
I am a very silly person. I got confused between my first attempt to change it and my later one merged with the rename.
What's the patterns about btw?
I don't get the question....?
I also don't get the nested qq thing you talk about on the blog and previous e-mails...
best, Eric --- Eric Hsu, Assistant Professor of Mathematics San Francisco State University erichsu@math.sfsu.edu http://math.sfsu.edu/hsu
On Jun 23, 2005, at 12:34 PM, Eric Hsu wrote:
What's the patterns about btw?
I don't get the question....?
I also don't get the nested qq thing you talk about on the blog and previous e-mails...
qq( ( does perl ( (nest ) parenthesis properly? ) ) )
(I don't know the answer, but that's what I suspect. Ruby may have an issue here too.) Chris
On Thu, 23 Jun 2005 13:36:09 -0700, Chris Thomas wrote:
(I don't know the answer, but that's what I suspect. Ruby may have an issue here too.)
Paste the following into Terminal:
perl -e "print qq(Does (Perl (Match (Nested) Parenteses) Properly?)\n);"
Seems to work fine!
Cheers, Andrew.
On Jun 23, 2005, at 2:10 PM, Andrew Green wrote:
perl -e "print qq(Does (Perl (Match (Nested) Parenteses) Properly?) \n);"
Seems to work fine!
Right on, but break it into lines like this:
qq( ( does perl ( (nest ) parenthesis properly? ) ) )
And paste it into a TM window with the language set to Perl.
Chris
perl -e "print qq(Does (Perl (Match (Nested) Parenteses) Properly?) \n);"
Okay, I see. Wow, I never knew Perl did that... Why the heck would you have this 'feature'? I mean, given that you can just do qq{Does (Perl (Match (Nested) Parentheses) Properly?}... it must be for crazy variable interpolation schemes.
But I see that BBEdit highlights the line correctly, so...
- Eric
--- Eric Hsu, Assistant Professor of Mathematics San Francisco State University erichsu@math.sfsu.edu http://math.sfsu.edu/hsu
On Jun 23, 2005, at 10:36 AM, Allan Odgaard wrote:
Actually this is for generic qq<char> and _excludes_ the paired characters (since it uses <char> in the end pattern, which doesn't work for the paired ones).
Ha! I missed the caret. Sorry... :-)