rcl/docs
Ruud van Asseldonk 43fd48d106 Restrict what expressions can be conditions
The fuzzer now discovered a non-idempotency in the formatter, in case
there is a non-code prefix for the condition. This has something to do
with the space between "if" and the condition, there is no separator
there, whatever follows goes on the same line, which is usually not the
case.

For evaluation everything works fine, but how do you format this? We can
try to repair it, but it's hard. A solution that sidesteps all this is
to restrict what kind of expressions we can have after an if. Just don't
allow statements and ifs there. We don't lose any expressivity, if you
want that it still works, just put parens around it. With parens it is
also possible to format the expression properly, e.g.

if (
  // Comments are fine, everything is indented here, etc.
  condition
):
  then_value
else
  else_value

Oh, and unrelated, I think I am convinced that I want the colon after
"else" back. But let's do that in a follow-up. Or maybe it can be
optional but the formatter always puts it there?

The implementation of this forces propagating spans in more places,
which ended up being a drive-by fix for one place where spans were
computed incorrectly. This fix shows up in the golden tests.
2024-06-16 22:49:36 +02:00
..
theme@8bb6e3cf1b Update to latest version of docs theme 2023-11-20 23:12:09 +01:00
changelog.md Restrict what expressions can be conditions 2024-06-16 22:49:36 +02:00
functions.md Correct invalid example in function docs 2024-02-05 19:16:40 +01:00
glossary.md Remove ':' after 'else' after all 2023-12-29 13:23:54 +01:00
imports.md Implement filesystem sandbox for imports 2023-10-20 18:22:38 +02:00
index.md Add "share config between tools" as a key point 2024-02-20 22:17:40 +01:00
installation.md Remove Cargo installation instructions 2024-04-20 11:41:38 +02:00
null.md Document justification for null 2023-09-08 20:03:36 +02:00
python_bindings.md Cross-reference Python installation docs 2024-02-15 00:22:06 +01:00
rcl.md Make --color not apply when using --output 2024-02-20 20:52:14 +01:00
rcl_evaluate.md Make --color not apply when using --output 2024-02-20 20:52:14 +01:00
rcl_format.md Document the magic trailing comma for formatting 2024-06-15 21:55:38 +02:00
rcl_highlight.md Simplify stdin defaults 2023-12-17 22:37:10 +01:00
rcl_query.md Document new output option 2024-02-19 21:30:10 +01:00
stdlib.md Document List.reverse and std.range 2023-12-12 00:27:31 +01:00
strings.md Allow escaping } in strings 2024-03-02 19:37:30 +01:00
syntax.md Document how to produce an empty set 2024-02-24 23:06:23 +01:00
syntax_highlighting.md Document syntax highlighting for Neovim 2024-03-15 22:01:37 +01:00
testing.md Rename main fuzzer to "fuzz_source" 2024-04-27 14:11:03 +02:00
tree_sitter.md Correct leftover in Tree-sitter docs 2024-03-15 22:01:37 +01:00
tutorial.md Rename --output to --format 2024-02-19 20:40:35 +01:00
type_dict.md Use type highlighting in the docs 2024-03-02 12:05:15 +01:00
type_list.md Use type highlighting in the docs 2024-03-02 12:05:15 +01:00
type_set.md Use type highlighting in the docs 2024-03-02 12:05:15 +01:00
type_string.md Use type highlighting in the docs 2024-03-02 12:05:15 +01:00
types.md Document union types 2024-04-22 21:38:18 +02:00
using_ninja.md Write how to do dynamic targets 2024-02-20 22:17:40 +01:00