parser: minor cleanup of `check()` (#7333)
parent
da9588c1a5
commit
bfa8e4bf86
|
@ -396,15 +396,13 @@ fn (mut p Parser) check(expected token.Kind) {
|
||||||
// for p.tok.kind in [.line_comment, .mline_comment] {
|
// for p.tok.kind in [.line_comment, .mline_comment] {
|
||||||
// p.next()
|
// p.next()
|
||||||
// }
|
// }
|
||||||
if p.tok.kind != expected {
|
if p.tok.kind == expected {
|
||||||
if p.tok.kind == .name {
|
p.next()
|
||||||
p.error('unexpected name `$p.tok.lit`, expecting `$expected.str()`')
|
} else if p.tok.kind == .name {
|
||||||
} else {
|
p.error('unexpected name `$p.tok.lit`, expecting `$expected.str()`')
|
||||||
p.error('unexpected `$p.tok.kind.str()`, expecting `$expected.str()`')
|
} else {
|
||||||
}
|
p.error('unexpected `$p.tok.kind.str()`, expecting `$expected.str()`')
|
||||||
return
|
|
||||||
}
|
}
|
||||||
p.next()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// JS functions can have multiple dots in their name:
|
// JS functions can have multiple dots in their name:
|
||||||
|
|
Loading…
Reference in New Issue