json - how to write lex file for input like "{\"a\":1,\"b\":2}" -
i want implement json parser, having problem parse object "{\"a\":1,\"b\":2}", parser output somthing
'(json (object "{" (kvpair "\"a\":1,\"b\"" ":" (json (number "2"))) "}"))
but want is
'(json (object "{" (kvpair "\"a\"" ":" (json (number "1"))) "," (kvpair "\"b\"" ":" (json (number "2"))) "}"))
i using #lang ragg , parser-tools/lex, how can write lex rules can right output. source_code
change rule string-literal
in lex.rkt
to:
[string-literal (:: #\" (:* char-literal1) #\")]
note added 1.
Comments
Post a Comment