Presets
Input JSON
Benchmark Results & Output
| Metric | PetitParser (Pure Dart) | Native (dart:convert) |
|---|---|---|
| Average Timing: | ||
| Parsed Output: |
## About JSON Parser
The **PetitParser JSON grammar** implements the [ECMA-404 JSON standard](https://www.json.org/) directly as composable Dart parser combinators.
### Key Parser Features
- **Grammar Structure**: Defined using modular rules for objects, arrays, strings with escape sequences, numbers, and boolean/null tokens.
- **Pure Dart Execution**: Operates entirely within Dart bytecode or WebAssembly, enabling runtime inspection, debugging, and AST customization.
- **Extensible Grammar**: Can serve as a template to support custom variants such as JSON5, JSON with comments (JSONC), trailing commas, or alternative number formats.
- **Comparative Benchmark**: Includes a live side-by-side benchmark comparing combinator parsing against platform-native `dart:convert`.