MCPcopy Create free account
hub / github.com/SeaQL/FireDBG.for.Rust / parse_body_loc_end

Function parse_body_loc_end

parser/src/parsing/source.rs:96–106  ·  view source on GitHub ↗

Parse the line and column number of function block. A function block is wrapped in a pair of braces, i.e. `{ ... }` 1. If the function block is empty, this function will return the result of [parse_body_loc_start] function 2. If the function block has statement in it, this function will return the line and column number of the beginning of first statement. ```compile_fail fn hello_3(world: &Wo

(block: &syn::Block)

Source from the content-addressed store, hash-verified

94/// }
95/// ```
96fn parse_body_loc_end(block: &syn::Block) -> LineColumn {
97 let mut loc = parse_body_loc_start(block);
98 if let Some(first_stmt) = block.stmts.first() {
99 let mut first_stmt_loc: LineColumn = first_stmt.span().start().into_loc();
100 if let Some(col) = first_stmt_loc.column.as_mut() {
101 *col += 1;
102 }
103 loc = first_stmt_loc;
104 }
105 loc
106}
107
108pub(crate) trait IntoLineColumn {
109 fn into_loc(self) -> LineColumn;

Callers 1

parse_body_locFunction · 0.85

Calls 5

parse_body_loc_startFunction · 0.85
firstMethod · 0.80
into_locMethod · 0.80
startMethod · 0.80
spanMethod · 0.80

Tested by

no test coverage detected