Skip to content

Commit

Permalink
Merge ed3afdd into f107892
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Nov 4, 2016
2 parents f107892 + ed3afdd commit 9c06541
Show file tree
Hide file tree
Showing 43 changed files with 1,547 additions and 422 deletions.
23 changes: 21 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
tests: $(patsubst %.api.h,%.out.h,$(wildcard src/tests/*.h))
tests: \
$(patsubst %.api.h,%.out.h,$(wildcard src/tests/*.api.h)) \
$(patsubst %.api.h,%.out.hs,$(wildcard src/tests/*.api.h)) \
$(patsubst %.api.h,%.out.api,$(wildcard src/tests/*.api.h)) \
$(patsubst %.api.h,%.out.ast,$(wildcard src/tests/*.api.h))
./apigen.native

src/tests/%.out.h: src/tests/%.api.h all
-cd src && ../apigen.native $(patsubst src/%,%,$<) > $(patsubst src/%,%,$@) 2>&1
-cd src && ../apigen.native -c $(patsubst src/%,%,$<) > $(patsubst src/%,%,$@) 2>&1
diff -u $@ src/tests/$*.exp.h
rm -f $@

src/tests/%.out.hs: src/tests/%.api.h all
-cd src && ../apigen.native -hs Main $(patsubst src/%,%,$<) > $(patsubst src/%,%,$@) 2>&1
diff -u $@ src/tests/$*.exp.hs
rm -f $@

src/tests/%.out.api: src/tests/%.api.h all
-cd src && ../apigen.native -api $(patsubst src/%,%,$<) > $(patsubst src/%,%,$@) 2>&1
diff -u $@ src/tests/$*.exp.api
rm -f $@

src/tests/%.out.ast: src/tests/%.api.h all
-cd src && ../apigen.native -ast $(patsubst src/%,%,$<) > $(patsubst src/%,%,$@) 2>&1
diff -u $@ src/tests/$*.exp.ast

all:
ocamlbuild -use-ocamlfind -yaccflag --table apigen.native

Expand Down
2 changes: 1 addition & 1 deletion _tags
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
true: use_menhir
true: annot
true: bin_annot
<*/*.{native,byte,ml,mli}>: package(ppx_deriving.std), package(menhirLib)
<*/*.{native,byte,ml,mli}>: package(ppx_deriving.std), package(menhirLib), package(str)

".": -include
"src": include
3 changes: 3 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/_build
/setup.data
/setup.log
/*.byte
/*.native
22 changes: 21 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,33 @@ BUILDFLAGS := -yaccflags --table

default: test

tests: $(patsubst %.api.h,%.out.h,$(wildcard tests/*.h))
tests: \
$(patsubst %.api.h,%.out.h,$(wildcard tests/*.api.h)) \
$(patsubst %.api.h,%.out.hs,$(wildcard tests/*.api.h)) \
$(patsubst %.api.h,%.out.api,$(wildcard tests/*.api.h)) \
$(patsubst %.api.h,%.out.ast,$(wildcard tests/*.api.h))
./apigen.native

tests/%.out.h: tests/%.api.h build
-./apigen.native $< > $@ 2>&1
diff -u $@ tests/$*.exp.h
rm -f $@

tests/%.out.hs: tests/%.api.h build
-./apigen.native -hs "Main" $< > $@ 2>&1
diff -u $@ tests/$*.exp.hs
rm -f $@

tests/%.out.api: tests/%.api.h build
-./apigen.native -api $< > $@ 2>&1
diff -u $@ tests/$*.exp.api
rm -f $@

tests/%.out.ast: tests/%.api.h build
-./apigen.native -ast $< > $@ 2>&1
diff -u $@ tests/$*.exp.ast
rm -f $@

# We have our own for now, because upstream is broken.
#travis-coveralls.sh:
# curl https://raw.githubusercontent.com/simonjbeaumont/ocaml-travis-coveralls/master/$@ -o $@
Expand Down
2 changes: 1 addition & 1 deletion src/_oasis
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Executable apidsl
Path: .
BuildTools: ocamlbuild
MainIs: apigen.ml
BuildDepends: ppx_deriving.std, menhirLib
BuildDepends: ppx_deriving.std, menhirLib, str
CompiledObject: best

Test regressions
Expand Down
4 changes: 3 additions & 1 deletion src/_tags
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: 95032ee7dc868e85040dd63734005b82)
# DO NOT EDIT (digest: 0e9d5e0301eeace397df289756f2c39e)
# Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process
Expand All @@ -17,8 +17,10 @@ true: annot, bin_annot
# Executable apidsl
<apigen.{native,byte}>: package(menhirLib)
<apigen.{native,byte}>: package(ppx_deriving.std)
<apigen.{native,byte}>: package(str)
<*.ml{,i,y}>: package(menhirLib)
<*.ml{,i,y}>: package(ppx_deriving.std)
<*.ml{,i,y}>: package(str)
# OASIS_STOP

true: use_menhir
Expand Down
5 changes: 1 addition & 4 deletions src/apiAst.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type 'id type_name =
| Ty_UName of 'id uname
| Ty_LName of 'id lname
| Ty_TVar of 'id lname
| Ty_Array of 'id lname * 'id size_spec
| Ty_Array of 'id type_name * 'id size_spec
| Ty_Auto
| Ty_Const of 'id type_name
| Ty_Pointer of 'id type_name
Expand Down Expand Up @@ -104,6 +104,3 @@ type 'id decls = 'id decl list
type 'id api =
| Api of verbatim option * 'id decls * verbatim option
[@@deriving show]


let id x = x

0 comments on commit 9c06541

Please sign in to comment.