MCPcopy Create free account
hub / github.com/LaBatata101/sith-language-server / eat

Method eat

crates/sith_python_parser/src/parser/mod.rs:378–385  ·  view source on GitHub ↗

Consume the current token if it is of the given kind. Returns `true` if it matches, `false` otherwise.

(&mut self, kind: TokenKind)

Source from the content-addressed store, hash-verified

376 /// Consume the current token if it is of the given kind. Returns `true` if it matches, `false`
377 /// otherwise.
378 fn eat(&mut self, kind: TokenKind) -> bool {
379 if self.at(kind) {
380 self.do_bump(kind);
381 true
382 } else {
383 false
384 }
385 }
386
387 /// Eat the current token if its of the expected kind, otherwise adds an appropriate error.
388 fn expect(&mut self, expected: TokenKind) -> bool {

Calls 2

atMethod · 0.45
do_bumpMethod · 0.45

Tested by

no test coverage detected