gbdev / gbdev/rgbds

[Feature request] File-local defines

Open
#342 12 comments 1 reaction 0 assignees View on GitHub
enhancement rgbasm
Dominant language
C++
Stars
1.6k
Forks
193
Avg merge
22h 17m
Merged PRs (30d)
26

Description

Some projects are a hairy mess of file inclusions. It happens, and there's not much we can do about it after some time.

The consequence of this is that, after resolving all the inclusions (imagine a `rgbasm` option equivalent to `gcc -E`), the actually assembled file is tens of thousands (or hundreds of thousands) of lines long. Anything defined anywhere through this chain of includes is visible anywhere afterwards, including in the parent, things included by the parent, and so on. This is often desirable (think of a constants file), but not always.

Thus, what I'm requesting are equivalents to `EQU`, `EQUS` and `MACRO` (and any other similar keywords you can think of) that don't traverse file inclusions — whatever they define is local to the file, isn't inherited by included files, and is purged automatically when the file ends. This would make it a lot simpler to define local constants, etc., without having to end files with a long stream of `PURGE` commands.

Thoughts? Comments?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.