From ce251059cb562df6782ef56eabe249a32e86b424 Mon Sep 17 00:00:00 2001 From: Dmitri Tikhonov Date: Wed, 31 May 2023 17:23:58 -0400 Subject: [PATCH] parsers,perl: allow tokens following curly bracket --- Units/parser-perl.r/curly-bracket.b/expected.tags | 1 - Units/parser-perl.r/curly-bracket.b/input.pl | 2 -- Units/parser-perl.r/curly-bracket.d/expected.tags | 2 ++ Units/parser-perl.r/curly-bracket.d/input.pl | 2 ++ parsers/perl.c | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 Units/parser-perl.r/curly-bracket.b/expected.tags delete mode 100644 Units/parser-perl.r/curly-bracket.b/input.pl create mode 100644 Units/parser-perl.r/curly-bracket.d/expected.tags create mode 100644 Units/parser-perl.r/curly-bracket.d/input.pl diff --git a/Units/parser-perl.r/curly-bracket.b/expected.tags b/Units/parser-perl.r/curly-bracket.b/expected.tags deleted file mode 100644 index 5f1d2b4a52..0000000000 --- a/Units/parser-perl.r/curly-bracket.b/expected.tags +++ /dev/null @@ -1 +0,0 @@ -X input.pl /^{ package X;$/;" p diff --git a/Units/parser-perl.r/curly-bracket.b/input.pl b/Units/parser-perl.r/curly-bracket.b/input.pl deleted file mode 100644 index 998748a27c..0000000000 --- a/Units/parser-perl.r/curly-bracket.b/input.pl +++ /dev/null @@ -1,2 +0,0 @@ -{ package X; -} diff --git a/Units/parser-perl.r/curly-bracket.d/expected.tags b/Units/parser-perl.r/curly-bracket.d/expected.tags new file mode 100644 index 0000000000..11a4c892c7 --- /dev/null +++ b/Units/parser-perl.r/curly-bracket.d/expected.tags @@ -0,0 +1,2 @@ +X input.pl /^{ package X;$/;" p +foo input.pl /^} sub foo { return 42 }$/;" s diff --git a/Units/parser-perl.r/curly-bracket.d/input.pl b/Units/parser-perl.r/curly-bracket.d/input.pl new file mode 100644 index 0000000000..707cd48f3f --- /dev/null +++ b/Units/parser-perl.r/curly-bracket.d/input.pl @@ -0,0 +1,2 @@ +{ package X; +} sub foo { return 42 } diff --git a/parsers/perl.c b/parsers/perl.c index 7c3f4bab87..281336982e 100644 --- a/parsers/perl.c +++ b/parsers/perl.c @@ -754,7 +754,7 @@ static void findPerlTags (void) if (parse_only_pod_area) continue; - while (isspace (*cp)) + while (isspace (*cp) || *cp == '{' || *cp == '}') cp++; if (strncmp((const char*) cp, "sub", (size_t) 3) == 0)