Skip to content

Add iter_functions to Grain - #1212

Open
schungx wants to merge 2 commits into
rhaiscript:mainfrom
schungx:master
Open

schungx wants to merge 2 commits into
rhaiscript:mainfrom
schungx:master

Conversation

@schungx

@schungx schungx commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

There is currently no API to iterate functions in a Grain Program. This adds Program::iter_functions similar to AST::iter_functions so that a Program user can discover the functions compiled into its bytecodes.

This is useful when only a Grain artifact is available and we want to, say, register callbacks or filters based on the functions inside that script.

In the process, a missing verification in verify for functions is added.

@schungx schungx added enhancement vm Issues related to the Rhai Grain bytecodes compiler and VM. labels Nov 8, 2026
@schungx
schungx requested a review from ImTheSquid November 8, 2026 02:55
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.

1 participant