Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown label SyntaxError for labels after the return statement #30

Open
mcorne opened this issue May 14, 2020 · 2 comments
Open

Unknown label SyntaxError for labels after the return statement #30

mcorne opened this issue May 14, 2020 · 2 comments

Comments

@mcorne
Copy link

mcorne commented May 14, 2020

I get the following exception when I run the program below:
Exception has occurred: SyntaxError
Unknown label 'a'

from goto import with_goto
@with_goto
def main(x):
    if x == 0:
        goto.a
    return x
    label.a
    x += 1
    return x

Exception has occurred: SyntaxError
Unknown label 'a'
@pamelamei
Copy link

pamelamei commented Jun 21, 2020

from goto import with_goto
@with_goto
def main(x):
    if x == 0:
        goto.a
        return x
    label.a
    x += 1
    return x

You can get w/o error.

@skralg
Copy link

skralg commented Jul 13, 2020

@pamelamei That is not helpful, as it breaks the intended flow of the function. Plug in some values, you'll see the difference.
(I too am having this problem, labels that occur after the return command are not recognized.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants