conlang: Patterns...2!
- Deny arbitrary paths in patterns (only one non-keyword identifier allowed!) - Allow patterns in for-loop binders (literally useless atm, but it's a step toward making patterns the only way to bind names.) Next: Functions, Tuple Struct Patterns... And solving the stupid syntactic ambiguity of structors.
This commit is contained in:
@@ -1037,7 +1037,7 @@ impl Parse<'_> for For {
|
||||
#[rustfmt::skip]
|
||||
fn parse(p: &mut Parser) -> PResult<For> {
|
||||
p.match_type(TokenKind::For, Parsing::For)?;
|
||||
let bind = Sym::parse(p)?;
|
||||
let bind = Pattern::parse(p)?;
|
||||
p.match_type(TokenKind::In, Parsing::For)?;
|
||||
Ok(For {
|
||||
bind,
|
||||
|
||||
Reference in New Issue
Block a user