in reply to Re^9: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
in thread What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff

This node falls below the community's minimum standard of quality and will not be displayed.
  • Comment on Re^10: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
  • Select or Download Code

Replies are listed 'Best First'.
Re^11: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by dave_the_m (Monsignor) on Sep 11, 2020 at 22:02 UTC
    So I think it already counts past lexems and thus can determine the balance of "()", '[]' and "{}"
    It can't currently.
    If all the following conditions are true
    All of the following satisfy your criteria, are valid and normal perl code, and would get a semicolon incorrectly inserted based on your criteria:
    use softsemicolon; $x = $a + $b; $x = 1 if $condition; $x = 1 unless $condition1 && $condition2;
    The warning issued should be something like
    I didn't ask what the text of the warning should be, I asked how the parser can determine when the warning should be issued.
    the scheme proposed for recursive descent parsers
    But perl uses an LR(1) parser, not a recursive descent parser.

    Dave.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^11: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by tobyink (Canon) on Sep 12, 2020 at 22:24 UTC

    "no Perl statement can start with the dot"

    Yada-yada operator in Perl 5.12+.

      Parser lookaheads are implemented in terms of tokens, not characters. The first token of yada is a triple-dot, not a dot. While you may think it starts with a dot, that's not how the parser sees it, so the existence of yada is not relevant here.