Commit Graph
26 Commits
Author SHA1 Message Date
José Valim ddb87a96ca Private functions used by private macros no longer emit an unused warning, closes #885 2013-05-05 21:59:40 -06:00
José Valim 1019879bd0 Improve previous clause does not match warning
We have redefined the warning to say:

  "trying to override previously defined function NAME/ARITY"

We have also relaxed the rules that causes the warning to
emitted. For example, if any kind of meta-programming or
unquoting is detected in the function definition, we skip
the warning altogether.

Closes #934.
2013-05-04 14:59:15 -06:00
José Valim 4c70f1b3cd Store clauses in a separate table (thanks to yrashk for first iteration of this patch) 2013-04-21 14:56:52 -06:00
José Valim f7cad1cffc Improve error messages 2013-03-27 09:54:00 -06:00
José Valim 2817b2ee90 Allow unquote in def*/2
This makes meta-programming in Elixir much easier and more friendly.
For example, here is how to convert a keywords argument into a bunch
of functions:

    Enum.each [foo: 1, bar: 2, baz: 3], fn { k, v } ->
      def unquote(k)(), do: unquote(v)
    end
2013-03-10 17:59:04 -06:00
José Valim 5557e620ff Backwards incompatible change on before_compile and after_compile
Both callbacks now receive the environment as
first argument instead of the module.
2013-02-16 19:57:14 -07:00
José Valim 89cbe93bba The AST now allows metadata to be attached to each node
This means the second item in the AST is no longer an integer
(representing the line), but a keywords list. Code that relies
on the line information from AST or that manually generate AST
nodes need to be properly updated.
2013-01-21 15:42:03 -07:00
José Valim acbb6c0fee Functions defined inside quote(location: :keep) retain the source stacktrace 2013-01-02 10:59:52 +01:00
José Valim 82cf622e9b Enable record rewriter inference 2012-12-03 00:47:34 +01:00
José Valim c0a42c95e0 Do not print warnings for injected private macros 2012-11-10 12:30:24 +01:00
José Valim 8c317e3d43 Do not check clauses just after non quoted ones, closes #591 2012-10-30 10:13:32 +01:00
José Valim 2f3289aaef Try a different and simpler approach to clauses warnings, closes #567 2012-10-24 16:57:23 +02:00
José Valim b2037b0fcc Module.read_attribute and Module.add_attribute deprecated
In favor of `Module.get_attribute` and `Module.put_attribute`
which mimics Dict API
2012-09-18 13:51:32 +02:00
José Valim e4ad1c14e4 Docs for functions without implementation are automatically marked as defcallback 2012-09-12 12:59:22 +02:00
José Valim f5560da26d Docs now use the new on_definition hook 2012-09-10 22:00:25 +02:00
José Valim 6c96c3473a Add support to on_definition hooks, closes #448 2012-09-10 21:50:23 +02:00
José Valim d14687b3bc Raw function definition now evaluates all arguments
This applies to def/4, defp/4, defmacro/4, defmacrop/4.
The previous behaviour was accidental and did not properly
evaluate all arguments.
2012-09-07 12:19:03 +02:00
José Valim 9aa32423b0 Provide some behaviour conveniences 2012-08-17 15:49:00 -03:00
José Valim b5cf14949d Linify def args and guards 2012-08-10 13:20:10 -03:00
José Valim 5f888b71ca No need to special case def clauses anymore 2012-07-26 09:28:26 +02:00
José Valim 895b50afb9 Small improvements to elixir_def 2012-07-25 08:58:55 +02:00
José Valim 152c784a07 Add binary_part to the list of guard functions 2012-07-24 13:04:33 +02:00
José Valim d984f4b545 Typespecs now support macros, closes #385 2012-07-20 10:29:55 +02:00
José Valim 1b4603160c Add elixir's parse transform to be used with erlang code 2012-07-12 11:29:46 +02:00
José Valim a4ab7ee75c Normalize file attribute in the expected place 2012-07-09 23:04:21 +02:00
José Valim d5031b6347 Move all code to erlang style apps 2012-07-05 20:20:16 +02:00