mirror of
https://github.com/ruuda/rcl.git
synced 2025-12-23 04:47:19 +00:00
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. |
||
|---|---|---|
| .. | ||
| theme@8bb6e3cf1b | ||
| changelog.md | ||
| functions.md | ||
| glossary.md | ||
| imports.md | ||
| index.md | ||
| installation.md | ||
| null.md | ||
| python_bindings.md | ||
| rcl.md | ||
| rcl_evaluate.md | ||
| rcl_format.md | ||
| rcl_highlight.md | ||
| rcl_query.md | ||
| stdlib.md | ||
| strings.md | ||
| syntax.md | ||
| syntax_highlighting.md | ||
| testing.md | ||
| tree_sitter.md | ||
| tutorial.md | ||
| type_dict.md | ||
| type_list.md | ||
| type_set.md | ||
| type_string.md | ||
| types.md | ||
| using_ninja.md | ||