Parser regression: valid multi-component package declaration fails in AI::Prolog

Open
#1,399 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
perl
Domain
compilers

Research direction

Start by examining commit 95b8824a9 and the package declaration parsing path, then reproduce the failure with t/35clause.t and t/50engine.t. Add project-owned coverage for a valid multi-component package declaration and verify that both the JVM and interpreter backends pass the focused tests without the misleading diagnostic.

Written by the indexing model from the issue text.

Description

bug

Summary

AI::Prolog 0.741 has a regression under PerlOnJava when loading AI::Prolog::TermList::Clause.

Reproduction

CPAN random tester run: 20260916-111623-23683

Affected upstream tests:

  • t/35clause.t
  • t/50engine.t

Both fail on the JVM backend and the interpreter backend. The first failure is:

Failed test 'use AI::Prolog::TermList::Clause;'
Error: package operator requires an identifier at ../lib/AI/Prolog/TermList/Clause.pm line 1, near ";"

The source begins with the valid declaration:

package AI::Prolog::TermList::Clause;

The same parser failure then prevents AI::Prolog::Engine from loading in t/50engine.t.

Expected result

Under system Perl, with the exact dependency versions selected by the CPAN run, both focused tests pass: 49 tests successful.

Actual result

PerlOnJava reports 2 of 19 test programs failing, with 2 of 414 subtests failed overall. The regression is recorded against the previous passing run from 2026-08-28.

Suspected cause

The regression appears to have been introduced by commit 95b8824a9 (fix: validate package version declarations), which added validatePackageVersion(parser) to package declaration parsing. A valid multi-component package declaration is being compiled with a non-identifier operand, producing the misleading package operator requires an identifier diagnostic.

This should be reduced to project-owned parser regression coverage for a valid multi-component package declaration, then verified on both execution backends.

The full system-Perl distribution suite was not completed because the local environment lacks the transitive prerequisite Carp::Assert; this does not affect the focused system-Perl comparison above.

Dominant language
Perl
Stars
64
Forks
6
Avg merge
5h 25m
Merged PRs (30d)
157

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fglock/PerlOnJava

All issues in fglock/PerlOnJava

Similar issues

More Perl issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.