Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implement nested scopes #8

@c3d

Description

@c3d

The documentation now describes scoping rules which are currently, for the most part, not implemented.

The Tao3D compiler was notoriously bad at scoping, sometimes leaking definitions in the enclosing scope in order to workaround limitations with the LLVM code generation used at the time. Nesting should now be possible, although some special care must be taken with respect to how variables from the enclosing context are accessed by the inner context. I believe that LLVM should be supporting that since the dialect of C / C++ that GNU support does support nested functions, but I have not studied yet how this is represented at the LLVM IR level yet.

Symbol lookup is presently relatively well scoped, but additional testing is needed. Nested scope might even be working correctly in the interpreter.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions