Skip to content

Commit

Permalink
fix(parser, formatter): slightly changes the way newlines are inserte…
Browse files Browse the repository at this point in the history
…d to separate blocks, based on the lines that separate them initially
  • Loading branch information
SuperFola committed Apr 4, 2024
1 parent 8f4cbf6 commit c29bc3b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/arkreactor/Compiler/AST/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,10 +869,10 @@ namespace Ark::internal
if (newlineOrComment(&comment))
result.value().attachCommentAfter(comment);

if (!suffix(')'))
errorMissingSuffix(')', name);
if (result->isListLike())
setNodePosAndFilename(result->list().back());
if (!suffix(')'))
errorMissingSuffix(')', name);

comment.clear();
if (spaceComment(&comment))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
(if (cond)
(do)
(stuff))

# conditions in functions are on their own line
(fun ()
(if true 0))
Expand Down
1 change: 1 addition & 0 deletions tests/unittests/resources/FormatterSuite/field.expected
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(let a foo.closure.name)

(foo.closure.name
# test
this.bar.egg.qux)
Expand Down

0 comments on commit c29bc3b

Please sign in to comment.