Commit Graph

84 Commits

Author SHA1 Message Date
Loïc Hoguin
62b927e3c1 Fix compilation (dependency wasn't fetched) 2013-07-02 19:23:38 +02:00
Ulf Wiger
fb08d7eedf Merge pull request #7 from legoscia/is_record_overlapping_contracts
Fix "overlapping domain" Dialyzer warning for '#is_record-'/{1,2}
2013-03-05 10:35:28 -08:00
Magnus Henoch
d2ead76e7d Fix "overlapping domain" Dialyzer warning for '#is_record-'/{1,2}
These contracts will usually not be seen by the user, and are ignored
by Dialyzer because they have overlapping domains, so there is not
much point in using them.  Replace with simpler contracts for now.
2013-03-05 16:09:49 +00:00
Ulf Wiger
f83f77c2cc codegen:gen_module/3 support 2012-12-19 17:30:23 +01:00
Ulf Wiger
c55c8861cd Added revert_form/1; deal with revert bugs 2012-12-19 17:29:53 +01:00
Ulf Wiger
895a157dc9 improved error reporting, return/2, format_exception/2 2012-12-18 15:50:17 +01:00
Ulf Wiger
38b2183a9e added LC form to codegen:gen_function/2 2012-12-14 22:57:47 +01:00
Ulf Wiger
a812823fdb Merge pull request #3 from JoeOsborn/permit-non-top-level-forms
Tolerate parse_transforming non-top-level forms.
2012-12-12 10:57:27 -08:00
Joe Osborn
9b594f639b Tolerate parse_transforming non-top-level forms.
A few changes were made to provide default values for context attributes so that parse_transform:transform/4 could be called for non-top-level forms. I don't know if this is generally useful or if it just fit my weird use case.
2012-12-12 07:38:39 -08:00
Ulf Wiger
ae7163f3db For fun, implemented a 'pmod' parse transform.
See examples/pmod.erl and examples/ex_pmod.erl
This works similarly to OTP's parameterized modules, which they are
now saying that they will drop. Since they drop the compiler support,
a slightly different notation is needed.

-pmod_vars([V1, V2, ...]). % defines the 'global' variables.
-pmod_funs([F1/A1, ...]).  % defines which functions are to be exported.

The functions listed in -pmod_funs/1 are transformed to take an extra
argument, and a new(V1, V2, ...) function is added and exported.

Example:

Eshell V5.9  (abort with ^G)
1> c(ex_pmod).
{ok,ex_pmod}
2> M = ex_pmod:new(a,b).
{ex_pmod,{a,b}}
3> M:b(x,y).
{x,y,a,b}
2012-10-12 19:34:03 +02:00
Ulf Wiger
e3676f4a6b lists:concat() -> lists:append() 2012-08-16 13:55:14 +02:00
Ulf Wiger
216531d99f Merge pull request #6 from nox/let-errors-through
Let error markers through parse_transform:do/5
2012-04-23 23:34:04 -07:00
Anthony Ramine
11f137a461 Let error markers through parse_transform:do/5
Error markers ({error, Term} tuples) in Forms are special-cased by do/5
and make it return a error tuple itself instead of just letting them
through. I don't think it is good behaviour as the compiler and its
friends already handle error markers correctly. Furthermore it makes
parse_trans_codegen:parse_transform/2 fails when passing the error tuple
to parse_trans:revert/1.
2012-04-23 22:23:23 +02:00
Ulf Wiger
0ec1da744e corrected license texts (EPL 1.1) 2012-03-05 18:36:32 +01:00
Ulf Wiger
f84867ab1a fix function_clause crash in exprecs + minor fixes 2012-02-05 23:12:49 +01:00
Ulf Wiger
7100aa21e7 only include exported recs in f_get 2012-02-02 16:59:28 +01:00
Ulf Wiger
c2ea01ef23 update edoc 2012-01-28 18:34:03 +01:00
Ulf Wiger
9116c6e385 figured out how to abstract erl_eval funs 2012-01-28 18:32:33 +01:00
Ulf Wiger
6926bb0e60 buggy ct_expand_trace support 2012-01-28 17:10:09 +01:00
Ulf Wiger
11154e117d updated docs 2012-01-28 16:30:05 +01:00
Ulf Wiger
1be85560dd Merge branch 'master' of github.com:esl/parse_trans 2012-01-28 16:25:27 +01:00
Ulf Wiger
a58d7dab1e nicer error reporting; more capable ct_expand 2012-01-28 16:23:53 +01:00
Ulf Wiger
c702bea17a Merge pull request #5 from nebularis/keep-context
hold on to context when entering subtrees
2011-12-24 13:00:23 -08:00
Ulf Wiger
46e4d068ea Merge pull request #4 from nebularis/r15-fix-compile
fix compile error on R15B
2011-12-24 12:57:37 -08:00
Tim Watson
b8b2259a62 hold on to context when entering subtrees 2011-12-24 19:56:56 +00:00
Tim Watson
4f89b3cf5c fix compile error on R15B 2011-12-24 19:53:36 +00:00
Ulf Wiger
e631c857ef plain_transform would skip clauses 2011-12-20 12:15:00 +01:00
Ulf Wiger
60b548ab27 parse_trans:plain_transform/2 and example 2011-12-01 13:32:26 +01:00
Ulf Wiger
e26f61b863 generate types even if no function in module 2011-11-22 21:49:52 +01:00
Ulf Wiger
661d1689e5 fix typo in test_exprecs_vsns printout 2011-11-22 11:36:01 +01:00
Ulf Wiger
565399c524 Merge branch 'module-transforms' 2011-11-22 10:46:35 +01:00
Ulf Wiger
6364c2c6ef 'git' vsn tag in .app.src (again) 2011-11-22 10:39:49 +01:00
Ulf Wiger
5b2201f39f fix record conversions + add example 2011-11-22 10:30:45 +01:00
Ulf Wiger
e9d307f1fc exprecs naming rules can be redefined 2011-10-28 12:26:52 -07:00
Ulf Wiger
893b00e587 completed typespecs & updated doc 2011-10-26 17:50:02 -07:00
Ulf Wiger
676ed9a44b pretty_print handles typed records; exprecs gets more type specs 2011-10-25 14:11:00 -07:00
Ulf Wiger
bb57e235ff types added in exprecs 2011-10-23 13:52:05 +02:00
Ulf Wiger
5c634120c0 optional pretty-printing in transform_module 2011-10-18 11:42:18 +02:00
Ulf Wiger
69b05f4de2 add parse_trans_mod & transform example 2011-10-18 11:24:48 +02:00
Ulf Wiger
62d2cf4984 added eunit example, fixed is_record bug 2011-06-06 14:49:43 +02:00
Ulf Wiger
c6edd2c26a app vsn changed to 0.2 2011-04-20 10:59:21 +02:00
Ulf Wiger
60299e7410 cleanup, type fixes and new rebar 2011-04-18 15:16:54 +02:00
Ulf Wiger
3741317006 fixed parse_trans:pp_beam/2 spec 2011-01-13 18:57:23 +01:00
Ulf Wiger
ca1b670623 dialyzer warnings reported by Kostis 2011-01-13 18:07:27 +01:00
Ulf Wiger
7ef08c7749 re-generated docs with updated edown 2010-10-31 18:34:03 +01:00
Ulf Wiger
049ea9f905 merged klajo-form-injection 2010-10-27 20:51:18 +02:00
Ulf Wiger
06a1066ea0 re-indendation 2010-10-27 20:49:40 +02:00
Klas Johansson
1ec65427e4 Inject an abstract form when '$form' is seen
'$form' works much like '$var', only that it makes it possible to
inject ready-made abstract forms into the generated
functions/expressions.  The following call:

  gen(Name, F) ->
     codegen:gen_function(Name, fun(X) -> X =:= {'$form',F} end).

generates the following if called like this: gen(is_foo, {atom,0,foo})

  is_foo(X) ->
     X =:= foo.
2010-10-26 21:23:11 +02:00
Ulf Wiger
c0bfe0849b generated edown docs + added README 2010-10-23 21:06:20 +02:00
Ulf Wiger
363c2edad6 fixed compilation order 2010-10-04 10:52:28 +02:00