From 1a20e911a94ceadc33c2c4c0ae4aa347076804c1 Mon Sep 17 00:00:00 2001 From: alisdair sullivan Date: Thu, 23 Sep 2010 22:22:47 -0700 Subject: [PATCH] was using three different methods to rewrite options to core parser options, switched to just one --- src/jsx_eep0018.erl | 4 +++- src/jsx_verify.erl | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/jsx_eep0018.erl b/src/jsx_eep0018.erl index 54eeb30..ae98602 100644 --- a/src/jsx_eep0018.erl +++ b/src/jsx_eep0018.erl @@ -69,7 +69,9 @@ term_to_json(List, Opts) -> extract_parser_opts(Opts) -> - [ {K, V} || {K, V} <- Opts, lists:member(K, [comments, encoding]) ]. + [ {K, V} || {K, V} <- + Opts, lists:member(K, [comments, encoding, unquoted_keys]) + ]. %% ensure the first jsx event we get is start_object or start_array when running diff --git a/src/jsx_verify.erl b/src/jsx_verify.erl index 7fdd4aa..1777922 100644 --- a/src/jsx_verify.erl +++ b/src/jsx_verify.erl @@ -51,8 +51,10 @@ is_json(JSON, Opts) -> extract_parser_opts(Opts) -> - [ {K, V} || {K, V} <- Opts, lists:member(K, [comments, encoding]) ]. - + [ {K, V} || {K, V} <- + Opts, lists:member(K, [comments, encoding, unquoted_keys]) + ]. + %% enforce only arrays and objects at top level collect_strict({event, start_object, Next}, Keys) ->