Skip to content

Broaden TEXT token pattern to accept all non-special characters - #11

Merged
lfbittencourt merged 2 commits into
mainfrom
issue-11-broaden-text-token-pattern
Feb 3, 2026
Merged

lfbittencourt merged 2 commits into
mainfrom
issue-11-broaden-text-token-pattern

Conversation

@lfbittencourt

Copy link
Copy Markdown
Owner

Summary

  • Broadens the TEXT token regex from /^(\w|\s)+/ to /^[^()?|+\\]+/ so any character that isn't a special token is valid text
  • Adds tests for non-ASCII and special characters (e.g. café-latte)
  • Removes the "should throw on unsupported characters" test since all non-special characters are now valid

Test plan

  • New lexer test tokenizes café-latte as a single TEXT token
  • New expansion test expands café-latte to ['café-latte']
  • All existing tests pass
  • Lint and build pass

🤖 Generated with Claude Code

lfbittencourt and others added 2 commits February 3, 2026 09:46
Add tests that verify the lexer tokenizes and the expander handles
text containing accented and special characters like café-latte.
These tests currently fail because the TEXT token pattern only
matches word characters and whitespace.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change the TEXT regex from /^(\w|\s)+/ to /^[^()?|+\\]+/ so that
any character that isn't a special token character is valid text.
This allows accented characters, hyphens, and other symbols.

Remove the "should throw on unsupported characters" test since
all non-special characters are now valid text.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@lfbittencourt
lfbittencourt marked this pull request as ready for review February 3, 2026 12:50
@lfbittencourt
lfbittencourt merged commit a042d0f into main Feb 3, 2026
1 check passed
@lfbittencourt
lfbittencourt deleted the issue-11-broaden-text-token-pattern branch February 3, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant