# # This example shows how to write a basic JSON parser # # The code is short and clear, but has good performance. # import sys from lark import Lark, inline_args, Transformer json_grammar = r""" ?start: value ?value: object | array | string | number | "true" -> true | "false" -> false | "null" -> null array : "[" [value ("," value)*] "]" object : "{" [pair ("," pair)*] "}" pair : string ":" value number : /-?\d+(\.\d+)?([eE][+-]?\d+)?/ string : /".*?(?