Heh... you're not the only one who wants something like this - I wanted to add it myself for exactly the same reason, but I couldn't come up with a syntax that I liked.
I don't like the double colon syntax, because it doesn't really stand out, it seems a little obscure, and also is already a perfectly legal construct in BeebAsm (basically an empty statement separated by colons).
I had a few possible options, none of which I particularly liked:
1) To provide a way of addressing local labels, rather than making them global, e.g.
Code:
.SomeRoutine
{
LDA #0:STA &70
.value LDA #0:STA &71
RTS
}
...
...
LDA #2
STA SomeRoutine.value+1
JSR SomeRoutine
This is a little odd though because it would require the new concept that the label SomeRoutine was somehow 'attached' to the braced section which followed.
1b) A variation on this would be to dispense with the idea that the top label was attached to the braces, and instead to say that any label defined with a further dot in its body is 'promoted' to global. Like this we could write:
Code:
.SomeRoutine
{
LDA #0:STA &70
.SomeRoutine.value LDA #0:STA &71
RTS
}
...
...
LDA #2
STA SomeRoutine.value+1
JSR SomeRoutine
2) To add an EXPORT keyword, which would create a global copy of a variable declared within the current scope:
Code:
.SomeRoutine
{
EXPORT SomeRoutineValue
LDA #0:STA &70
.SomeRoutineValue
LDA #0:STA &71
RTS
}
...
...
LDA #2
STA SomeRoutineValue+1
JSR SomeRoutine
3) Some leading character or something which would cause a label to be added in global scope:
Code:
.SomeRoutine
{
LDA #0:STA &70
.$SomeRoutineValue
LDA #0:STA &71
RTS
}
...
...
LDA #2
STA SomeRoutineValue+1 ;or maybe STA $SomeRoutineValue+1
JSR SomeRoutine
They all seemed a little contrived and horrible though. What do you think?
On the whole, I quite liked the brace syntax for marking local blocks of code, as it had familiar roots (from C-type languages), and was far more clear than the the method for declaring local labels that most assemblers resort to (a numeric value prefixed by + or -, yuk!)... but it does come with this problem that everything within becomes hidden to the outside world. Not a problem in C, but assembler's much more dirty!
I'll be happy to add this facility once we can reach some consensus amongst those who use the tool as to how it should be done!