Commit Graph
139 Commits
Author SHA1 Message Date
José Valim 600b7c63d3 Support split EEx clause middle expressions
Allow clause-introducing middle expressions
such as else, rescue, and catch to be followed
by a whitespace-only template segment and
another middle expression. This supports EEx
like with/try else clauses written as separate
tags, for example <% else %> followed by <% _ -> %>.

Keep whitespace-only bodies for ordinary arrow
clauses, so adjacent empty case/cond clauses
continue to compile as before.
2026-06-10 15:15:41 +02:00
Łukasz Samson 81dc36568b Enrich EEx.SyntaxError with error metadata (#15297)
Fixes #15296
2026-04-22 16:58:24 +02:00
Michał Łępicki 6d5f43318c Allow specifying SEED when running tests (#15111)
this is helpful when reproducing flaky test failures
2026-02-25 09:12:15 +01:00
Jonatan Männchen f3e8ceb5aa Implement Test Coverage Reporting (#14343) 2025-04-07 22:37:01 +02:00
José Valim 468228a236 Add :indentation to Code.string_to_quoted/2 (#14406) 2025-04-07 16:02:01 +02:00
Jonatan Männchen f7bbe81ea7 Inline licence info & copyright for test files (#14257) 2025-02-07 20:54:14 +01:00
José Valim a39f469a76 Do not warn for assignment with blocks in EEx 2024-06-15 11:04:53 +02:00
José Valim 25e6ce4271 Add pending deprecations 2024-05-24 13:11:29 +02:00
José Valim 43e029cbb4 Do not reset column state in tests 2023-12-21 16:17:05 +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
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 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 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
Aaron Tinio 5f7176450d Fix EEx.tokenize/2 CaseClauseError (#11677) 2022-03-02 07:57:55 +01:00
Felipe Renan 2f21080243 Expose EEx comments as tokens in EEx.tokenize/2 (#11674) 2022-03-01 21:55:11 +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 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
José Valim 80915e9d5f Add ~E sigil to EEx 2021-11-16 10:58:35 +01: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 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
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
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
Eksperimental 1db8de332c Fix typo in test name (#10258) 2020-08-12 16:31:35 +02:00
José Valim 5e96a9e1b1 Add test for invalid tokenizer expressions 2020-08-12 14:18:13 +02:00
José Valim 3f63845df4 Handle comments in EEx, closes #10256 2020-08-12 00:15:57 +02:00
José Valim 852325ec51 Make EEx trim behaviour more consistent
The previous rules made it hard to understand how it really worked.

The new rules are simpler, as it trims all whitespace, including new
lines, both on left and right sides, leaving at least one newline.
2020-02-26 20:19:28 +01:00
Wojtek Mach 5d142e4c25 Add column to EEx.SyntaxError (#9734) 2020-01-15 12:13:33 +01:00
Wojtek Mach 14f1d11494 Add :indentation option to EEx (#9724) 2020-01-14 20:41:54 +01:00
Wojtek Mach 530a1fca5c Track column information in EEx if enabled 2020-01-12 15:41:36 +01:00
José Valim 004c8baa44 Ensure multiline do/end with no spaces compile under trim mode 2019-12-23 11:47:21 +01:00
José Valim 97076019e4 Add async: true to tests using capture_io :stderr 2019-11-15 10:00:16 +01:00