[TxMt] Perl language definition: switch, case?

Andy Armstrong andy at hexten.net
Tue Jan 1 14:39:08 UTC 2008


I'm just updating the Perl language definition to support the new  
keywords and operators in 5.10. I notice that keyword.control.perl  
includes 'switch' and 'case' (which aren't Perl keywords; it's given/ 
when in 5.10) and also 'select' which is a function rather than a  
control keyword.

Is there a compelling reason not to remove switch, case and move  
select to the functions list?

Also, because I'm a TM language definition newbie, does anyone have  
any tips about how to handle the // (defined or) operator? In some  
contexts // is an empty regex; in others it's an operator

my @x = split //, $line;	# regex, common idiom to chop into chars
my $x = $y // $z;		# operator, equiv: my $x = defined $y ? $y : $z

-- 
Andy Armstrong, Hexten







More information about the textmate mailing list