Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

The first version of the type testing code generator. #2

Merged
merged 29 commits into from Sep 5, 2011

Conversation

hamza-mahmood
Copy link

No description provided.

M added 29 commits September 3, 2011 15:42
This module will contain the functions that generate the AST of the testing
code during compilation.
This module will provide functions that will do the tests during execution
time. This testing methode is slow but required for types with parameters.
This module provides functions that are used for genration functions and
variables' names in order to avoid conflicts with names used by the user.
now support:
-type name():: type_def_1 | type_def_2 | type_def_3.
-type name():: union(type_def_1,type_def_2,type_def_3).

For union(), you can put as many type def as you want.
Now support:
-type name()::{type_def_1,type_def_2,type_def_3}.
-type name()::tuple(type_def_1,type_def_2,type_def_3).
You can use:
-type name()::[type_def].
-type name()::list(type_def).
You can now use:
-type name(Var_1,Var,2)::type_def(Var_1,Var_2).

example:
-type name(A)::[A].
You can write:
-type name_1()::integer()|atom().
-type name_2()::{name_1()}.
…ules

You can use:
-type name():: {module:name_2()}.
You can now make call like:
sheriff:check(Var,my_type(1,a)).
YOu can now make call like:
sheriff:check(Var,my_type(-7..11)).
You can now make such call:
sheriff:check(Var,my_type(integer(),atom())).
You can make call like:

sheriff:check(Var,my_type(union(type_def_1,type_def_2))
You can nom make call like:

sheriff:check(Var,my_type(tuple(type_def_1,type_def_2,type_def_3))).
You can make call like:

sheriff:check(Var,my_type(list(type_def))).
You can now make call like:

sheriff:check(Var,my_type(my_type_2())).
sheriff:check(Var,my_type(module:my_type_2())).
essen pushed a commit that referenced this pull request Sep 5, 2011
The first version of the type testing code generator.
@essen essen merged commit 0458c4b into extend:master Sep 5, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants