Some more Patterns work
-at first brush, a pattern is like a single Variant with a list of free vars
This commit is contained in:
parent
927f427a86
commit
0a02c21e70
@ -132,7 +132,8 @@ pub struct Guard {
|
||||
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
pub struct Pattern {
|
||||
|
||||
pub free_vars: Vec<Rc<String>>,
|
||||
pub var: Variant,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
|
@ -678,7 +678,10 @@ impl Parser {
|
||||
|
||||
parse_method!(pattern(&mut self) -> ParseResult<Pattern> {
|
||||
let identifier = self.identifier()?;
|
||||
Ok(Pattern { })
|
||||
Ok(Pattern {
|
||||
free_vars: vec![],
|
||||
var: Variant::UnitStruct(identifier)
|
||||
})
|
||||
});
|
||||
|
||||
parse_method!(block(&mut self) -> ParseResult<Block> {
|
||||
|
Loading…
Reference in New Issue
Block a user