Permalink
Browse files

fix plt build failure.

  • Loading branch information...
1 parent 6f1b10e commit 0a95eb8c98e9ddfc1e2016fe750c97b0fb6fa9c3 @hio committed Mar 26, 2012
Showing with 16 additions and 9 deletions.
  1. +4 −1 Makefile
  2. +4 −0 rebar.config
  3. +8 −8 src/json.erl
View
@@ -6,6 +6,8 @@ top_builddir := `pwd`
PACKAGE_VERNAME=json-0.0.1
ERL=erl
+DIALYZER=dialyzer
+DIALYZER_FLAGS=
erl_lib_dir := $(shell $(ERL) -noinput -eval 'io:format("~s",[code:lib_dir()]), init:stop()')
INSTALL = install
@@ -26,10 +28,11 @@ check: test/etap.beam test/util.beam
./rebar eunit
ERL_FLAGS="-pa ./ebin" JSON_NIF_DIR=$(top_builddir)/priv \
prove test/*.t
+ $(DIALYZER) $(DIALYZER_FLAGS) --build_plt --output_plt json.plt ebin/json.beam >json.log 2>&1 || { e=$$?; cat json.log; exit $$e; }
clean:
./rebar clean
- rm -f test/*.beam
+ rm -f test/*.beam json.plt json.log
doc:
./rebar doc
View
@@ -17,6 +17,10 @@
{preprocess, true}
]}.
+{erl_opts, [
+ debug_info
+]}.
+
{port_sources, ["c_src/*.c", "c_src/yajl/*.c"]}.
{so_name, "json.so"}.
View
@@ -11,10 +11,10 @@
-export_type([decode_options/0]).
-export_type([encode_error/0]).
-export_type([json_array/0]).
--export_type([json_array/1]).
+-export_type([json_array_t/1]).
-export_type([json_number/0]).
-export_type([json_object/0]).
--export_type([json_object/1]).
+-export_type([json_object_t/1]).
-export_type([json_primary/0]).
-export_type([json_string/0]).
-export_type([key/0]).
@@ -29,8 +29,8 @@
% ----------------------------------------------------------------------------
-type value() :: json_primary()
- | json_object([{key(), value()}])
- | json_array(value()) .
+ | json_object_t([{key(), value()}])
+ | json_array_t(value()) .
%% any type of json value.
-type json_string() :: unicode:unicode_binary().
@@ -47,16 +47,16 @@
-type key() :: json_string() | atom().
%% key of object value. key() is mostly binary(), but it may be in atom() depended on key_decode option.
--type json_object(Pairs) :: {Pairs}.
+-type json_object_t(Pairs) :: {Pairs}.
%% json object value is represented in erlang tuple which contains single proplist style value.
--type json_object() :: json_object([{key(),value()}]).
+-type json_object() :: json_object_t([{key(),value()}]).
%% json object.
--type json_array(T) :: [T].
+-type json_array_t(T) :: [T].
%% json array value is represented in erlang array term.
--type json_array() :: json_array(value()).
+-type json_array() :: json_array_t(value()).
%% json array value is represented in erlang array term.
-type text() :: unicode:chardata().

0 comments on commit 0a95eb8

Please sign in to comment.