-
-
Notifications
You must be signed in to change notification settings - Fork 82
fix: block macro speedup
#292
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
base: master
Are you sure you want to change the base?
Conversation
this commit adds build.rs which makes phf map allowing to speed up the calculation of the blockid
this commit adds placeholder feature and restructures the parsing to allow _ and ident in property's value.
this follows Struct patterns more closely
updates phf to 0.13 and makes block makro use workspace version
9123abb to
39ceafc
Compare
updates phf to 0.13 and makes block makro use workspace version
| use ferrumc_macros::block; | ||
| #[derive(Debug, PartialEq, Eq)] | ||
| struct BlockStateId(u32); | ||
| #[cfg(false)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was a test what uses all blockstates but you said i shouldn't add it since it's too long to compile, it's useful for me to check itacro is working but it also generates a lot of unnecessary functions so I disable it completely
| /// If the block or properties are invalid, a compile-time error will be thrown that should hopefully | ||
| /// explain the issue. | ||
| /// # Static block | ||
| /// gives a single block pat. Mainly used with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some examples with what you mean by this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess it's showing the distinction between having block with and without properties, if it has any properties they must be used or skiped explicitly, similar to how mattern matching works on structs I don't really know what to write here
this pr adds optimisations and syntax improvements for the
block!macro