2008/5/28 A. Pagaltzis via RT <perlbug-followup@perl.org>: > Really this should be decided based on whether the closing brace > is followed by a comma or not, so in some sense this is certainly > a bug. But my understanding is that the syntactic ambiguity of > curly braces in Perl is difficult to handle in perl's ultimately > yacc-derived (but heavily mutated) parser, which uses a limited > lookahead for curlies to work around the fact that this style of > parser strongly favours tokens with only a single meaning. In > practice, the heuristic works most of the time and the > disambiguation cues are easy to employ. Perl's parser is strictly a LALR(1) yacc-generated parser -- not a "havily mutated" thingy. That means that it uses only one token of lookahead, and that detecting anything after a closing brace is impossible. The smoke and mirrors are strictly kept in the tokenizer, which is stateful, contrary to most classical tokenizers (like the ones lex generates).Thread Previous | Thread Next