José Valim
43e029cbb4
Do not reset column state in tests
2023-12-21 16:17:05 +01:00
José Valim
14f3a1e372
Deprecate single quotes as charlists
2023-10-29 13:30:03 +01:00
José Valim
c7bd0fe7e7
Do not emit duplicate warnings from tokenizer, closes #12961
2023-09-25 12:55:23 +02:00
José Valim
c8c4ec5155
Properly print warnings from tokenizer in EEx, closes #12926
2023-09-13 09:17:36 +02:00
José Valim
c365eac5dc
Return relative file in EEx, closes #12927
2023-09-13 09:02:42 +02:00
Benjamin Milde
afb2c8c1f0
Document default EEx Engine ( #12302 )
2022-12-16 10:08:38 +01:00
José Valim
cb90301c4c
Store and consider indentation in code snippets
2022-12-05 11:17:09 +01:00
Felipe Renan
524d917222
Fix line number padding for code snippet on EEx errors ( #12283 )
2022-12-04 17:07:52 +01:00
José Valim
5cf8811033
Align pointers to beginning of expression except for blocks
2022-12-04 16:50:27 +01:00
Felipe Renan
bb08692c96
Add snippet when <%-- is not closed ( #12218 )
2022-10-28 15:32:29 +02:00
José Valim
20d603653e
mix format
2022-10-27 23:29:46 +02:00
José Valim
ef5916bb67
Refactor and normalize format
2022-10-27 23:29:09 +02:00
Felipe Renan
17d34d06fe
Include snippets in EEx errors ( #12170 )
2022-10-27 23:17:39 +02:00
sabiwara
8908334041
Inspect charlists as ~c sigils ( #12074 )
2022-08-13 09:08:17 +02:00
sabiwara
29bf449f3f
Evaluate formating charlists as ~c sigils ( #12064 )
2022-08-10 06:47:00 +02:00
José Valim
1b60acbe9e
Allow LINE to be set for tests
2022-07-18 09:58:14 +02:00
José Valim
9b312ac046
Mention module docs for EEx options
2022-05-09 10:28:32 +02:00
Kurtis Rainbolt-Greene and Andrea Leopardi
5d4e357418
Add docs for the "options" argument in EEx.eval_string/3 ( #11805 )
...
Co-authored-by: Andrea Leopardi <an.leopardi@gmail.com >
2022-05-09 09:56:49 +02:00
Wojtek Mach
55c8776071
Fix EEx.tokenize/2 docs ( #11694 )
2022-03-10 13:23:54 +01:00
Aaron Tinio
5f7176450d
Fix EEx.tokenize/2 CaseClauseError ( #11677 )
2022-03-02 07:57:55 +01:00
Aaron Tinio
f5b8ce197d
Update EEx.token() type ( #11678 )
2022-03-02 07:57:24 +01:00
Felipe Renan
2f21080243
Expose EEx comments as tokens in EEx.tokenize/2 ( #11674 )
2022-03-01 21:55:11 +01:00
Michał Łępicki
187d09e672
Fix spec for EEx.tokenize/2 and EEx.Compiler.compile/2 ( #11670 )
2022-02-28 09:59:15 +01:00
Wojtek Mach and José Valim
0d621f6309
Add doc since to EEx.tokenize/2 ( #11669 )
...
Co-authored-by: José Valim <jose.valim@dashbit.co >
2022-02-27 10:35:09 +01:00
José Valim
55f6a78fb5
Use main EEx tokenize API
2022-02-27 10:23:21 +01:00
Felipe Renan
f9d0e702c6
Add EEx.tokenize/2 ( #11667 )
2022-02-27 10:01:42 +01:00
José Valim
f08646b85c
Remove TODO
2022-02-25 20:34:24 +01:00
José Valim
9097a16bee
Move some EEx syntax errors to tokenizer
2022-02-25 20:33:14 +01:00
Felipe Renan
bb4440336f
Refactor EEx tokenizer ( #11666 )
...
This commit moves the line and column to the last argument to be handled
as a metadata as you can see in the example below:
```elixir
assert T.tokenize('foo', 1, 1, @opts) ==
{:ok, [{:text, 'foo', %{line: 1, column: 1}}, {:eof, %{line: 1, column: 4}}]}
```
2022-02-25 20:24:25 +01:00
José Valim
9127a91cfb
Introduce multi-line comments to EEx via <%!-- --%> ( #11505 )
2021-12-19 20:48:00 +01:00
José Valim
8fab08cb56
Revert introduction of ~E sigil to avoid conflict with other projects
2021-11-23 14:29:29 +01:00
Wojtek Mach
06ee72f5b6
Update ~E docs ( #11394 )
2021-11-16 14:09:44 +01:00
José Valim
80915e9d5f
Add ~E sigil to EEx
2021-11-16 10:58:35 +01:00
José Valim
65ab34224f
Include column in warnings emitted by compiler ( #11339 )
...
We also extend Mix.Tasks.Compiler.Diagnostic
to include {line, column} as possible position.
We also explicitly document the behaviour of
line=0, which is equivalent to unknown line.
Elixir was already setting the line to zero in
multiple occasions prior to this patch, so this
patch makes it official and we stop returning `nil`
for said cases.
2021-10-24 16:28:36 +02:00
José Valim
c93184fb3c
Handle comments in EEx between do and the first clause
...
Closes #11307 .
2021-10-21 11:28:12 +02:00
José Valim
e480151fe7
Add Code.Fragment.container_cursor_to_quoted/2 ( #11315 )
2021-10-16 15:12:09 +02:00
José Valim
67ac8c1d81
Accept EEx expressions where -> is followed by newline
2021-09-10 11:48:38 +02:00
Aleksei Magusev
2f78233a0b
Standardize on do-end notation for the block syntax ( #11228 )
2021-09-06 10:59:57 +02:00
José Valim
46bd3d57d9
Add operator handling to Code.cursor_context
2021-07-21 18:59:43 +02:00
Wojtek Mach
567259658e
EEx: Add since to :parser_options ( #11072 )
2021-06-19 22:40:32 +02:00
Wannes Gennar
82014e1a9f
Add parser_options to EEx.Compiler ( #11071 )
2021-06-19 22:04:39 +02:00
Eksperimental
62dc1499d3
Properly case Elixir and EEx in tokenizer tests ( #10920 )
2021-04-19 08:20:07 +02:00
José Valim
525faf188b
Improve docs to EEx, closes #10653
2021-01-13 12:32:33 +01:00
José Valim
aea974cc05
Fix warnings on IEx
2020-12-26 20:24:23 +01:00
Aaron Ross
d74aaa7427
Generate error for unused "do" expression in EEx ( #10566 )
2020-12-14 07:27:24 +01:00
José Valim
4939f69f81
Add handle_text/3 to EEx.Engine
2020-12-12 08:37:27 +01:00
José Valim
7178d4743f
Add line and column to EEx tokenizer
2020-12-11 22:38:14 +01:00
José Valim
b1de2eb642
Deprecate use EEx.Engine in favor of explicit delegation
2020-12-11 21:52:27 +01:00
Andrea Leopardi
39ff5443c4
Clean up docs and support paths in EEx functions ( #10499 )
...
Before this commit, we were not supporting t:Path.t/0 paths but rather
t:String.t/0 paths in EEx file-related functions.
With this commit, we're not supporting t:Path.t/0. It's mostly calling
IO.chardata_to_string/0 on the given filename.
Another thing that was fixed is that now
:file and :line options in file-related EEx functions default to the
given file and line, but can be overridden. Before, they were forced.
I also cleaned up the docs here and there and added more examples.
2020-11-18 11:24:47 +01:00
José Valim
e01bfee359
Append space on middle and start expr if necessary, closes #10340
2020-09-17 17:11:22 +02:00