Skip to content

'compile' option to compile in local context - #532

Merged
skiars merged 1 commit into
berry-lang:masterfrom
s-hadinger:compile_in_local_context
Aug 13, 2026
Merged

'compile' option to compile in local context#532
skiars merged 1 commit into
berry-lang:masterfrom
s-hadinger:compile_in_local_context

Conversation

@s-hadinger

Copy link
Copy Markdown
Contributor

During compilation to .bec files, now the compilation is done in local context rather than global context.

Example, when solidifying:

class AClass
end

return AClass

Before, the .bec file would always create AClass global object; now it returns the AClass object but does not create an entry in globals anymore. This is useful to have the ability to unload in the future.

Also add an option to Berry native compile(code_or_filename:string [, mode:string, islocal:bool]) -> function. Now if islocal is true, the compilation is done in local context, or by default in global context.

@skiars
skiars merged commit 4aa51b4 into berry-lang:master Aug 13, 2026
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