Permalink
Browse files

(piqi) Internal improvements

Rename piqi.org/ top-level directory to piqi/ and fix some minor problems in
"piqic erlang' and tests.
  • Loading branch information...
1 parent fb1e336 commit 88557f46854e83f2f54e6ec18783226d1dde20ab @alavrik committed Sep 16, 2012
Showing with 55 additions and 60 deletions.
  1. +1 −1 piqi-erlang/src/Makefile
  2. +1 −1 piqi-erlang/src/piqi-rpc.piqi
  3. +1 −1 piqi-tools/piqi-rpc.piqi
  4. 0 {piqi.org → piqi}/Makefile
  5. 0 {piqi.org → piqi}/piqi-lang.piqi
  6. 0 {piqi.org → piqi}/piqi-rpc.piqi
  7. 0 {piqi.org → piqi}/piqi.getopt.piqi
  8. 0 {piqi.org → piqi}/piqi.json.piqi
  9. 0 {piqi.org → piqi}/piqi.piq.piqi
  10. 0 {piqi.org → piqi}/piqi.piqi
  11. 0 {piqi.org → piqi}/piqi.protobuf-wire.piqi
  12. 0 {piqi.org → piqi}/piqi.protobuf.piqi
  13. +1 −1 piqic/piqi-lang.ocaml.piqi
  14. +1 −1 piqic/piqi-lang.piqi
  15. +1 −1 piqic/piqi.erlang-extensions.piqi
  16. +1 −1 piqic/piqi.erlang.piqi
  17. +1 −1 piqic/piqi.ocaml-extensions.piqi
  18. +1 −1 piqic/piqi.ocaml.piqi
  19. +1 −1 piqic/piqi.piqi
  20. +1 −3 piqic/piqic_common.ml
  21. +1 −1 piqic/piqic_erlang_defaults.ml
  22. +1 −1 piqic/piqic_erlang_in.ml
  23. +1 −1 piqic/piqic_erlang_out.ml
  24. +1 −1 piqic/piqic_erlang_types.ml
  25. +1 −1 piqicc/piqi-lang.piqi
  26. +1 −1 piqicc/piqi.piqi
  27. +4 −4 piqicc/piqicc.ml
  28. +1 −1 piqilib/piqi-impl.piqi
  29. +0 −1 piqilib/piqi-lang.piqi
  30. +1 −0 piqilib/piqi-lang.piqi
  31. +4 −4 piqilib/piqi.ml
  32. +1 −1 piqilib/piqi.piqi
  33. +2 −2 piqilib/piqi_common.ml
  34. +1 −1 tests/Makefile
  35. +1 −1 tests/cpp/README
  36. +1 −1 tests/cpp/piqi.piqi
  37. +6 −6 tests/erlang_perf/Makefile
  38. +3 −3 tests/erlang_perf/Makefile.erlang
  39. +3 −3 tests/erlang_perf/test.erl
  40. +1 −1 tests/erlang_piqi/README
  41. +1 −1 tests/erlang_piqi/piqi.piqi
  42. +1 −1 tests/ocaml_perf/Makefile
  43. +1 −1 tests/ocaml_perf/piqi.piqi
  44. +1 −1 tests/ocaml_piqi/Makefile
  45. +1 −1 tests/ocaml_piqi/README
  46. +1 −1 tests/ocaml_piqi/piqi.piqi
  47. +0 −1 tests/piqi.org
  48. +0 −3 tests/piqi_misc/piqast.piqi
  49. +1 −1 tests/piqi_misc/piqobj.piqi
  50. +1 −1 tests/piqi_server/test_piqi_server
  51. +1 −0 tests/self_spec
