pub fn path(parser: &mut Tabnas) -> Result<(), GrammarError>Expand description
Install the plugin: register the lifecycle hooks and declare the hooked rules so the engine wires them.
Install the host grammar first, then Path, so the hooks land on rules that already exist. Installed on a bare engine it creates the five rules empty, and a grammar installed afterwards extends them.
let mut parser = tabnas::Tabnas::new();
tabnas_json::json(&mut parser).unwrap();
tabnas_path::path(&mut parser).unwrap();
// The plugin adds no alternates, so the grammar parses as before.
assert_eq!(
parser.parse(r#"{"a":[1,2]}"#).unwrap().to_json(),
serde_json::json!({"a": [1.0, 2.0]})
);