[Parseperl-discuss] Hashref vs block
Brought to you by:
adamkennedy
From: Chris D. <ch...@cl...> - 2006-09-25 18:10:48
|
I discovered a problem with anonymous hashref parsing (a pair of failing tests added to SVN as rev 1103). The attached fix passes all PPI and Perl::Critic tests, but breaks the following common idiom: my %foo = map({$_ => 1} @foo); I think the lexer needs a lookahead to detect the lack of a following comma to distinguish the following cases: map({$_ => 1} @foo foo({$_ => 1}, @foo); That seems like a non-trivial change to the Lexer code, so I'm going to set it aside for now. Chris -- Chris Dolan, Software Developer, Clotho Advanced Media Inc. 608-294-7900, fax 294-7025, 1435 E Main St, Madison WI 53703 vCard: http://www.chrisdolan.net/ChrisDolan.vcf Clotho Advanced Media, Inc. - Creators of MediaLandscape Software (http://www.media-landscape.com/) and partners in the revolutionary Croquet project (http://www.opencroquet.org/) |