add enum Bitflags type#58
Open
ZXShady wants to merge 2 commits into
Open
Conversation
this implements the flag enum type that ensures ~, |, &, ^ return the same type.
Owner
|
This is similar to an enhancement that I had planned to work on. I'll review your changes and incorporate to what I had planned when I get the time for it. Bytecode serialization is only guaranteed to be compatible with the same code version, so it is not a problem that this changed. |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is my first time modifying/extending a compiler (actually it is second after modifiying clang to add some poor man UFCS)
So excuse me for the quality of PR.
This adds enum bitflags which are enums with instead of contingous values, it will be conitgious bit flags
this also introduces a minor change to the bytecode format. Any previously saved bytecode to the new 1-byte flag marker. I am not sure if this is fine or should I pack it into some other variable for previous compatability? does angelscript gurantee script bytecode is always the same between major versions?
The test case is not the best but I also went ahead and used this pr in my own engine which uses angelscript and so far no crashes. so I hope it works and is up to the quality and the code format style.