Skip to main content

parse_top_level_assignment

Function parse_top_level_assignment 

Source
fn parse_top_level_assignment(line: &str) -> Option<(&str, &str)>
Expand description

Parse a bare top-level assignment, returning its name and trimmed RHS.

Ignore indented closures and targets containing $, [[ or ::, or a call such as S7::method(...). Backtick-quoted names are returned without the quotes, with escapes kept as emitted. Find the closing backtick before the arrow so replacement names such as `[<-.Foo` parse correctly.