Still experimenting with the new theme system, I came across this problem in the default PHP bundle : I want to hilight "->" operator, like in : $smarty->template_dir Tried to add my own, no success (the ctrl-shift T tooltip says the scope is source.php). Then I realized the right syntax existed in the Bundle :
<dict> <key>match</key> <string>(::|->)|\b(abstract|cl(ass|one)|extends|function|i (mplements|nterface)|new|parent|self|__(autoload|c(all|lone|onstruct)| destruct|get|s(et|leep)|toString|wakeup))\b</string> <key>name</key> <string>keyword.construct.php</string> </dict>
(note the -> )
It seems correct, but it turns out that "->" is not matched in the string "$smarty->template" but it is when it's surrounded by spaces : "$smarty -> template".
Am I wrong to say it looks like a parsing bug ?
Dominique.
I'm replying to myself because I got it. This is not a parsing bug, this is probably just related to the definition file.
$smarty->template_dir doesn't work $smarty->$template_dir would work.
However, this is beyond my knowledge of the syntax definition system. How to define a string that would match the "->" in "->anything" and be consistent with the keyword.construct.php scope ?
Dominique.
On 29 mai 05, at 16:45, Dominique PERETTI wrote:
Still experimenting with the new theme system, I came across this problem in the default PHP bundle : I want to hilight "->" operator, like in : $smarty->template_dir Tried to add my own, no success (the ctrl-shift T tooltip says the scope is source.php). Then I realized the right syntax existed in the Bundle :
<dict> <key>match</key> <string>(::|->)|\b(abstract|cl(ass|one)|extends|function|i (mplements|nterface)|new|parent|self|__(autoload|c(all|lone| onstruct)|destruct|get|s(et|leep)|toString|wakeup))\b</string> <key>name</key> <string>keyword.construct.php</string> </dict>
(note the -> )
It seems correct, but it turns out that "->" is not matched in the string "$smarty->template" but it is when it's surrounded by spaces : "$smarty -> template".
Am I wrong to say it looks like a parsing bug ?
Dominique. ______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On May 29, 2005, at 17:05, Dominique PERETTI wrote:
I'm replying to myself because I got it. This is not a parsing bug, this is probably just related to the definition file.
$smarty->template_dir doesn't work $smarty->$template_dir would work.
Yes, there is a special rule that matches “->property”. This rule marks the latter “property” part, but not the arrow. I just committed an update to the PHP syntax which now also mark the “->” part (as keyword.construct.php).
Note however that the naming scheme in the PHP file will change (to follow the names listed in the letter Sune linked to) -- but at least for now you can color it (if you do get the updated syntax from svn).
This is btw the main reason why b11 is still unofficial (i.e. that scope names will undergo one last change, so people creating custom themes a.s.o. should prepare to update scope names) -- the theme system still needs some polish (and non-visual settings will be part of the bundle editor instead), but I can warmly recommend b11 to those who want to check out the new stuff. B11 does include a large subset of the bundles, so it will work for C/C++, Obj-C, HTML/PHP/CSS a.s.o. w/o the svn checkout. There's a full list of included bundles on my blog -- if you need others, you can always check them out from svn, please don't write and ask why I've dropped support for some language, if your language is not present in b11! ;)