-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested
Description
Now that we have more emphasis on testing rust <-> rust, we should support more builtin rust concepts. Tuples are a relatively easy one to start with.
If you want to do this, then I suggest adding a new case to Tydent in the parser, and then chasing the compiler errors (i like using exhaustive matches to make this kind of change accessible):
abi-cafe/kdl-script/src/parse.rs
Lines 153 to 166 in 6a7db03
| /// A type "name" (which may be structural like `[u32; 4]`). | |
| /// | |
| /// It's like an ident but, for types -- a tydent! | |
| #[derive(Debug, Clone)] | |
| pub enum Tydent { | |
| /// A named type (the type checker will resolve this) | |
| Name(Ident), | |
| /// A fixed length array | |
| Array(Box<Spanned<Tydent>>, u64), | |
| /// A by-reference type | |
| Ref(Box<Spanned<Tydent>>), | |
| /// The empty tuple -- `()` | |
| Empty, | |
| } |
Tuples are essentially analogous to arrays, except "get the element type" is done inside the loop instead of outside the loop. So I think everywhere you need to change you'll find some code for handling arrays you can copy and tweak.
You would roughly need to:
- Update the parser to make it a Tydent, parse it
- Update the type system to make it a Ty, type it
- Bonus Chore: update the meme kdlscript interpreter to handle it?
- Update the ValueTree system to spider its fields and generate values for it
- Update the rust backend to initialize/read it
- Update the c backend to bail if it sees it
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested