Commit Graph
638 Commits
Author SHA1 Message Date
José Valim 6e48e5dfcb Ensure we run lexical warnings for dynamic modules 2013-12-30 12:10:00 +01:00
José Valim 83c93beaa6 Get rid of environment macro counter in favor of a global one 2013-12-30 11:45:23 +01:00
José Valim d4da5be4ee Remove more duplication in between expansion and translation 2013-12-29 16:40:11 +01:00
José Valim b03e2173a5 Rename translate_each to translate and temp_vars to match_vars 2013-12-29 16:08:58 +01:00
José Valim f547ef82e2 Clean up literal handling and add elixir_bitstring 2013-12-29 15:41:39 +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 0e627c9b09 Use expansion on function bodies 2013-12-29 10:54:10 +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 574e92fc57 Also expand binaries 2013-12-27 15:52:17 +01:00
José Valim 78def5da6e Raise better message on invalid or reserved codepoints 2013-12-25 14:44:01 +01:00
José Valim ffe2cc74b8 Expand try 2013-12-25 13:20:49 +01:00
José Valim 98e15914eb Expand receive 2013-12-24 14:23:22 +01:00
José Valim 8c47368fff Expand case 2013-12-24 13:48:58 +01:00
José Valim f81a15b7cb Expand fn 2013-12-23 18:23:08 +01:00
José Valim 51aef55c83 Change how -> is represented in the AST
The previous representation was very hard to compose
and very often required the AST nodes to be created
manually.

The current approach is easier to compose because
the node is represented as any other operator as long
as it is wrapped in parentheses.

For example, imagine we have pairs of patterns and
the code to be executed for that pattern, and we want
to inject them into a case. It can now be writen as:

    pairs = Enum.map pairs, fn { pattern, expr } ->
      quote do: (unquote(pattern) -> unquote(expr))
    end

    quote do
      case unquote(condition), do: unquote(pairs)
    end

Compare to the previous implementation:

    pairs = Enum.map pairs, fn { pattern, expr } ->
      { [pattern], [], expr }
    end

    pairs = { :->, [], pairs }

    quote do
      case unquote(condition), do: unquote(pairs)
    end
2013-12-23 16:10:33 +01:00
José Valim 2d36a76b26 Move capture to elixir_exp 2013-12-23 14:59:31 +01:00
José Valim 9f5e7c4a41 Fix expansion of =, inbits and inlist regarding rhs lexical info 2013-12-23 13:00:09 +01:00
José Valim 4c26585ef6 Simplify and fix bugs around lexical scope on try 2013-12-22 12:34:49 +01:00
José Valim 67eeedfb1d Expand requires and imports 2013-12-22 11:31:25 +01:00
José Valim d0a823c8b0 Expand comprehensions 2013-12-22 10:01:35 +01:00
José Valim df9d535769 Delay some error handling to translation 2013-12-22 09:37:07 +01:00
José Valim 219ded1b91 Rename DispatchTracker to LocalsTracker 2013-12-22 09:20:41 +01:00
José Valim a0eef07958 No need to require for requires for all expansions 2013-12-21 22:00:42 +01:00
José Valim c7af8bc2cc Improve compilation times and memory consumption
This commit includes three changes:

1. Previously, the parallel compiler released at once all processes
   depending on a particular module. This commit ensures they are
   released according to the number of cores available. This ensures
   we have fewer modules being compiled at once

2. Garbage collect the current process every time we are waiting
   for another module to be compiled

3. Do not compile a module for files that simply define modules
2013-12-21 20:06:50 +01:00
José Valim f2cf4a393f Expand super 2013-12-20 11:36:25 +01:00
José Valim 2c1c504fc5 Expand ^var 2013-12-20 11:26:50 +01:00
José Valim 625a27fac2 Implement pending tests 2013-12-20 11:18:28 +01:00
José Valim 5164073bf0 Handle remote calls 2013-12-20 11:09:01 +01:00
José Valim bb05011dca Expand quote 2013-12-19 20:42:33 +01:00
José Valim c296e62543 Expand tuples and other special forms 2013-12-19 15:58:13 +01:00
José Valim 8847f8ed68 Start locals expansion 2013-12-19 15:33:13 +01:00
José Valim a33cbbe6b1 Simplify import dispatching 2013-12-18 17:24:32 +01:00
José Valim 613298c4ab Add variables expansion 2013-12-18 12:32:40 +01:00
José Valim d39401e2d3 Start expanding aliases on their own 2013-12-18 10:40:42 +01:00
Eric Meadows-Jonsson a711bef57f Dont require [] for keyword list operand in when/2 2013-12-13 13:12:25 +01:00
José Valim 575e0b9494 Start sharing reducers in between Enum/Stream 2013-12-11 15:01:28 +01:00
José Valim bce9116cff Ensure full alias is stored in context_modules 2013-12-10 15:15:28 +01:00
José Valim f62c26b9b6 Ensure record aliases in the same quote can be accessed, closes #1915
This commit also simplifies macro expansion for both imports and aliases
to always give higher preference to the macro environment rather than
the caller one, if such is available. The deal is to simplify both the
code and understanding of how macros work.
2013-12-07 20:01:11 +01:00
José Valim e424f02812 Ensure aliases defined in macros do not leak 2013-11-30 18:02:46 +01:00
José Valim 7dd9da12a7 Promote exception/1 as the best mechanism to customize exceptions
The previous mechanism of lazily customizing message/1 was very
dangerous, as you could have errors while calculating the message
and those would shop up just when the exception is printed, leading
to further breakage.

Closes #1747
2013-11-30 11:59:51 +01:00
José Valim 9ee79a16bb Deprecate Macro.extract_args/1 2013-11-29 23:24:44 +01:00
José Valim 63fdbfb8cf Implement Module.eval_quoted in Elixir 2013-11-25 12:59:14 +01:00
José Valim 043edd4990 location: :keep only affect function definitions
This commit changes how metadata is stored once location: :keep
is used and also removes the __scope__ special form.

Closes #1877
2013-11-25 11:35:00 +01:00
José Valim fd3d8b3b98 Share quote annotations with unquote fragments 2013-11-25 09:06:01 +01:00
José Valim e0354005ea Simplify get_opt(internal) handling 2013-11-25 09:06:01 +01:00
José Valim da34ccd54e Simplify lookups in elixir_dispatch 2013-11-25 09:06:01 +01:00
José Valim d7179b404b Port module_nesting handler to Elixir 2013-11-24 13:42:01 +01:00