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

Cross accumulated goto / labels. #157

Open
graphitemaster opened this issue Sep 29, 2014 · 1 comment
Open

Cross accumulated goto / labels. #157

graphitemaster opened this issue Sep 29, 2014 · 1 comment

Comments

@graphitemaster
Copy link
Owner

The following code doesn't compile

[[accumulate]] void main() {
    goto L2;
    :L1;
    print("hello world!\n");
    goto L3;
}

[[accumulate]] void main() {
    :L2;
    goto L1;
}

[[accumulate]] void main() {
    :L3;
}

It should be treated as

void main() {
    goto L2;
    :L1
    print("hello world!\n");
    goto L3;
    :L2
    goto L1;
    :L3
}

Which does compile

@graphitemaster
Copy link
Owner Author

this requires deferring global lookup until function is fully asssembled

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

No branches or pull requests

1 participant