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

Error when there's syntax after the widget #86

Closed
antoyo opened this issue Jan 6, 2018 · 4 comments
Closed

Error when there's syntax after the widget #86

antoyo opened this issue Jan 6, 2018 · 4 comments

Comments

@antoyo
Copy link
Owner

antoyo commented Jan 6, 2018

Like:

view! {
    gtk::Window {
    },
    delete_event(_, _) => (Quit, Inhibit(false))
}
@zmitchell
Copy link
Contributor

I can take this one. I haven't tested anything, but I'm pretty confident this is a result of only looking at tokens[0] here. I can just check whether the length of tokens is greater than 1, and then respond accordingly.

@antoyo
Copy link
Owner Author

antoyo commented Jan 13, 2018

If you know nom and are interested in doing much more than that, here's an idea that will also fix the issue #27:
I've learned recently that we can parse the syntax with (a version of) nom by implementing the Synom trait.
I guess that this would make the resulting parser way easier and more maintainable than the current manual one and will also fix the position of the error messages.

But if you only prefer to fix this issue, that's also fine. Fixing the whole thing is a lot more work :) .
Thank you.

@zmitchell
Copy link
Contributor

I’ve never used nom, but I just did some reading and I think I can do that. I’ll fix this issue and #67, which I think is also caused by the same problem with tokens, then start on parsing with nom.

@antoyo
Copy link
Owner Author

antoyo commented Jan 14, 2018

If you need any help, I can answer your questions.
Thanks for your help.

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

2 participants