conlang: Add Tuple-Struct Patterns
- Patterns are no longer parsed with the highest precedence - Function calls with just a path and a tuple of args can now be transformed into a Pattern
This commit is contained in:
@@ -438,13 +438,20 @@ pub mod yamlify {
|
||||
Pattern::Struct(path, items) => {
|
||||
{
|
||||
let mut y = y.key("Struct");
|
||||
y.pair("name", path);
|
||||
y.yaml(path);
|
||||
for (name, item) in items {
|
||||
y.pair(name, item);
|
||||
}
|
||||
}
|
||||
y
|
||||
}
|
||||
Pattern::TupleStruct(path, items) => {
|
||||
{
|
||||
let mut y = y.key("TupleStruct");
|
||||
y.yaml(path).list(items);
|
||||
}
|
||||
y
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user