View
@@ -25,7 +25,7 @@ ERLC_FLAGS += -I ../include
PIQIC = piqic
-PIQIC_FLAGS =
+PIQIC_FLAGS = --gen-defaults
PIQI_FILES = piqi-rpc.piqi piqi-tools.piqi piqi.piqi
View
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
-.include [ .module piqi.org/piqi-lang ]
+.include [ .module piqi/piqi-lang ]
.extend [
View
@@ -1,4 +1,4 @@
-.include [ .module piqi.org/piqi-lang ]
+.include [ .module piqi/piqi-lang ]
.include [ .module piqic/piqi ]
.include [ .module piqic/piqi-lang.ocaml ]
@@ -1,5 +1,5 @@
-.include [ .module piqi.org/piqi ]
+.include [ .module piqi/piqi ]
.include [ .module piqic/piqi.erlang ]
View
@@ -1,5 +1,5 @@
-.include [ .module piqi.org/piqi ]
+.include [ .module piqi/piqi ]
%
@@ -1,6 +1,6 @@
-.include [ .module piqi.org/piqi ]
+.include [ .module piqi/piqi ]
.include [ .module piqic/piqi.ocaml ]
View
@@ -1,5 +1,5 @@
-.include [ .module piqi.org/piqi ]
+.include [ .module piqi/piqi ]
%
View
@@ -1,5 +1,5 @@
-.include [ .module piqi.org/piqi ]
+.include [ .module piqi/piqi ]
% Piqi compiler currently supports Piqi dialect based on the following language
View
@@ -53,7 +53,7 @@ let depends_on_piqi_any = ref false
(* indication whether the module that is being processed is a Piqi self-spec,
- * i.e. it is "piqi.org/piqtype" or includes it *)
+ * i.e. the module's name is "piqi" or it includes another module named "piqi"*)
let is_self_spec = ref false
@@ -99,8 +99,6 @@ let piqic_common piqi =
* in order to avoid unnecessary dependency on Piqtype module *)
depends_on_piqi_any := Piqi_common.depends_on_piqi_any piqi;
- (* indication whether the module that is being processed is a Piqi self-spec,
- * i.e. it is "piqi.org/piqi" or includes it *)
if not !is_self_spec
then is_self_spec := Piqi_common.is_self_spec piqi;
@@ -35,7 +35,7 @@ let gen_default_type erlang_type wire_type x =
| `any ->
if !Piqic_common.is_self_spec
then ios "default_" ^^ ios !any_erlname ^^ ios "()"
- else ios "piqi_piqi:default_any()"
+ else ios "piqi_piqi:default_piqi_any()"
| (#T.typedef as x) ->
let modname = gen_parent x in
modname ^^ ios "default_" ^^ ios (typedef_erlname x) ^^ ios "()"
View
@@ -46,7 +46,7 @@ let rec gen_parse_type erlang_type wire_type wire_packed x =
| `any ->
if !Piqic_common.is_self_spec
then ios "parse_" ^^ ios !any_erlname
- else ios "piqi_piqi:parse_any"
+ else ios "piqi_piqi:parse_piqi_any"
| `alias a when wire_type <> None ->
(* need special handing for wire_type override *)
gen_parse_type a.A#erlang_type wire_type wire_packed (some_of a.A#piqtype)
@@ -54,7 +54,7 @@ let rec gen_gen_type erlang_type wire_type wire_packed x =
| `any ->
if !Piqic_common.is_self_spec
then ios "gen_" ^^ ios !any_erlname
- else ios "piqi_piqi:gen_any"
+ else ios "piqi_piqi:gen_piqi_any"
| `alias a when wire_type <> None ->
(* need special handing for wire_type override *)
gen_gen_type a.A#erlang_type wire_type wire_packed (some_of a.A#piqtype)
@@ -286,7 +286,7 @@ let gen_imports l =
let l = List.map gen_import l in
let piqtype_incl =
if !Piqic_common.depends_on_piqi_any && not !Piqic_common.is_self_spec
- then ios "-include(\"piqi_piqi.hrl\").\n\n"
+ then ios "-include_lib(\"piqi/include/piqi_piqi.hrl\").\n\n"
else iol []
in
iol [
View
@@ -1,4 +1,4 @@
-.include [ .module piqi.org/piqi-lang ]
+.include [ .module piqi/piqi-lang ]
% Piqi compiler compiler (piqicc) produces OCaml code, therefore it has to
% support OCaml-specific extensions.
View
@@ -1 +1 @@
-.include [ .module piqi.org/piqi ]
+.include [ .module piqi/piqi ]
View
@@ -55,14 +55,14 @@ let piqicc ch spec_fname lang_fname impl_fname =
(* find the Piqi module that corresponds to the Piqi language
* self-specification -- a basic input sanity check *)
let _ =
- try Piqi_db.find_piqi "piqi.org/piqi-lang"
+ try Piqi_db.find_piqi "piqi/piqi-lang"
with Not_found ->
- piqi_error "missing module piqi.org/piqi-lang"
+ piqi_error "missing module piqi/piqi-lang"
in
let _ =
- try Piqi_db.find_piqi "piqi.org/piqi"
+ try Piqi_db.find_piqi "piqi/piqi"
with Not_found ->
- piqi_error "missing imported module piqi.org/piqi"
+ piqi_error "missing imported module piqi/piqi"
in
(* convert piqi to binobj using piqi self-definition that we've just loaded *)
let piqi_def = Piqi_db.find_local_typedef piqi_lang.P#resolved_typedef "piqi" in
View
@@ -1,5 +1,5 @@
-.include [ .module piqi.org/piqi-lang ]
+.include [ .module piqi/piqi-lang ]
% we need OCaml names and built-in types definitions that map to OCaml types
% correctly
View
View
@@ -0,0 +1 @@
+.include [ .module piqi/piqi-lang ]
View
@@ -1583,7 +1583,7 @@ let rec process_piqi ?modname ?(include_path=[]) ?(fname="") ?(ast: piq_ast opti
extended_defs
in
- (* if the module includes (or is itself) piqi.org/piqi, use hash-based field
+ (* if the module includes (or is itself) "piqi", use hash-based field
* and option codes instead of auto-enumerated ones
*
* NOTE: code assignment is needed only for .piqi, Piqi specifications encoded
@@ -1791,7 +1791,7 @@ let piqi_loader ?modname fname =
load_piqi_file ?modname fname
-let embedded_modname = "embedded/piqi.org/piqi-lang"
+let embedded_modname = "embedded/piqi-lang"
let find_embedded_piqtype name =
@@ -1819,7 +1819,7 @@ let boot () =
C.builtin_typedefs := List.filter C.is_builtin_def spec.P#resolved_typedef;
(* add the self-spec to the DB under a special name *)
- spec.P#modname <- Some "embedded/piqi.org/piqi";
+ spec.P#modname <- Some "embedded/piqi";
Piqi_db.add_piqi spec;
(* add the self-spec to the DB under a special name *)
@@ -1829,7 +1829,7 @@ let boot () =
(* resolved type definition for the Piqi language *)
piqi_lang_def := find_embedded_piqtype "piqi";
(* resolved type definition for the Piqi specification *)
- piqi_spec_def := Piqi_db.find_piqtype "embedded/piqi.org/piqi/piqi";
+ piqi_spec_def := Piqi_db.find_piqtype "embedded/piqi/piqi";
(* resolved "typedef" type definition *)
typedef_def := find_embedded_piqtype "typedef";
field_def := find_embedded_piqtype "field";
View
@@ -1 +1 @@
-.include [ piqi.org/piqi ]
+.include [ piqi/piqi ]
View
@@ -213,8 +213,8 @@ let is_container_type t =
| _ -> false
-(* check if the module is a Piqi self-specification, i.e. it is
- * "piqi.org/piqi" or includes it *)
+(* check if the module is a Piqi self-specification, i.e. the module's name is
+ * "piqi" or it includes another module named "piqi" *)
let is_self_spec (piqi: T.piqi) =
(* XXX: cache this information to avoid computing it over and over again *)
List.exists
View
@@ -36,7 +36,7 @@ DIRS_OCAML = \
DIRS = \
examples \
- piqi.org \
+ self_spec \
piqi_misc \
piqi_server \
$(DIRS_OCAML) \
View
@@ -1,5 +1,5 @@
-Convert complex piqi specification "piqi.org/piqi.piqi" to .proto.
+Convert complex piqi specification "piqi/piqi.piqi" to .proto.
Then build a C++ program which reads and dumps a serialized binary object using
Protocol Buffers library. The binary object used as the test input is a
View
@@ -1 +1 @@
-.include [ .module piqi.org/piqi ]
+.include [ .module piqi/piqi ]
View
@@ -4,19 +4,19 @@
all: erlang test
-erlang: piqi.piqi
+erlang: piqi_obj.piqi
$(MAKE) -f Makefile.erlang
-piqi.piqi: ../../piqi.org/piqi.piqi
- piqi expand -I ../../piqi.org $< >$@
+piqi_obj.piqi: ../../piqi/piqi.piqi
+ piqi expand $< >$@
test: erlang
piqi convert -t pb addressbook.piq
- echo ":piqi/piqi [" > piqi.piq
- cat piqi.piqi >> piqi.piq
+ echo ":piqi_obj/piqi [" > piqi.piq
+ cat piqi_obj.piqi >> piqi.piq
echo "]" >> piqi.piq
piqi convert --add-defaults -t pb --no-warnings piqi.piq
@@ -25,5 +25,5 @@ test: erlang
clean:
$(MAKE) -f Makefile.erlang clean
- rm -f addressbook.piq.pb piqi.*
+ rm -f addressbook.piq.pb piqi.* piqi_obj.*
@@ -14,16 +14,16 @@ PIQIC = piqic-erlang-ext
PIQIC_FLAGS = --no-warnings
-PIQI_FILES = addressbook.proto.piqi piqi.piqi
+PIQI_FILES = addressbook.proto.piqi piqi_obj.piqi
PIQI_ERL_FILES = \
addressbook_piqi.erl addressbook_piqi_ext.erl \
- piqi_piqi.erl piqi_piqi_ext.erl
+ piqi_obj_piqi.erl piqi_obj_piqi_ext.erl
PIQI_HRL_FILES = \
addressbook_piqi.hrl \
- piqi_piqi.hrl
+ piqi_obj_piqi.hrl
PIQI_ERLANG_FILES = $(PIQI_ERL_FILES) $(PIQI_HRL_FILES)
@@ -2,7 +2,7 @@
-compile(export_all).
-include("addressbook_piqi.hrl").
--include("piqi_piqi.hrl").
+-include("piqi_obj_piqi.hrl").
main() ->
@@ -61,8 +61,8 @@ test_piqi() ->
% Read the Piqi-self specification encoded in Protobuf format
{ok, Bytes} = file:read_file(Filename),
- Reader = fun piqi_piqi_ext:parse_piqi/2,
- Writer = fun piqi_piqi_ext:gen_piqi/2,
+ Reader = fun piqi_obj_piqi_ext:parse_piqi/2,
+ Writer = fun piqi_obj_piqi_ext:gen_piqi/2,
N = 20000,
View
@@ -1,5 +1,5 @@
-Compile complex Piqi specification "piqi.org/piqi.piqi" to produce Erlang coders
+Compile complex Piqi specification "piqi/piqi.piqi" to produce Erlang coders
and decoders.
Then build a program which reads and writes back a serialized binary object
@@ -1 +1 @@
-.include [ .module piqi.org/piqi ]
+.include [ .module piqi/piqi ]
@@ -8,7 +8,7 @@ ocaml: piqi-obj.piqi
$(MAKE) -f Makefile.ocaml
-piqi-obj.piqi: ../../piqi.org/piqi.piqi
+piqi-obj.piqi: ../../piqi/piqi.piqi
ln -sf ../../piqic/piqi.ocaml.piqi
piqi expand -e ocaml piqi.piqi > $@
@@ -1 +1 @@
-.include [ .module piqi.org/piqi ]
+.include [ .module piqi/piqi ]
@@ -2,7 +2,7 @@ all: prep test
prep:
- cat ../piqi_misc/piqobj.piqi | sed -e 's/piqi.org\///' > piqobj.piqi
+ cat ../piqi_misc/piqobj.piqi | sed -e 's/piqi\///' > piqobj.piqi
piqi convert --add-defaults -t pb piqi.piqi
View
@@ -1,5 +1,5 @@
-Compile complex piqi specification "piqi.org/piqi.piqi" to produce OCaml
+Compile complex piqi specification "piqi/piqi.piqi" to produce OCaml
parsers and generators.
Then build a program which reads and writes back a serialized binary object
@@ -1 +1 @@
-.include [ .module piqi.org/piqi ]
+.include [ .module piqi/piqi ]
View
@@ -3,9 +3,6 @@
% Copyright 2009, 2010, 2011, 2012 Anton Lavrik
-%.module piqi.org/piqast
-
-
.custom-field ocaml-name
@@ -3,7 +3,7 @@
% Copyright 2009, 2010, 2011, 2012 Anton Lavrik
-.import [ .module piqi.org/piqi ]
+.import [ .module piqi/piqi ]
.variant [
@@ -31,7 +31,7 @@ piqi call $flags "piqi server/ping"
# testing "add-piqi" function
#
-f=../piqi.org/piqi.piqi
+f=../../piqi/piqi.piqi
piqi expand --add-module-name $f > t.piqi
View

0 comments on commit 88557f4

Please sign in to comment.