Expand description
Perl: telling the and and not operators, the file tests, the
unary minus and bareword calls from an auto-quoted key that the
grammar lexes as one of them; and reading the POD in the data
section after __END__, which the grammar leaves as one leaf.
Enums§
- Perl
Data Section Rows - One classified run of rows in a Perl data section, as reported by
perl_data_section_rows.
Functions§
- perl_
and_ is_ operator - Whether
and, a Perlandtoken whose parent isparent, is the low-precedence logical operator. - perl_
bareword_ is_ call - Whether
word, a Perlcall_expression_with_barewordwhose ancestor chain isancestors, is a call site of its own. - perl_
bareword_ is_ key - Whether
word, a Perlcall_expression_with_barewordwhose ancestor chain isancestors, is an auto-quoted hash key rather than a call. - perl_
dash_ signs_ keyword_ key - Whether
dash, a Perl-token whose ancestor chain isancestors, is the sign of an auto-quoted-andor-notkey ($h{-not},(-and => 1)), which the grammar splits into the-and the keyword token.perl_and_is_operatorandperl_not_is_keydecide whether the keyword is a key, and a key’s sign is part of the string whether or not a space separates the two. - perl_
data_ section_ rows - Classifies the rows of a
data_not_for_compilernode — the text after__END__or__DATA__, which the grammar holds as one opaque leaf — in one pass oversection, its bytes.start_rowis the marker’s row, where the node starts; the rest of that row is never reported, since the marker makes the row code and no line there starts with=. - perl_
is_ and_ key_ misparse - Whether
expris theunary_expressiontree-sitter-perl builds around an auto-quotedandkey ((and => 1)): its first child, comments aside, is theandtoken itself. Seeperl_and_is_operator. - perl_
key_ is_ signed - Whether
key, anand/notkey token whose ancestor chain isancestors, is signed by a-($h{-not},(- and => 1)), read off the tree asperl_dash_signs_keyword_keyreads it: the-sits beside the key, or is the operator of the expression the key leads. The bytes cannot say it: an infix-($x - and => 2) or a comment ending in one also precedes a key, and a comment can sit between a sign and its key. - perl_
not_ is_ key - Whether
not, a Perlnottoken whose parent isparent, is an auto-quoted hash key rather than the prefix operator.