Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/org/perlonjava/core/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public final class Configuration {
* Automatically populated by Gradle/Maven during build.
* DO NOT EDIT MANUALLY - this value is replaced at build time.
*/
public static final String gitCommitId = "4623fa856";
public static final String gitCommitId = "6f96f1c74";

/**
* Git commit date of the build (ISO format: YYYY-MM-DD).
Expand All @@ -48,7 +48,7 @@ public final class Configuration {
* Parsed by App::perlbrew and other tools via: perl -V | grep "Compiled at"
* DO NOT EDIT MANUALLY - this value is replaced at build time.
*/
public static final String buildTimestamp = "Apr 24 2026 13:01:40";
public static final String buildTimestamp = "Apr 24 2026 13:47:17";

// Prevent instantiation
private Configuration() {
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/org/perlonjava/frontend/parser/StatementParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,29 @@ public static Node parseUseDeclaration(Parser parser, LexerToken token) {
// call Module->import( LIST )
// or Module->unimport( LIST )

// Before executing the argument list, process any pending heredocs.
// This handles cases like: use constant FOO => <<'EOT'; ... \n heredoc content \n EOT
// The heredoc content comes after the newline that follows the ';', but the
// BEGIN-equivalent evaluation of the import list happens immediately, so we
// must fill in heredoc bodies before the list is compiled and executed.
if (!parser.getHeredocNodes().isEmpty()) {
int savedIndex = parser.tokenIndex;
int newlineIndex = -1;
for (int i = savedIndex; i < parser.tokens.size(); i++) {
if (parser.tokens.get(i).type == LexerTokenType.NEWLINE) {
newlineIndex = i;
break;
}
}
if (newlineIndex >= 0) {
parser.tokenIndex = newlineIndex;
ParseHeredoc.parseHeredocAfterNewline(parser);
parser.heredocSkipToIndex = parser.tokenIndex;
parser.heredocNewlineIndex = newlineIndex;
parser.tokenIndex = savedIndex;
}
}

// Execute the argument list immediately in LIST context
// This is necessary for expressions like: use lib ($path =~ /^(.*)$/);
// where the regex match must return captured groups, not just success/failure
Expand Down
Loading