-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[perl #46947] Parse method-BLOCK arguments as a term
(C.f. bug #114222 and commit 52d0e95, which did the same thing for ‘use’.) When parsing the arguments following a method name and a block (for ‘method { $obj } LIST‘ syntax), the lexer was using heuristics to determine whether an opening brace was a hash constructor or a block, as it does at the beginning of a statement. In every case in which it determined it was a block, the parser would them throw a syntax error. In this case, the lexer should not be trying to guess, since we *know* it can only be a hash here. This was the result: $ perl -e 'method {$obj} {$foo=>undef}' syntax error at -e line 1, near "} {" Execution of -e aborted due to compilation errors. Now we get this: $ ./miniperl -e 'method {$obj} {$foo=>undef}' Can't call method "method" on an undefined value at -e line 1. as expected.
- Loading branch information
Father Chrysostomos
committed
Aug 13, 2014
1 parent
48bbb9f
commit b5b6210
Showing
3 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters