Skip to content

Add iter_functions to Grain - #1212

Merged
schungx merged 2 commits into
rhaiscript:mainfrom
schungx:master
Nov 19, 2026
Merged

schungx merged 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
@schungx
schungx force-pushed the master branch 2 times, most recently from e5a406b to 6c1edd9 Compare November 9, 2026 14:36
@schungx

schungx commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator Author

@ImTheSquid Appreciate if you can take a look at this. I have a dependency that is waiting for this to land... :-D Thanks!

@schungx

schungx commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Ok just merge anyway. :-D

@schungx
schungx merged commit 3601974 into rhaiscript:main Nov 19, 2026
54 of 56 checks passed
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