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

Add import statements #110

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Add import statements #110

wants to merge 6 commits into from

Conversation

nicopap
Copy link
Owner

@nicopap nicopap commented Nov 10, 2023

  • Add publicity modifier to templates, you can mark them as pub
  • The root statement is now optional
  • Add a use statement to import templates from other files
  • Dependencies are properly handled, so that when you modify a template from any file, all scenes that depend on this template get updated.
  • Closes Chirp use statement #73

Future:

  • Add a base library of templates that can be imported anywhere

We can now use bevy-ui-navigation 0.33 with bevy 0.12, and the chirpunk
example works again.
I settled on an import syntax. It is markedly different from the draft
one. So we needed to change the AST and parser to account for those
changes.
Of course it's broken right now.
- Now templates with a pub prefix are collected in the pub_templates Ast
  struct field
- Now, when parsing, the result may either be a scene or a template
  library.
- Template libraries are mutually exclusive with scene files.
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

Successfully merging this pull request may close these issues.

Chirp use statement
1 participant