Skip to content
Open
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ logs/
.perlonjava_env_ready
*.diff
*.patch

.windsurf/
Image-ExifTool-13.44/
dev/examples/DiagnoseBytecodeEstimation.pl
dev/prompts/fix_pat_advanced_verifyerror.md
# But allow patch files in import-perl5/patches/
!dev/import-perl5/patches/*.patch

Expand Down
4 changes: 0 additions & 4 deletions dev/import-perl5/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ imports:
type: directory

# Specific patched files (applied after directory import above)
- source: perl5/t/test.pl
target: perl5_t/t/test.pl
patch: test.pl.patch

- source: perl5/t/re/pat.t
target: perl5_t/t/re/pat.t
patch: pat.t.patch
Expand Down
64 changes: 0 additions & 64 deletions dev/import-perl5/patches/test.pl.patch

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/java/org/perlonjava/parser/StatementParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,6 @@ public static Node parseIfStatement(Parser parser) {
elseBranch = parseIfStatement(parser);
}

// Use a macro to emulate Test::More SKIP blocks
TestMoreHelper.handleSkipTest(parser, thenBranch);

return new IfNode(operator.text, condition, thenBranch, elseBranch, parser.tokenIndex);
}

Expand Down
5 changes: 0 additions & 5 deletions src/main/java/org/perlonjava/parser/StatementResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,6 @@ yield dieWarnNode(parser, "die", new ListNode(List.of(

parser.ctx.symbolTable.exitScope(scopeIndex);

if (label != null && label.equals("SKIP")) {
// Use a macro to emulate Test::More SKIP blocks
TestMoreHelper.handleSkipTest(parser, block);
}

yield new For3Node(label,
true,
null, null,
Expand Down
52 changes: 0 additions & 52 deletions src/main/java/org/perlonjava/parser/TestMoreHelper.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,40 @@ public static boolean checkGoto(String label) {
}

/**
* Check if there's a control flow marker that matches this loop, and return an action code.
* This is an ultra-simplified version that does all checking in one call to avoid ASM issues.
* Check if the current marker (if any) matches the given label.
* Does NOT clear the marker - just checks if it matches.
*
* @param labelName The loop's label (null for unlabeled)
* @return 0=no action, 1=LAST, 2=NEXT, 3=REDO, 4=GOTO (leave in registry)
* @param labelName The label to check against
* @return true if there's a marker and it matches this label
*/
public static boolean markerMatchesLabel(String labelName) {
ControlFlowMarker marker = currentMarker.get();
if (marker == null) {
return false;
}

// Check if marker's label matches (Perl semantics)
if (marker.label == null) {
// Unlabeled control flow matches any loop
return true;
} else if (labelName == null) {
// Labeled control flow doesn't match unlabeled loop
return false;
} else {
// Both labeled - must match exactly
return marker.label.equals(labelName);
}
}

/**
* Check if there's a pending control flow marker for a specific loop label.
* If the marker matches, clear it and return the action code.
* If it doesn't match, leave it for an outer loop.
*
* This is called at loop boundaries to check for non-local control flow.
*
* @param labelName The label of the current loop (null for unlabeled loops)
* @return Action code: 0=no match, 1=LAST, 2=NEXT, 3=REDO
*/
public static int checkLoopAndGetAction(String labelName) {
ControlFlowMarker marker = currentMarker.get();
Expand Down
11 changes: 9 additions & 2 deletions src/main/perl/lib/Test/More.pm
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,15 @@ sub BAIL_OUT {
exit 255;
}

sub skip {
die "Test::More::skip() is not implemented";
sub skip($;$) {
my ($name, $count) = @_;
$count ||= 1;
for (1..$count) {
$Test_Count++;
my $result = "ok";
print "$Test_Indent$result $Test_Count # skip $name\n";
}
last SKIP;
}

# Workaround to avoid non-local goto (last SKIP).
Expand Down
Loading