in reply to howto parse (or determining end) of a line of perl
Why bother?
one line: ...code...;
more than one: ...code...;;
But, to parse perl use PPI/PPIx::XPath ( example Perl::Critic::Policy::ValuesAndExpressions:: GivenWhenTryCatchLexicalDollarUnderDefaultVarBindingConfusion )
$ ppi_dumper 2 PPI::Document PPI::Statement::Compound PPI::Token::Word 'for' PPI::Structure::List ( ... ) PPI::Statement PPI::Token::Number '1' PPI::Token::Operator '..' PPI::Token::Number '10' PPI::Structure::Block { ... ??? $ ppi_dumper 3 PPI::Document PPI::Statement::Compound PPI::Token::Word 'for' PPI::Structure::List ( ... ) PPI::Statement PPI::Token::Number '1' PPI::Token::Operator '..' PPI::Token::Number '10' PPI::Statement::Null PPI::Token::Structure ';' PPI::Token::Whitespace '\n'
So a PPI::Statement::Compound without a closing block parenthesis, means continue
$ cat 2 for(1..10){ $ cat 3 for(1..10);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: howto parse (or determining end) of a line of perl
by perl-diddler (Chaplain) on Aug 25, 2016 at 00:58 UTC | |
by Anonymous Monk on Aug 25, 2016 at 01:22 UTC |