mirror of
https://github.com/irmen/prog8.git
synced 2024-11-26 11:49:22 +00:00
less verbose anon label names
This commit is contained in:
parent
563122ac92
commit
223bab21aa
@ -1584,7 +1584,7 @@ class AnonymousScope(override var statements: MutableList<IStatement>,
|
|||||||
override lateinit var parent: Node
|
override lateinit var parent: Node
|
||||||
|
|
||||||
init {
|
init {
|
||||||
name = "<<<anonymous-$sequenceNumber>>>"
|
name = "<anon-$sequenceNumber>" // make sure it's an invalid soruce code identifier so user source code can never produce it
|
||||||
sequenceNumber++
|
sequenceNumber++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class AsmGen(val options: CompilationOptions, val program: IntermediateProgram,
|
|||||||
init {
|
init {
|
||||||
// Because 64tass understands scoped names via .proc / .block,
|
// Because 64tass understands scoped names via .proc / .block,
|
||||||
// we'll strip the block prefix from all scoped names in the program.
|
// we'll strip the block prefix from all scoped names in the program.
|
||||||
// Also, convert invalid label names (such as "<<<anonymous-1>>>") to something that's allowed.
|
// Also, convert invalid label names (such as "<anon-1>") to something that's allowed.
|
||||||
// Also have to do that for the variablesMarkedForZeropage!
|
// Also have to do that for the variablesMarkedForZeropage!
|
||||||
val newblocks = mutableListOf<IntermediateProgram.ProgramBlock>()
|
val newblocks = mutableListOf<IntermediateProgram.ProgramBlock>()
|
||||||
for(block in program.blocks) {
|
for(block in program.blocks) {
|
||||||
@ -128,7 +128,7 @@ class AsmGen(val options: CompilationOptions, val program: IntermediateProgram,
|
|||||||
scoped
|
scoped
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
name = name.replace("<<<", "prog8_").replace(">>>", "")
|
name = name.replace("<", "prog8_").replace(">", "") // take care of the autogenerated invalid (anon) label names
|
||||||
if(name=="-")
|
if(name=="-")
|
||||||
return "-"
|
return "-"
|
||||||
if(blockLocal)
|
if(blockLocal)
|
||||||
|
Loading…
Reference in New Issue
Block a user