Skip to content

Reject invalid moshscript characters - #5

Merged
ralyodio merged 1 commit into
moshcoder:mainfrom
aiirvizionz:clientkit/reject-invalid-tokens
Jul 10, 2026
Merged

Reject invalid moshscript characters#5
ralyodio merged 1 commit into
moshcoder:mainfrom
aiirvizionz:clientkit/reject-invalid-tokens

Conversation

@aiirvizionz

Copy link
Copy Markdown
Contributor

Fixes a parser bug where invalid characters between otherwise valid moshscript tokens were silently skipped.

Example before this change: say(@); compiled as say() instead of failing. That can make malformed scripts run with different behavior than the author wrote.

This PR tracks tokenizer progress and throws when there is an unmatched gap or trailing invalid input. It also adds a small Node test suite covering the regression and one valid script path.

Validation:

  • npm test
  • node bin/moshcode.mjs run examples/alive.mosh --dry-run --max 1
  • git diff --check

@ralyodio
ralyodio merged commit 028b3ff into moshcoder:main Jul 10, 2026
1 check passed
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.

2 participants