chore: format

This commit is contained in:
Ryan Chandler 2022-09-12 15:16:07 +01:00
parent fb8915819d
commit d85913665f
No known key found for this signature in database
GPG Key ID: F113BCADDB3B0CCA
2 changed files with 9 additions and 6 deletions

View File

@ -171,7 +171,7 @@ impl Lexer {
self.col += 1;
TokenKind::At
},
}
'!' => {
self.col += 1;

View File

@ -2027,7 +2027,9 @@ fn prefix(op: &TokenKind, rhs: Expression) -> Expression {
kind: op.into(),
value: Box::new(rhs),
},
TokenKind::At => Expression::ErrorSuppress { expr: Box::new(rhs) },
TokenKind::At => Expression::ErrorSuppress {
expr: Box::new(rhs),
},
_ => unreachable!(),
}
}
@ -3162,16 +3164,17 @@ mod tests {
#[test]
fn error_suppress() {
assert_ast("<?php @hello();", &[
expr!(Expression::ErrorSuppress {
assert_ast(
"<?php @hello();",
&[expr!(Expression::ErrorSuppress {
expr: Box::new(Expression::Call {
target: Box::new(Expression::Identifier {
name: "hello".into()
}),
args: vec![],
}),
})
]);
})],
);
}
fn assert_ast(source: &str, expected: &[Statement]) {