mirror of
https://github.com/danog/parser.git
synced 2025-01-22 21:11:55 +01:00
chore: format
This commit is contained in:
parent
7bac78f039
commit
4f795e94bc
@ -179,14 +179,14 @@ impl Parser {
|
||||
self.semi()?;
|
||||
|
||||
Statement::Goto { label }
|
||||
},
|
||||
}
|
||||
TokenKind::Identifier(_) if self.peek.kind == TokenKind::Colon => {
|
||||
let label = self.ident()?.into();
|
||||
|
||||
expect!(self, TokenKind::Colon, "expected :");
|
||||
|
||||
Statement::Label { label }
|
||||
},
|
||||
}
|
||||
TokenKind::HaltCompiler => {
|
||||
self.next();
|
||||
|
||||
@ -4096,16 +4096,12 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn simple_goto() {
|
||||
assert_ast("<?php goto a;", &[
|
||||
Statement::Goto { label: "a".into() }
|
||||
]);
|
||||
assert_ast("<?php goto a;", &[Statement::Goto { label: "a".into() }]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn label() {
|
||||
assert_ast("<?php a:", &[
|
||||
Statement::Label { label: "a".into() }
|
||||
]);
|
||||
assert_ast("<?php a:", &[Statement::Label { label: "a".into() }]);
|
||||
}
|
||||
|
||||
fn assert_ast(source: &str, expected: &[Statement]) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user