José Valim
4513b6965f
Emit :file attribute on all nodes instead of a select few
2014-07-08 15:53:32 +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
a42a0188a1
Start supporting no return in expressions
2014-02-18 17:37:48 +01:00
José Valim
1ea44670ce
Properly raise on matching on map keys
2014-02-05 13:45:26 +01:00
José Valim
ae24cad4b8
Limit the allowed sigils
2014-01-27 12:32:21 +01:00
José Valim
79faa1f706
Do not export case and receive vars
2014-01-04 10:45:13 +01:00
José Valim
9b22b6d883
Ensure local is disabled on module definitions
2014-01-03 17:57:24 +01:00
José Valim
1c4b759c4e
Bring back no name and simplify var merging
2014-01-01 12:22:49 +01:00
José Valim
9cd56804ea
Use a main counter for hygienic variables
2013-12-31 14:20:24 +01:00
José Valim
7836493d23
Do not leak clause heads, closes #1948
2013-12-30 23:12:44 +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
254065d3c4
Clean up synax_error, asstions and merge mechanisms
2013-12-29 14:22:45 +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
8847f8ed68
Start locals expansion
2013-12-19 15:33:13 +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
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
d7179b404b
Port module_nesting handler to Elixir
2013-11-24 13:42:01 +01:00
José Valim
c2243e2c28
Make module compilation work with elixir expressions
2013-11-22 21:41:59 +01:00
José Valim
5bd12f9cb9
Move lexical tracker to scope
2013-11-01 16:03:12 +01:00
José Valim
f1e2fcf9f9
Same module variables must be explicitly shared
...
Prior to this commit, the following code would work:
defmodule Hello do
defmacro write do
quote do
a = 1
end
end
defmacro read do
quote do
a
end
end
end
require Hello
Hello.write
Hello.read
Although this is convenient, it has many issues:
1. It is not clear at any point the intent of sharing the variables
in between the macros
2. Whenever macros from the same module are nested, there is a chance
a variable used before and after the nesting to be overriden
We address this issue by only allowing variables explicitly marked
with var! to be shared. Here is how the example above should be updated:
defmodule Hello do
defmacro write do
quote do
var!(a, Hello) = 1
end
end
defmacro read do
quote do
var!(a, Hello)
end
end
end
require Hello
Hello.write
Hello.read
2013-10-30 16:15:19 +01:00
José Valim
992ac67512
Improve coverage for location: :keep
2013-10-30 16:15:19 +01:00
José Valim
404f77421a
Refactor string interpolation to delegate to the tokenizer
...
This refactoring helps us clean up the interpolation code and
guarantee it works as expected since it goes under the same
tokenization rules. It also helps provide better sigil handling
(going to be improved in upcoming commits).
2013-10-25 13:19:47 +02:00
José Valim
f8c66c8516
Remove unecessary vars cache
2013-09-24 13:21:58 +02:00
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
34b6e17a1b
Fix shadowing warning in case with function, closes #1524
2013-08-02 13:04:03 +02:00
José Valim
fc505f8a82
Replace ?is_new_atom macro by ?is_atom_start
2013-07-07 21:14:36 +02:00
José Valim
15c1a9891c
Implement bindings in Elixir
2013-07-04 10:18:46 +02:00
José Valim
03323b9bfa
Macro.escape should also escape nested tuples, closes #1344
2013-06-30 15:30:44 +02:00
José Valim
391fee3ea2
^x variables should always refer to the value before the expression
...
Closes #1307
2013-06-21 18:27:16 +02:00
José Valim
5247961185
Optimize temp_vars lookup
2013-06-21 11:43:41 +02:00
José Valim
bff8a6ae75
Remove deprecated code branches
2013-06-13 16:48:31 +02:00
José Valim
fbb06f2086
Record each definition on tracker as soon as defined
2013-05-26 14:39:02 +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
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
e18c1602ba
Only add quoted: true to required ast nodes
2013-05-13 15:56:15 -06:00
José Valim
02d0aa1d9a
Deprecate var_context in favor of context
2013-05-13 15:56:15 -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
b90b8d1385
Improve cons cell and other operators precedence, closes #862
2013-05-12 14:24:35 -06:00
José Valim
c14ee51d15
Refactor elixir_quote to work on Elixir expressions
...
This allows us to re-use the code from Macro.escape,
reducing the duplication, and gives us more visibility
into the transformation process.
2013-05-04 14:31:58 -06:00
José Valim
c125636535
Ensure the macro system respects imports hygiene, closes #875
2013-04-13 18:25:43 -07:00
José Valim
b96c3c52ae
Remove check_require in favor of a meta tag
2013-04-13 17:19:19 -07:00
José Valim
f2e78d3d39
function(:is_atom, 1) is deprecated in favor of function(is_atom/1)
...
This is required so we can identity the proper function/arity
from quoting and properly hygienize function retrievals.
2013-04-13 17:19:19 -07:00
José Valim
6e8bcd9245
Update CHANGELOG
2013-03-10 18:12:50 -06:00
José Valim
28211b2714
Ensure aliases expansion also works for implicit aliases
2013-02-03 21:57:39 -07:00
José Valim
cd51c80362
Tidy up and clean up quote API, closes #814
2013-02-03 12:14:18 -07:00
José Valim
abb1ae981a
Add hygienic imports to macros
2013-01-21 20:45:49 -07:00