Function jsonc_parser::parse_to_ast [−][src]
pub fn parse_to_ast<'a>(
text: &'a str,
options: &ParseOptions
) -> Result<ParseResult<'a>, ParseError>
Parses a string containing JSONC to an AST with comments and tokens.
Example
use jsonc_parser::{parse_to_ast, ParseOptions}; let parse_result = parse_to_ast(r#"{ "test": 5 } // test"#, &ParseOptions { comments: true, // include comments in result tokens: true, // include tokens in result }).expect("Should parse."); // ...inspect parse_result for value, tokens, and comments here...