Skip to content

Commit

Permalink
#2744 implemented manual __END__ block capture method
Browse files Browse the repository at this point in the history
Fixes #2744
  • Loading branch information
hurricup committed Aug 27, 2023
1 parent 0a98bde commit 6733998
Show file tree
Hide file tree
Showing 3 changed files with 10,824 additions and 10,803 deletions.
7 changes: 2 additions & 5 deletions plugin/core/grammar/Perl.flex
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import com.intellij.psi.tree.IElementType;
/*
// Char classes
*/
NEW_LINE = \R
WHITE_SPACE = [ \t\f]
ANY_SPACE = [ \t\f\n\r]
LINE_COMMENT = "#" .*
Expand Down Expand Up @@ -123,7 +122,6 @@ UNQUOTED_HEREDOC_MARKER = [a-zA-Z_] \d* {IDENTIFIER}?

END_BLOCK = "__END__"
DATA_BLOCK = "__DATA__"
LINE_TO_END = .+ {NEW_LINE}?

SUB_PROTOTYPE = [\[\$\@\%\&\*\]\;\+\\_]+
SUB_PROTOTYPE_WITH_SPACES = ({WHITE_SPACE} | {SUB_PROTOTYPE})+
Expand Down Expand Up @@ -749,9 +747,8 @@ POSIX_CHARGROUP_ANY = {POSIX_CHARGROUP}|{POSIX_CHARGROUP_DOUBLE}
}

<END_BLOCK>{
"=" \w {LINE_TO_END} {return capturePod(true);}
{LINE_TO_END} {return COMMENT_BLOCK;}
[^] {return COMMENT_BLOCK;}
"=" \w {return capturePod(true);}
[^] {return captureEndBlock();}
}

///////////////////////////////// subs, anon subs, methods, etc //////////////////////////////////////////////////////////
Expand Down

0 comments on commit 6733998

Please sign in to comment.