Skip to main content

parse

Function parse 

Source
pub fn parse(text: &str) -> Result<InterfaceLock, LockError>
Expand description

Parses the text of an interfaces.lock.

The malformed shapes, each reported on the first line that shows it (lock design §2): no next line; a next line that does not parse; next less than or equal to an entry’s number; one number on two entries; one live key on two entries; a line that does not parse — a git conflict marker included. Entries may arrive in any order.

The next line is the first line the reader does not skip, and every later line is an entry (plan decision PD-19). A second next N line is therefore the entry of an interface named next, and a hand-edited file with two next lines is still caught: the second one’s number must be below the first one’s, or the file is malformed.