Skip to content

VM: Allow passing Position values instead of Position::NONE into Rhai calls - #1136

Merged
schungx merged 3 commits into
rhaiscript:mainfrom
schungx:vm-position-info
Aug 19, 2026
Merged

VM: Allow passing Position values instead of Position::NONE into Rhai calls#1136
schungx merged 3 commits into
rhaiscript:mainfrom
schungx:vm-position-info

Conversation

@schungx

@schungx schungx commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Functions such as debug can print out the current position in a script.

The VM relies on context::call_fn_raw which automatically sets position to Position::NONE.

This PR exposes a lower-level private version, which accepts the current position such that debug can print out line numbers.

@schungx
schungx requested a review from ImTheSquid August 18, 2026 03:55
@schungx schungx added enhancement vm Issues related to the Rhai Grain bytecodes compiler and VM. labels Aug 18, 2026
@schungx schungx changed the title Allow passing Position values instead of Position::NONE into Rhai calls VM: Allow passing Position values instead of Position::NONE into Rhai calls Aug 18, 2026
@schungx
schungx merged commit e2929af into rhaiscript:main Aug 19, 2026
50 checks passed
@schungx
schungx deleted the vm-position-info branch August 19, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement vm Issues related to the Rhai Grain bytecodes compiler and VM.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants