Subject: | One-line "class NAME VERSION extends NAME" doesnt parse |
Date: | Sun, 28 Jun 2020 23:11:39 +0100 |
To: | bug-Object-Pad [...] rt.cpan.org |
From: | ilmari [...] ilmari.org (Dagfinn Ilmari Mannsåker) |
The following does not parse, but complains that it expected a block or
a semicolon:
class Foo 1.23 extends Bar;
Putting a newline before "extends" makes it work.
This is because prescan_version() returns an error "Invalid version
format (non-numeric data)" when there's anything other than a newline,
semicolon or curly brace after the version number. This seems to be
because that (and scan_version()) are only prepared to parse the version
bit in a "package NAME VERSION" statement, where it must be followed by
a semicolon or a block.
One workaround could be to scan forward to a space, curly or semicolon
manually, then copy the version string into a temporary buffer before
handing it to (pre)scan_version().
- ilmari
--
- Twitter seems more influential [than blogs] in the 'gets reported in
the mainstream press' sense at least. - Matt McLeod
- That'd be because the content of a tweet is easier to condense down
to a mainstream media article. - Calle Dybedahl