mirror of
https://github.com/irmen/prog8.git
synced 2025-02-28 09:29:26 +00:00
properly report duplicate label names
This commit is contained in:
parent
e34dac8dbb
commit
73fc18099e
@ -108,7 +108,7 @@ internal class AstIdentifiersChecker(private val errors: IErrorReporter,
|
||||
// the builtin functions can't be redefined
|
||||
errors.err("builtin function cannot be redefined", label.position)
|
||||
} else {
|
||||
val existing = label.definingSubroutine?.getAllLabels(label.name) ?: emptyList()
|
||||
val existing = (label.definingSubroutine ?: label.definingBlock).getAllLabels(label.name)
|
||||
for(el in existing) {
|
||||
if(el === label || el.name != label.name)
|
||||
continue
|
||||
|
@ -1,11 +1,25 @@
|
||||
%zeropage basicsafe
|
||||
|
||||
%import textio
|
||||
main {
|
||||
sub start() {
|
||||
ubyte @shared xx
|
||||
str myBar = "main.bar"
|
||||
|
||||
if xx==1 or xx==2 or xx==3 {
|
||||
xx++
|
||||
foo_bar:
|
||||
|
||||
sub start() {
|
||||
txt.print(myBar)
|
||||
txt.print(&foo_bar)
|
||||
return
|
||||
|
||||
quert:
|
||||
quert:
|
||||
quert:
|
||||
quert:
|
||||
|
||||
}
|
||||
|
||||
sub start() {
|
||||
}
|
||||
}
|
||||
foo_bar:
|
||||
foo_bar:
|
||||
foo_bar:
|
||||
foo_bar:
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user