cl-ast: Cleanup
- Function bind is now one Pattern - TyRef now allows &Ty (i.e. &[i32], &(char, bool) - Range patterns (they cannot bind, only check whether a value is in range - ArrayRep repeat has been reverted to usize, for now, until early consteval is implemented.
This commit is contained in:
@@ -203,7 +203,13 @@ fn exprkind_array_rep(p: &mut Parser) -> PResult<ExprKind> {
|
||||
value: first.into(),
|
||||
repeat: {
|
||||
p.consume_peeked();
|
||||
Box::new(expr(p, 0)?)
|
||||
let value = p.match_type(TokenKind::Literal, Parsing::ArrayRep)?;
|
||||
match value.data() {
|
||||
TokenData::Integer(size) => *size as usize,
|
||||
_ => {
|
||||
Err(p.error(ErrorKind::Unexpected(TokenKind::Literal), Parsing::ArrayRep))?
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
.into(),
|
||||
|
||||
Reference in New Issue
Block a user