José Valim
c11af58d93
Make a distinction between eol and ;
2014-08-12 16:27:45 +02:00
José Valim
aa4a38bccc
No longer allow empty access as in [][]
2014-07-16 17:54:26 +02:00
José Valim
ecdcfaeda1
Remove deprecated features and deprecate soft ones
2014-07-12 16:23:17 +02:00
José Valim
28264c6792
Improvements to the operator table
...
* |>, <<<, >>> and ^^^ were made left associative
* <, >, <=, >= were given higher precedence than
comparison ones (==, !=, etc)
* xor is deprecated
2014-06-29 16:18:33 +02:00
José Valim
b4415f2a14
Change precedence of & to not special case /
2014-06-28 11:16:51 +02:00
José Valim
eb32937858
Get rid of Kernel.access/2 in favor of Access.get/2
2014-05-24 12:45:33 +02:00
José Valim
8652ee5838
Do not allow keyword on containers without pos args
2014-05-23 20:59:38 +02:00
José Valim
55e885f5c5
Ensure we don't leak erlang terms on failure, closes #2303
2014-05-21 12:44:12 +02:00
José Valim
dc9803de6d
Remove inlist and inbits from keywords list
2014-05-19 23:12:45 +02:00
José Valim
bf8f5c4bb8
Add String.to_char_list and List.to_string
2014-05-17 13:59:17 +02:00
Eric Meadows-Jönsson
d868b4d066
Do not wrap single lists in :__block__
2014-04-27 22:26:14 +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
6624f31472
Merge branch 'jv-char-data'
...
Conflicts:
lib/eex/lib/eex/tokenizer.ex
lib/elixir/lib/file.ex
lib/elixir/lib/kernel.ex
lib/elixir/lib/record/extractor.ex
lib/elixir/lib/string.ex
lib/ex_unit/lib/ex_unit/doc_test.ex
lib/mix/lib/mix/archive.ex
lib/mix/lib/mix/dep/fetcher.ex
lib/mix/lib/mix/dep/umbrella.ex
2014-04-21 08:38:48 +02:00
José Valim
d33463dcd5
Unify precedence of when, :: and |
2014-03-31 12:28:33 +02:00
Eric Meadows-Jönsson
04e774a4ba
Support interpolation in keyword list atoms
...
key = "foo"
["#{key}": :value]
2014-03-05 16:43:26 +01:00
José Valim
6a725ab91f
Provide List.from_char_data! and String.from_char_data!
2014-02-23 11:04:24 +01:00
José Valim
128d82fde6
Add defstruct and allow unquoting inside maps/structs
2014-02-19 22:35:09 +01:00
José Valim
da1541c791
Implement access and slightly reorganize tests
2014-02-05 16:11:53 +01:00
José Valim
de71ecf195
Remove outdated default args syntax
2014-02-05 14:58:28 +01:00
José Valim
ffdf3d32b2
Ensure multiple kw args with pipe
2014-02-04 22:30:51 +01:00
José Valim
1fa74df6c7
Support map updates
2014-02-04 20:54:15 +01:00
José Valim
cb9c17c025
Allow %{ foo => bar }
2014-02-04 18:00:04 +01:00
José Valim
923eeb9602
Unify max_expr to avoid duplication
2014-02-04 17:22:43 +01:00
José Valim
c5ff2d1dcf
Basic support for maps in the grammar
2014-02-03 20:18:01 +01:00
José Valim
c65dcc9b19
Refactor grammar and unify base_expr into max_expr
2014-02-03 17:52:27 +01:00
José Valim
2b12cb4a7e
Remove unecessary lexical check in parser
2014-01-30 22:04:39 +01:00
José Valim
05cd7f170f
Fix list with keywords expansion
...
The list `[1, 2, three: :four]` now correctly expands
to `[1, 2, {:three, :four}]`.
2014-01-28 20:59:07 +01:00
José Valim
0d4655d1db
Generalize unary operators followed by int have higher precedence
2014-01-28 19:54:09 +01:00
José Valim
fe2e4a1010
Move from // to \\
2014-01-28 10:50:00 +01:00
José Valim
ec94c93b24
Remove ** from operators list for now
2014-01-20 12:24:22 +01:00
José Valim
f671e1204c
Change precedence of <- to be the same as other generators
2014-01-16 20:08:55 +01:00
José Valim
53b68887b6
Invert the precedence of | and when
...
Although this adds some drawbacks when it comes to typespecs,
it prepares us for when we have named patterns.
2014-01-11 16:52:46 +01:00
José Valim
96a1628033
Unify precedence of ++, --, **, .., <> ops
2014-01-09 01:06:34 +01:00
José Valim
ade26dedd8
Work on Elixir expressions rather than forms
2013-12-28 11:47:44 +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
Eric Meadows-Jonsson
a711bef57f
Dont require [] for keyword list operand in when/2
2013-12-13 13:12:25 +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
Eric Meadows-Jonsson
f125d19854
Move typespec guards to end of spec
...
Moves precedence of `when` to be lower than `::`.
2013-11-11 10:08:24 +01:00
José Valim
0171e201fb
Move parsing from elixir_interpolations to elixir_parser
2013-10-26 13:46:01 +02:00
José Valim
0b3c91bf6d
Do not wrap fn -> end in do keyword
...
The previous AST came from the fact `fn -> end` was a shortcut
for `function do ... end`. But now since the original no longer
exists, it seems saner to update `fn -> end` AST.
2013-10-24 22:38:25 +02:00
José Valim
997a0857c3
Avoid flattening in access[...], closes #1763
2013-10-18 14:54:49 +02:00
José Valim
488344839a
Allow any function identifier as a variable, closes #1649
2013-08-25 10:28:55 -03:00
José Valim
a6cdc835a1
No need to wrap quote do: nil in a block
2013-08-23 11:22:11 +02:00
José Valim
0510512375
Deprecate to_binary in favor of to_string
...
We also rename Binary.Chars to String.Chars.
As Binary.Chars was the protocol used for interpolation,
it is semantically correct to have a protocol that works
on strings, instead of raw binaries.
2013-08-22 12:19:30 +02:00
José Valim
a696b9cc11
Update Macro.to_string comments
2013-08-15 14:27:53 +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
cea31f69dc
Review and deprecate list <-> binary conversion
2013-08-14 11:16:37 +02:00
José Valim
a154a9e99a
Allow &1.foo syntax inside capture
2013-07-31 16:03:52 +02:00
José Valim
b5428adda6
Add &local/arity and &Remote.fun/arity
2013-07-31 12:58:07 +02:00
José Valim
abb2ada8b1
Make & an unary operator
2013-07-29 14:08:33 +02:00