Commit Graph
135 Commits
Author SHA1 Message Date
José Valim cbd9d83adc Ensure compilation does not leave random spurious data on failure
Prior to this patch, the parallel compiler could leave spurious
processes and the module definition could leave stale data
in the elixir_modules table.

The issue has been fixed by emitting the proper exit signals
and by using monitors.
2014-11-21 17:40:06 +01:00
José Valim 6e24e2714e Use unamed tables for module compilation
* We have created a main named table that keeps all module information

* We have reduced the amount of tables by storing internal, docs and
  attributes altogether and using table looks for retriving the relevant
  information

* At this moment, creating a module in Elixir defines three tables,
  one for data, another for functions and another for clauses
2014-10-17 13:51:19 +02:00
José Valim f6858c6985 Correctly follow code specs when loading binaries
If we are compiling the module, we will load it with the
output of its beam file. If the module exists only in
memory, :code.which/1 will return `:in_memory`.

Closes #2533
2014-08-06 12:05:55 +02:00
José Valim 2ab6c6d5bd Ensure private functions are not exported, closes #2587 2014-07-29 11:22:19 +02:00
José Valim 97e4d53ea0 Do not call handle_file_warning directly 2014-07-08 19:03:22 +02:00
José Valim 495c05d83f Make elixir_errors API more strict and consider :file in meta 2014-07-08 18:54:40 +02:00
José Valim 1c79f9eca4 Emit :file attribute on all nodes instead of a select few 2014-07-08 15:53:32 +02:00
José Valim 0b997b7e18 Ensure docs with no function raise warnings 2014-07-05 22:25:15 +02:00
José Valim 4c89a16fb1 Return explicit :ok from more functions 2014-07-05 13:43:52 +02:00
José Valim 8ff44e7af0 Always return ok from tracking functions 2014-07-05 13:21:59 +02:00
James Fish efc1f4a1ef Fix unmatched returns dialyzer warnings 2014-07-04 02:45:16 +01:00
José Valim 6909dd8d3f Improve poorly specified callbacks 2014-07-03 16:50:37 +02:00
José Valim 1dff69e537 Refactor how definitions are analyzed 2014-07-03 14:15:24 +02:00
José Valim c8a0158791 Add @external_resource attribute, closes #2455 2014-06-27 22:16:34 +02:00
Eric Meadows-Jönsson 587c83cbff Delay typespec compilation to after expansion 2014-06-18 19:49:57 +02:00
José Valim 2b3e53670e Provide Protocol.derive/3 2014-06-05 22:54:10 +02:00
José Valim 436f563ad3 Ensure variables do not leak on callbacks 2014-05-25 14:22:23 +02:00
José Valim 34c2da2c65 Initial work on @derive for structs 2014-05-25 01:43:58 +02:00
José Valim 3ab1db6740 Move Protocol consolidation up to the Protocol module 2014-05-24 18:28:48 +02:00
Alexei Sholik bc65fc0276 Preserve docs chunk during protocol consolidation 2014-05-24 03:45:30 +03:00
Alexei Sholik b1f0d3ed99 Add version tag to Elixir’s beam chunk
This will allow us to change the layout of the chunk in the future
2014-05-24 03:45:29 +03:00
Alexei Sholik 8a3f2cfc2f Remove :docs and :moduledoc clauses from the __info__ function
Instead, we keep the docs in a custom chunk within the .beam file;
this will allow us to lazily load them
2014-05-24 03:45:29 +03:00
José Valim 3d4877ffda Get rid of BitString module and bitstring conversions 2014-05-17 16:34:26 +02:00
Paul Schoenfelder a6392a8220 Add typespecs for builtins, __record__, and __struct__
Added typespecs for:

- __FILE__/1
- __MODULE__/1
- __info__/1
- __record__/1, __record__/2, __record__/3
- __struct__/0
2014-05-16 11:45:47 -05:00
José Valim deb0191a21 Add Atom.to_string, Atom.to_char_list and BitString.to_list 2014-05-16 14:38:43 +02:00
José Valim 615a54e8bf Hide module's location attribute 2014-05-06 10:46:30 +02:00
Gonçalo Cabrita 66e70ac72f Fix compile error during boostraping 2014-05-06 01:01:30 +01:00
Gonçalo Cabrita 2d48d2ed5b Fix two test cases 2014-05-05 21:24:51 +00:00
Gonçalo Cabrita 8b54e28086 Compiler now mentions which file has a duplicated module. Fixes #2131 2014-05-05 21:24:51 +00:00
Matheus Lima 07d7d538dc Adds "Elixir" to check module availability naming list 2014-05-04 11:27:25 +02:00
José Valim fdf53787cf Remove unecessary .hrl macros 2014-04-30 19:24:04 +02:00
José Valim c435dbe38d Convert #elixir_env to a struct too 2014-04-30 16:32:13 +02:00
José Valim 56f15d9f4e Do not add spaces after { and before }
This makes the source code consistent with the result
returned by inspect/2.
2014-04-21 19:06:35 +02:00
José Valim c9402713c9 Ensure undefined modules are reserved for future usage 2014-02-24 17:00:29 +01:00
José Valim 20b14b3221 Ensure structs can be access from context modules 2014-02-16 13:49:34 +01:00
José Valim ff0df96cfc Get rid of record rewriter 2014-02-05 13:06:27 +01:00
José Valim 5f682023a6 Deprecate usage of @behavior in favor of @behaviour 2014-01-28 11:21:55 +01:00
José Valim 8023c29c3f Consistently inline functions in the Kernel module by the compiler 2014-01-22 14:11:48 +01:00
José Valim 0aff2a3139 Compile with relative paths and include apps in stacktraces
Closes #1964, closes #1861
2014-01-07 11:30:44 +01:00
José Valim 9b22b6d883 Ensure local is disabled on module definitions 2014-01-03 17:57:24 +01:00
José Valim d27c7b0e1f Always return #elixir_env from callbacks 2013-12-30 22:31:14 +01:00
José Valim 6e48e5dfcb Ensure we run lexical warnings for dynamic modules 2013-12-30 12:10:00 +01:00
José Valim 254065d3c4 Clean up synax_error, asstions and merge mechanisms 2013-12-29 14:22:45 +01:00
José Valim 29b38ab9e0 Discard old dispatch 2013-12-29 12:23:38 +01:00
José Valim f8b019c7c8 Move to the new expansion on the front-end 2013-12-28 23:14:55 +01:00
José Valim c4419268b8 Move module compilation to rely on elixir_exp 2013-12-28 15:01:31 +01:00
José Valim ade26dedd8 Work on Elixir expressions rather than forms 2013-12-28 11:47:44 +01:00
José Valim 219ded1b91 Rename DispatchTracker to LocalsTracker 2013-12-22 09:20:41 +01:00
José Valim 63fdbfb8cf Implement Module.eval_quoted in Elixir 2013-11-25 12:59:14 +01:00
José Valim e0354005ea Simplify get_opt(internal) handling 2013-11-25 09:06:01 +01:00