(Note this this is independent from the concept of "scopes" for symbols in general, which would allow shadowing of outer symbols and auto-purging when the scope ends; see #342.)
Currently there's only one level of symbol scoping: .local symbols are scoped to their preceding Parent. It might be useful to have more levels, in the manner described by ax6:
..foo to define a label in the second-level nested scope would be some simple syntax that could be used. Like so:
Main:
dw 1234
: ..label isn't allowed here (nonsensical nested label; no parent)
.foo
dw 5678
..bar ; defines Main.foo.bar
dw 9012
.baz ; defines Main.baz (up a level because it only has one dot)
dw 34567
Naturally, ...label would be a third level, etc. Explicit definitions (.foo.bar, Main.foo.bar:) should also work.
It could autofill each upper level separately: so appending Main..bar there would become Main.baz.bar, appending .baz.qux would become Main.baz.qux (and then appending .baz..spam would become Main.baz.qux.spam).
(Note this this is independent from the concept of "scopes" for symbols in general, which would allow shadowing of outer symbols and auto-purging when the scope ends; see #342.)
Currently there's only one level of symbol scoping:
.localsymbols are scoped to their precedingParent. It might be useful to have more levels, in the manner described by ax6:..footo define a label in the second-level nested scope would be some simple syntax that could be used. Like so:Naturally,
...labelwould be a third level, etc. Explicit definitions (.foo.bar,Main.foo.bar:) should also work.It could autofill each upper level separately: so appending
Main..barthere would becomeMain.baz.bar, appending.baz.quxwould becomeMain.baz.qux(and then appending.baz..spamwould becomeMain.baz.qux.spam).