MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / optional_srcloc

Method optional_srcloc

cranelift/reader/src/parser.rs:940–952  ·  view source on GitHub ↗

Parse an optional source location. Return an optional source location if no real location is present.

(&mut self)

Source from the content-addressed store, hash-verified

938 ///
939 /// Return an optional source location if no real location is present.
940 fn optional_srcloc(&mut self) -> ParseResult<ir::SourceLoc> {
941 if let Some(Token::SourceLoc(text)) = self.token() {
942 match u32::from_str_radix(text, 16) {
943 Ok(num) => {
944 self.consume();
945 Ok(ir::SourceLoc::new(num))
946 }
947 Err(_) => return err!(self.loc, "invalid source location: {}", text),
948 }
949 } else {
950 Ok(Default::default())
951 }
952 }
953
954 /// Parse an optional list of debug tags.
955 fn optional_debug_tags(&mut self) -> ParseResult<Vec<DebugTag>> {

Callers 1

parse_basic_blockMethod · 0.80

Calls 4

OkFunction · 0.85
tokenMethod · 0.80
newFunction · 0.50
consumeMethod · 0.45

Tested by

no test coverage detected