pub fn gram_parse_to_json(input: &str) -> Result<String, String>Expand description
Parse gram notation and return a JSON array string of AstPattern objects.
§Arguments
input- Gram notation text
§Returns
Ok(String)- JSON array of AstPattern objectsErr(String)- Parse error message
§Examples
use gram_codec::json::gram_parse_to_json;
let json = gram_parse_to_json("(alice:Person)").unwrap();
assert!(json.contains("alice"));
assert!(json.contains("Person"));