MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / expect

Method expect

crates/ptx/src/parser.rs:24–34  ·  view source on GitHub ↗
(&mut self, kind: TokenKind)

Source from the content-addressed store, hash-verified

22 }
23
24 pub(crate) fn expect(&mut self, kind: TokenKind) -> ParserResult<Token> {
25 match self.next() {
26 None => Err(format!("Expected `{:?}`, but instead the file ended", kind)),
27 Some(Ok(token)) if token.kind == kind => Ok(token),
28 Some(Ok(token)) => Err(format!(
29 "Expected `{:?}`, but instead found `{:?}`",
30 kind, token.kind
31 )),
32 Some(Err(err)) => Err(err),
33 }
34 }
35
36 pub(crate) fn cur_value(&mut self) -> TokenValue {
37 self.lexer.values[self.token_pos]

Callers 15

mainFunction · 0.45
newMethod · 0.45
resizeMethod · 0.45
renderMethod · 0.45
process_eventMethod · 0.45
newMethod · 0.45
infoMethod · 0.45
get_new_path_varFunction · 0.45
invoke_rustcFunction · 0.45
get_last_artifactFunction · 0.45
nameMethod · 0.45
from_ptxMethod · 0.45

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected