Skip to content

Commit

Permalink
Merge c8fa9a0 into a84361f
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Nov 2, 2016
2 parents a84361f + c8fa9a0 commit 1743b0f
Show file tree
Hide file tree
Showing 104 changed files with 16,621 additions and 673 deletions.
28 changes: 24 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
tests: $(patsubst %.h,%.out,$(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: src/tests/%.h all
-cd src && ../apigen.native $(patsubst src/%,%,$<) > $(patsubst src/%,%,$@) 2>&1
diff -u $@ src/tests/$*.exp
src/tests/%.out.h: src/tests/%.api.h all
-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
rm -f $@

all:
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
28 changes: 24 additions & 4 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,31 @@ BUILDFLAGS := -yaccflags --table

default: test

tests: $(patsubst %.h,%.out,$(wildcard tests/*.h))

tests/%.out: tests/%.h build
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
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.
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 1743b0f

Please sign in to comment.