Commit Graph
65 Commits
Author SHA1 Message Date
José Valim 886917753e Ensure we can escape bitstrings, add Macro.validate/1 2014-08-07 17:42:05 +02:00
José Valim 52be06c314 Do not expand args for unknown functions, closes #2387 2014-08-04 13:46:49 +02:00
José Valim 4513b6965f Emit :file attribute on all nodes instead of a select few 2014-07-08 15:53:32 +02:00
José Valim 64d62d2472 Emit warnings for underscored variables appearing twice in a pattern, closes #2480 2014-07-06 20:18:00 +02:00
José Valim 8e1f7fddca Always return ok from tracking functions 2014-07-05 13:21:59 +02:00
James Fish 39cd4a6594 Fix unmatched returns dialyzer warnings 2014-07-04 02:45:16 +01:00
José Valim f95cafe5ca Fix regression when case is used inside cond head 2014-06-28 16:31:03 +02:00
José Valim 64f8541ee6 Make cond a special form so it does not leak vars on head 2014-06-25 01:46:56 +02:00
José Valim 2b3e53670e Provide Protocol.derive/3 2014-06-05 22:54:10 +02:00
José Valim a3d5be91f2 Remove deprecated quote options 2014-05-25 01:43:58 +02:00
José Valim be34a75124 Disabling :hygiene in quote is deprecated 2014-05-19 18:25:56 +02:00
José Valim 78c16c0e89 Do not allow nil context to be set on quote 2014-05-19 15:41:09 +02:00
José Valim 580107d29c Deprecate code that was previously soft-deprecated 2014-05-11 14:19:05 +02:00
José Valim c435dbe38d Convert #elixir_env to a struct too 2014-04-30 16:32:13 +02:00
José Valim e5c13e6dd2 Convert Macro.Env to a struct 2014-04-30 15:07:50 +02:00
José Valim c91723b444 Remove deprecated code, enable previous soft deprecations 2014-04-27 13:39:32 +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 a42a0188a1 Start supporting no return in expressions 2014-02-18 17:37:48 +01:00
José Valim 16c90ef97d Start translating for comprehensions 2014-02-13 20:38:56 +01:00
José Valim 335d82e607 Start expanding for comprehensions 2014-02-13 18:47:53 +01:00
José Valim 99e69bd6c5 Support structs special forms 2014-02-06 12:30:14 +01:00
José Valim daa0049b32 Move map and struct functionality to elixir_map 2014-02-05 17:37:16 +01:00
José Valim e612592e21 Inline is_map, ensure proper traversal 2014-02-05 11:56:52 +01:00
Dima Aleksandrov cfbd5bbb7f Basic maps compilation 2014-02-05 11:46:01 +01:00
José Valim bf1da40976 Raise proper error on invalid function in quoted expressions, closes #2020 2014-02-01 15:42:22 +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 4ade0f98aa Remove deprecated code 2014-01-16 10:26:48 +01:00
José Valim 67a672e6ed Guarantee nullary funs/macros are allowed in guards, closes #1997 2014-01-16 10:00:39 +01:00
Eric Meadows-Jönsson ab538670d3 Add :records, :binaries and :char_lists options to inspect/2
Deprecate :raw in favor of :records
2014-01-11 00:25:23 +01:00
José Valim 7c240199f3 Improve stacktraces and error messages during expansion 2014-01-06 19:34:38 +01:00
José Valim 79faa1f706 Do not export case and receive vars 2014-01-04 10:45:13 +01:00
José Valim cba7c5bd80 Only expand __ENV__.call if it is a known function 2014-01-03 22:39:48 +01:00
José Valim 5e2ea082d1 Deprecate __FILE__ in favor of __DIR__ or __ENV__.file 2014-01-02 18:10:59 +01:00
José Valim 6d17b42beb Ensure variables in remote do not leak to args 2013-12-31 11:54:15 +01:00
José Valim 77aca31ffe Remove expansion counter 2013-12-31 10:40:04 +01:00
José Valim 684cf05d75 Skip merge when arg is a literal 2013-12-30 16:41:20 +01:00
José Valim eaac3bbd76 Ensure aliases dispatch to the proper function, guarantee files are binaries 2013-12-30 12:38:36 +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 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 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 574e92fc57 Also expand binaries 2013-12-27 15:52:17 +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