Skip to content

fix: minus operator no longer splits namespaced words - #429

Draft
toddr-bot wants to merge 2 commits into
masterfrom
koan.toddr.bot/fix-issue-59
Draft

fix: minus operator no longer splits namespaced words#429
toddr-bot wants to merge 2 commits into
masterfrom
koan.toddr.bot/fix-issue-59

Conversation

@toddr-bot

@toddr-bot toddr-bot commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

When PPI parsed $a=-xx::cc(), the DashedWord tokenizer only captured \w+ characters, missing :: namespace separators. This caused -xx::cc to be split into two Word tokens (-xx and ::cc) instead of remaining a single token.

Updated the DashedWord regex to match Word.pm's pattern, which also captures :: and ' namespace separators.

Fixes #59

Changes

  • Fixed DashedWord.pm __TOKENIZER__on_char regex from \G(\w+) to \G(\w+(?:(?:\'|::)\w+)*(?:::)?) to capture namespace separators
  • Added regression tests for -xx::cc(), -foo::bar, and -foo'bar

Test plan

  • New regression tests in t/08_regression.t verify all three cases produce single Word tokens
  • Full test suite passes (69 files, 53093 tests)

Generated by Kōan /fix


Quality Report

Changes: 2 files changed, 26 insertions(+), 2 deletions(-)

Code scan: clean

Tests: skipped

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

toddr-bot and others added 2 commits April 27, 2026 07:42
Add TODO-marked regression tests for GitHub #59 / RT #30037 where
a minus before a namespaced function name causes it to split into
two Word tokens (e.g. -xx::cc becomes -xx + ::cc instead of one token).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The DashedWord tokenizer used \G(\w+) which only matched word characters,
causing -xx::cc to split into two tokens (-xx and ::cc). Updated the regex
to match Word.pm's pattern: \G(\w+(?:(?:\'|::)\w+)*(?:::)?) which also
captures :: and ' namespace separators.

Fixes #59

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RT 30037: minus operator turns function name into two words

2 participants