Aleksei Magusev
d22e456047
Improve warning output ( #4631 )
2016-05-16 00:10:51 +02:00
José Valim
b79b041fad
Improve ambiguous pipe message
2016-05-15 20:46:37 +02:00
José Valim
7cac73a095
Unify warning calls
2016-05-15 20:34:29 +02:00
eksperimental
0aece49e2d
Replace 'char_list' and 'char list' with 'charlist'
2016-05-07 03:20:57 +07:00
eksperimental
4ceb41e71b
Formmating: Add white space around vertical bar ( #4507 )
2016-04-25 00:55:49 +02:00
Andrea Leopardi
8619d26c4d
Handle chars literals in the parser for better syntax errors
...
Before this commit, we handled char literals (like `?a`) in the
tokenizer, turning a literal like `?a` into the token `{:number, _,
97}` (thus indistinguishable from the literal `97` at the parsing
stage). This led to error messages with the integer for the character
instead of the character literal, e.g.:
iex> :ok ?a
** (SyntaxError) iex:11: syntax error before: 97
With this commit, we now turn `?a` into the token `{:char, _,
97}` (which is the same token used by Erlang for Erlang char literals
like `$a`); since it's the same token as in Erlang, the parser will now
output the char literal as an Erlang char (`?a` would be printed as
`$a`). We hijack the error message in elixir_errors.erl to end up with
the correct message:
iex> :ok ?a
** (SyntaxError) iex:11: syntax error before: ?a
2016-04-04 21:29:15 +02:00
José Valim
d1d81af7c0
Allow variable struct names when matching
2016-02-21 14:19:57 +01:00
José Valim
901504030f
Update elixir_parser.yrl
2016-01-12 10:11:51 +01:00
José Valim
5d5d7dadb4
is -> may be
2015-12-21 16:30:59 +01:00
José Valim
7b5f4a5842
Improve error message for invalid do/do:
2015-11-20 17:30:40 +08:00
Aleksei Magusev
ff04de1592
Remove unreachable function "branch" in parser
2015-11-17 12:06:35 +01:00
Aleksei Magusev
58fcce1bfc
Remove undesirable output in parser
2015-11-17 11:43:09 +01:00
José Valim
a34d81c253
often undesired -> ambiguous
2015-11-16 14:04:40 +01:00
José Valim
3487d00ddb
Warn when piping into functions without parens, closes #3642
2015-11-16 13:26:05 +01:00
José Valim
15a613dd08
before -> after
2015-11-14 22:03:56 +01:00
Andrea Leopardi
e4db37c1b0
Throw an error for -> with an empty right-hand side
2015-11-13 01:40:53 +01:00
Aleksei Magusev
a5a29dc47b
Add support for x.{y, z, w} expression
2015-09-25 11:53:54 +02:00
José Valim
c2813ac1ea
Also perform new line checking with structs
2015-08-16 20:47:53 +02:00
José Valim
aa43f3f281
Emit syntax error for invalid fn end, closes #3311
2015-08-16 15:30:20 +02:00
José Valim
1afb655191
Make a distinction between Location, Token and Node in parser
2015-08-15 14:14:11 +02:00
José Valim
b3d74127cf
Make a distinction between strict containers and strict calls
2015-08-01 08:25:52 +02:00
José Valim
cb02ed8eed
Provide detailed error message for nested parens calls
2015-07-17 15:27:52 +02:00
José Valim
d235533b45
Remove reference to dynamic operators in table
2015-07-14 09:27:44 +02:00
José Valim
3e52ed0fbb
Ensure proper precedence of operators when mixing matched and unmatched
2015-07-07 16:18:29 +02:00
José Valim
7fda0dd5c1
Disallow more ambiguous expressions
2015-07-07 15:23:46 +02:00
José Valim
a52c2b5abf
Do not allow nested ambig expressions
2015-07-07 11:48:32 +02:00
eksperimental
61675c3ea8
Add space after comma: Format consistently
2015-03-17 22:55:27 +07:00
Or Neeman
a870c88cc3
Refine parsing of no parens calls
...
Reimplements 7f528aa1c0 , which was
reverted due to having introduced a bug. This commit avoids that bug
and includes a regression test for it. Hat-tip to José Valim for
finding a way to refactor this PR so as to simplify it greatly.
Closes #3074
2015-03-12 19:33:16 -06:00
José Valim
4ecc9ee1df
Revert "Merge pull request #3109 from oneeman/refine_no_parens_parsing"
...
This pull request has broken the following expression:
assert [] = TestRepo.all from p in Post, where: p.title in ^[]
Previously it was parsed as:
assert [] = TestRepo.all(from p in Post, where: p.title in ^[])
But after this pull request it is parsed as:
assert [] = TestRepo.all from(p in Post), where: p.title in ^[]
This reverts commit 7f528aa1c0 , reversing
changes made to 98746e08ea .
Conflicts:
lib/elixir/src/elixir_parser.yrl
2015-03-02 11:14:12 +01:00
Alexei Sholik
62e6e026cf
Replace "parenthesis" with "parentheses" in comments and doc strings
2015-02-26 20:03:43 +01:00
Alexei Sholik
3f5999af87
Replace "in between" with "between" in comments and doc strings
2015-02-26 20:00:22 +01:00
José Valim
0003f38826
Add line breaks to code comment
2015-02-23 09:24:56 +01:00
Or Neeman
ee504eb19e
Add comments explaining changes to parser
2015-02-22 17:26:18 -06:00
Or Neeman
b432fc74d3
Throw syntax error on [f g :a, :b]
2015-02-22 17:26:18 -06:00
Or Neeman
c8132617d6
Add distinction between no_parens_one and no_parens_ambig to parser
2015-02-22 17:26:18 -06:00
José Valim
3726082cb0
Split containers and call args expressions
2015-02-22 19:55:55 +01:00
José Valim
0730829ae1
Unify empty parens and map exprs handling
2015-02-22 19:55:55 +01:00
Or Neeman
76cbf96369
Throw syntax error for :foo.Bar
...
Closes #2986
2015-02-08 16:56:14 -06:00
Alexander Ivanov
c76a186687
Change location info format in tokenizer
...
Start column counting in tokenizer from 1, store location info in a tuple `{Line, BeginColumn, EndColumn}` instead of a list
2015-01-05 13:35:23 +02:00
Alexander Ivanov
a9495e7586
Fix line extraction in elixir_parser
2015-01-05 12:16:15 +02:00
Alexander Ivanov
a288ddd326
Add column info in tokenizer, #2987
...
Add column info for each token in elixir_tokenizer.
Change the format of location info from `Line` to `[Line, BeginColumn,
EndColumn]`. Pass the current column after the current line in
`elixir_tokenizer:tokenize`. Reflect the change in related modules.
2015-01-05 03:34:53 +02:00
José Valim
843706e36e
Add free operators
...
<<~, ~>>, <~, ~>, <~>, <|>
2014-09-07 12:42:10 +02:00
José Valim
172bfdb128
Revert "Merge pull request #2702 from alexrp/master"
...
<~ is already a valid expression in Elixir.
This reverts commit 2c741ec6ae , reversing
changes made to 12a457829f .
2014-09-07 12:12:35 +02:00
Alex Rønne Petersen
c8bcd89c7c
Introduce new operators intended for use by parser combinator libraries.
...
The expected definitions (which are by no means required) in
parser combinator speak are:
* `p ~>> f` = `bind(p, f)`
* `p1 ~> p2` = `pair_right(p1, p2)`
* `p1 <~ p2` = `pair_left(p1, p2)`
* `p1 <~> p2` = `pair_both(p1, p2)`
* `p |~> f` = `map(p, f)`
* `1p <|> p2` = `either(p1, p2)`
2014-09-02 01:57:50 +02:00
José Valim
e6e71675ac
Make a distinction between eol and ;
2014-08-12 16:27:45 +02:00
José Valim
6ffb248f03
No longer allow empty access as in [][]
2014-07-16 17:54:26 +02:00
José Valim
058b157b36
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