Commit Graph
65 Commits
Author SHA1 Message Date
José Valim db47bd56b4 Add Path.relative_to_cwd and rely on it when generating stacktraces 2013-08-14 12:36:54 +02:00
José Valim cea31f69dc Review and deprecate list <-> binary conversion 2013-08-14 11:16:37 +02:00
José Valim c6f9287ce7 Only raise on local macro conflicts if it was previously defined 2013-08-02 09:53:30 +02:00
José Valim 155398c445 Warn for unmatched docs 2013-07-23 23:37:36 +02:00
José Valim 2e3c4ee1c9 Support each_module callback on ParallelCompiler 2013-07-19 22:10:30 +02:00
José Valim 6034738d48 Document that on_definition can only be a function, closes #1431 2013-07-16 12:56:29 +02:00
José Valim 99da29b430 Ensure eval callbacks gets a fresh vars dict 2013-07-10 16:04:36 +02:00
José Valim ffc91e3004 Rename Kernel.LocalsTracker to Module.DispatchTracker 2013-05-26 14:39:02 +02:00
José Valim c3e7543e48 Extract imports handling to locals tracker (soon to be renamed) 2013-05-26 14:39:02 +02:00
José Valim c3dd4006b0 Reduce atom footprint when compiling an elixir module 2013-05-25 16:37:33 +02:00
José Valim e05448afd7 Remove *_table terminolgy in favor of setup/cleanup 2013-05-25 16:02:19 +02:00
José Valim d757f31ccd Unused functions with cyclic dependencies are now also warned as unused
Closes #1105
2013-05-25 00:14:37 +02:00
José Valim 2c98c0999d An Elixir module now translates to Elixir.Module instead of Elixir-Module 2013-05-23 14:36:56 +02:00
José Valim d9b98a62c8 Check if the module is in the same context before checking if it is open 2013-05-19 19:42:13 +02:00
José Valim 23cbf3e853 Support options from macros and @attributes in import, alias and require 2013-05-13 21:51:07 -06:00
José Valim f38cf28cbd Store in the AST if contents come from a quoted expression
This provides a more robust way of checking from where
the original expressions are coming from compared to the
lexical check_clauses field we had in elixir_scope.

A direct consequence of this commit is that, the following
code:

    defrecord Sample, [:hello] do
      import List
    end

Now raises a warning if the List import is not used,
where it didn't previously.
2013-05-13 15:56:15 -06:00
José Valim 9118b36069 Improve warnings related to default arguments
* "default arguments in some_fun/3 are never used"
* "the first default argument in some_fun/3 is never used"
* "the first 2 default arguments in some_fun/3 are never used"

Closes #929
2013-05-12 19:31:34 -06:00
José Valim 65f7d56a8e Don't warn on unused imports 2013-05-06 20:17:31 -06:00
José Valim a93264be81 Private on_load functions should not trigger unused warning 2013-05-06 11:31:05 -06:00
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 87d57a38a3 Do not go through eval if there is nothing to evaluate 2013-04-21 18:03:09 -06:00
José Valim b96c3c52ae Remove check_require in favor of a meta tag 2013-04-13 17:19:19 -07:00
José Valim f7cad1cffc Improve error messages 2013-03-27 09:54:00 -06:00
José Valim 22da62600e Record rewriter should also optimize in-module calls 2013-02-25 09:55:41 -07: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
Yurii Rashkovskii 36c9e11064 Remove __info__/1 from __info__(:functions)
Closes #734
2012-12-24 12:51:09 +01:00
José Valim a629fdac0d Document the record access rewrite feature 2012-12-03 11:35:34 +01:00
José Valim 82cf622e9b Enable record rewriter inference 2012-12-03 00:47:34 +01:00
José Valim b32f6ef51f Keep variables in a single dictionary
This ensures we give the same treatment to quoted
and non-quoted variables.
2012-12-02 12:22:10 +01:00
Yurii Rashkovskii 486cb79fab Store @specs in the order they were specified in the source code 2012-11-30 04:47:43 -08:00
José Valim b9e5e490cd Do not add lines to __info__ function 2012-11-28 11:57:57 +01:00
José Valim 40efeb48d7 Reduce atom footprint when compiling code
Previously, we were generating atom names based on
the file or the module name. This commit replaces
it by a pool of atom names. After a module name
is used and purged with success, it is added back
to the pool so it can be reused many times.
2012-11-15 16:44:27 +01:00
José Valim c0a42c95e0 Do not print warnings for injected private macros 2012-11-10 12:30:24 +01:00
José Valim e9334fb7dc Tidy up Typespec API, improve docs 2012-11-05 14:51:51 +01:00
José Valim ec68b7dd8a Compile specs and callbacks to @spec and @callback so they are easier to access 2012-11-05 10:26:02 +01:00
José Valim 925ab81ca2 Define __info__(:module) instead of __info__(:self) 2012-10-28 21:20:11 +01:00
José Valim d1cbefdbe0 No need to special case the compiler_clause anymore 2012-10-27 20:54:37 +02:00
José Valim 2704ba1a07 Convert file to char list, closes #583 2012-10-27 19:57:04 +02: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 e2e6e5d0d4 Store overridable funtions defined in before_compile callbacks, closes #572 2012-10-24 11:55:12 +02:00
Yurii Rashkovskii baa28932f9 Keywords are no longer sorted 2012-10-17 00:06:41 -07:00
José Valim 441bf29f16 Remove special case for specs in elixir_module.erl
Previously, since the functions were not concrete
but stubs replaced at compilation time, we had to
special the module definition to not actually include
the specs, which would become compilation errors.

Now we provide a concrete implementation of the
functions and therefore the spec will be available
in the final source. Those implementations are not
actually invoked in practice, since they are still
transformed into erlang ones for performance reasons.
2012-10-05 15:45:29 -07:00
José Valim fac57e78b2 Ensure Kernel.__info__(:functions|:macros) returns the complete set 2012-10-05 15:45:28 -07:00
José Valim e6dba433eb Add Module.create 2012-10-03 23:27:34 -07: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
Yurii Rashkovskii 9e835246d6 defmodule returns module name, binary and the result
Previously, 58eea96fc2 was
attempting to solve the ambiguity of records and defmodule result.

This solves the problem completely by tagging defmodule results with
the :module atom and it brings the module name back into the tuple
2012-09-13 12:35:21 -07:00
José Valim 58eea96fc2 defmodule only returns the result and the binary
We avoid returning { module, binary, result } because
it can be mistakenly confused as a record named module.
Before this patch, defrecord Foo, bar: nil, baz: nil
in IEx was returning:

    Foo[bar: <<binary>>, baz: nil]
2012-09-13 13:56:43 +02:00
José Valim f5560da26d Docs now use the new on_definition hook 2012-09-10 22:00:25 +02:00