-
Notifications
You must be signed in to change notification settings - Fork 3
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
Way to represent repetition until terminator #2
Comments
@type binary("utf8")
def_native("delimited_string") {
argument("terminator", match: "\x00");
}; Or maybe |
I think you misunderstand what argument for native types does. It declares a slot where you can pass an argument when using the type. |
Is this thing needed? May be cstring should be implemented in native instead of defining it? |
@creeplays Sure, cstring would probably be implemented as a native type. The reason we need this is mainly because of other things. An example of this is the NBT format, where a compound tag is a list of named values until a terminator tag. |
What about implementing new syntax for this? array(terminator: "0") => container {}; |
That would work for that one specific case, but it's not a general solution, and it doesn't scale to other things. For it to be a truly general solution, it would need to compose well with the other parts of the language. |
Fix compilation with wasm32-unknown-unknown
No description provided.
The text was updated successfully, but these errors were encountered: