anchor.diff:  digit_next(Stream, Acc, exponent) ->
       float_end(Stream, Acc).
   
  -
  +%%=============================================================================
  +%% Unit tests
  +%%=============================================================================
  +encode_string_test() ->
  +    ?assertMatch("\"Hello\"", lists:flatten(encode({string, "Hello"}))),
  +    ?assertMatch("\"hello\"", lists:flatten(encode('hello'))).
  +
  +encode_number_test() ->
  +    ?assertMatch("430", lists:flatten(encode(430))),
  +    ?assertMatch("4303432", lists:flatten(encode(4303432))),
  +    ?assertMatch("4.30000000000000000000e+01", lists:flatten(encode(43.00))),
  +    ?assertMatch("3.22232219999999983884e+02", 
  +                 lists:flatten(encode(322.23222))).
  +
  +encode_array_test() ->
  +    ?assertMatch("[33,43,53]", lists:flatten(encode([33, 43, 53]))),
  +    ?assertMatch("[\"String\",34,\"song\"]", lists:flatten(encode([{string, 
  +                                                                    "String"},
  +                                                                   34, 
  +                                                                   song]))),
  +    ?assertMatch("[{\"Goodbye\":true,\"Hello\":44},43,54]",
  +                 lists:flatten(encode([[{{string, "Hello"}, 44},
  +                                        {{string, "Goodbye"}, true}],
  +                                       43, 54]))).
  +
  +encode_object_test() ->
  +    ?assertMatch("{\"Hello\":\"Hel\",\"Super\":421}",
  +                 lists:flatten(encode([{{string, "Super"}, 421},
  +                                {'Hello','Hel'}]))).
  +
  +
  +
  +number_test() ->
  +    ?assertMatch({44, []}, value("44")),
  +    ?assertMatch({-44, []}, value("-44")),
  +    ?assertMatch({44.00, []}, value("44.00")),
  +    ?assertMatch({-44.01, []}, value("-44.01")),
  +    ?assertMatch({44.00e+33, []}, value("44.00e+33")),
  +    ?assertMatch({44.00e33, []}, value("44.00e33")),
  +    ?assertMatch({44.00e-10, []}, value("44.00e-10")),
  +    ?assertMatch({42.44, []}, value("42.44")),
  +    ?assertMatch({41.33, []}, value("41.33")),
  +    ?assertMatch({0, []}, value("0")).
  +
  +
  +string_test() ->
  +    ?assertMatch({"Hello World", []},
  +                 value("\"Hello World\"")),
  +    ?assertMatch({"Hello\n World", []},
  +                 value("\"Hello\n World\"")),
  +    ?assertMatch({"Hello\" World", []},
  +                 value("\"Hello\\\" World\"")),
  +    ?assertMatch({"Hello\\ World", []},
  +                 value("\"Hello\\ World\"")),
  +    ?assertMatch({"Hello\/ World", []},
  +                 value("\"Hello\/ World\"")),
  +    ?assertMatch({"Hello\b World", []},
  +                 value("\"Hello\b World\"")),
  +    ?assertMatch({"Hello\f World", []},
  +                 value("\"Hello\f World\"")),
  +    ?assertMatch({"Hello\n World", []},
  +                 value("\"Hello\n World\"")),
  +    ?assertMatch({"Hello\r World", []},
  +                 value("\"Hello\r World\"")),
  +    ?assertMatch({"Hello\t World", []},
  +                 value("\"Hello\t World\"")),
  +    ?assertMatch({"Hello% World", []},
  +                 value("\"Hello\\u0025 World\"")).
  +
  +boolean_test() ->
  +    ?assertMatch({true, []}, value("true")),
  +    ?assertMatch({false, []}, value("false")).
  +
  +null_test() ->
  +    ?assertMatch({null, []}, value("null")).
  +
  +ident_test() ->
  +    ?assertMatch({"Hello", []}, value("Hello")),
  +    ?assertMatch({"boo88", []}, value("boo88")),
  +    ?assertMatch({"bock", [$:]}, value("bock:")),
  +    ?assertMatch({"bock", [${]}, value("bock{")),
  +    ?assertMatch({"bock", [$[]}, value("bock[")).
  +
  +
  +glossary_test() ->
  +    ?assertMatch({[{"glossary",
  +                   [{"GlossDiv",
  +                     [{"GlossList",
  +                       [{"GlossEntry",
  +                         [{"GlossSee","markup"},
  +                          {"GlossDef",
  +                           [{"GlossSeeAlso",["GML","XML"]},
  +                            {"para","A meta-mars DocBook."}]},
  +                          {"Abbrev","ISO 8879:1986"},
  +                          {"Acronym","SGML"},
  +                          {"GlossTerm","Standareralized"},
  +                          {"SortAs","SGML"},
  +                          {"ID","SGML"}]}]},
  +                      {"title","S"}]},
  +                    {"title","example glossary"}]}],
  +                  []},  
  +                 value("{ "   
  +                      "\"glossary\": { "
  +                      "  \"title\": \"example glossary\","
  +                      " \"GlossDiv\": {"
  +                      "      \"title\": \"S\", "
  +                      "  \"GlossList\": { "
  +                      "          \"GlossEntry\": {"
  +                      "              \"ID\": \"SGML\","
  +                      "            \"SortAs\": \"SGML\","
  +                      "            \"GlossTerm\": \"Standareralized\", "
  +                      "            \"Acronym\": \"SGML\", "
  +                      "            \"Abbrev\": \"ISO 8879:1986\","
  +                      "            \"GlossDef\": { "
  +                      "                  \"para\": \"A meta-mars DocBook.\", "
  +                      "             \"GlossSeeAlso\": [\"GML\", \"XML\"]"
  +                      "             },"
  +                      "            \"GlossSee\": \"markup\" "
  +                      "          }"
  +                      "      }"
  +                      "  }"
  +                      "}}")).
  +
  +menu_test() ->
  +    ?assertMatch({[{"menu",
  +                    [{"popup",
  +                      [{"menuitem",
  +                        [[{"onclick","CreateNewDoc()"},
  +                          {"value","New"}],
  +                         [{"onclick","OpenDoc()"},
  +                          {"value","Open"}],
  +                         [{"onclick","CloseDoc()"},
  +                          {"value","Close"}]]}]},
  +                     {"value","File"},
  +                     {"id","file"}]}],
  +                  []},
  +      value("{\"menu\": {"
  +            "  \"id\": \"file\","
  +            "  \"value\": \"File\","
  +            "  \"popup\": {"
  +            "      \"menuitem\": ["
  +            "          {\"value\": \"New\", \"onclick\": \"CreateNewDoc()\"}, "
  +            "          {\"value\": \"Open\", \"onclick\": \"OpenDoc()\"},"
  +            "          {\"value\": \"Close\", \"onclick\": \"CloseDoc()\"} "
  +            "                    ]"
  +            "   }"
  +            "}}")).
  +
  +widget_test() ->
  +    ?assertMatch({[{"widget",
  +                    [{"text",
  +                      [{"onMouseUp","sun1.opacity = (sun1.opacity / 100) * 90;"},
  +                       {"alignment","center"},
  +                       {"vOffset",100},
  +                       {"hOffset",250},
  +                       {"name","text1"},
  +                       {"style","bold"},
  +                       {"size",36},
  +      {"data","Click Here"}]},
  +                     {"image",
  +                      [{"alignment","center"},
  +                       {"vOffset",250},
  +                       {"hOffset",250},
  +                       {"name","sun1"},
  +                       {"src","Images/Sun.png"}]},
  +                     {"window",
  +                      [{"height",500},
  +                       {"width",500},
  +                       {"name","main_window"},
  +                       {"title","Sample Konfabulator Widget"}]},
  +                     {"debug","on"}]}],
  +                  []},
  +                 
  +                 value("{\"widget\": {"
  +                       "    debug: on,"
  +                       "    window: {"
  +                       "        title: \"Sample Konfabulator Widget\","
  +                       "        name: \"main_window\","
  +                       "        \"width\": 500,"
  +                       "        \"height\": 500"
  +                       "    },"
  +                       "    \"image\": { "
  +                       "        \"src\": \"Images/Sun.png\","
  +                       "        \"name\": \"sun1\","
  +                       "        \"hOffset\": 250,"
  +                       "        \"vOffset\": 250,"
  +                       "        \"alignment\": \"center\""
  +                       "    },"
  +                       "    \"text\": {"
  +                       "        \"data\": \"Click Here\","
  +                       "        \"size\": 36,"
  +                       "        \"style\": \"bold\","
  +                       "        \"name\": \"text1\","
  +                       "        \"hOffset\": 250,"
  +                       "        \"vOffset\": 100,"
  +                       "        \"alignment\": \"center\","
  +                       "        \"onMouseUp\": \"sun1.opacity = (sun1.opacity / 100) * 90;\""
  +                       "    }"
  +                       "}}")).  
  +
  
positive.code: digit19(Else, Acc) ->
      decimal(Else, Acc).
  
  digit([$0 | T], Acc, Next) ->
      digit(T, [$0 | Acc], Next);
  digit([$1 | T], Acc, Next) ->
  
negative.code:     digit(T, [$-, $e | Acc], exponent);
  exponent([$E, $- | T], Acc) ->
      digit(T, [$-, $E | Acc], exponent);
  exponent([$E | T], Acc) ->
      digit(T, [$E | Acc], exponent);
  exponent([$e | T], Acc) ->
      digit(T, [$e | Acc], exponent);
  exponent(Stream, Acc) ->
      float_end(Stream, Acc).
  
  integer_end(Stream, Acc) ->
      {list_to_integer(lists:reverse(Acc)), Stream}.
  
  
  float_end(Stream, Acc) ->
      {list_to_float(lists:reverse(Acc)), Stream}.
  
  
  
  digit_next(Stream, Acc, front) ->
      decimal(Stream, Acc);
  digit_next(Stream, Acc, decimal) ->
  