diff --git a/src/arkreactor/Compiler/AST/Parser.cpp b/src/arkreactor/Compiler/AST/Parser.cpp index 89828c362..868ec156b 100644 --- a/src/arkreactor/Compiler/AST/Parser.cpp +++ b/src/arkreactor/Compiler/AST/Parser.cpp @@ -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)) diff --git a/tests/unittests/resources/FormatterSuite/conditions.expected b/tests/unittests/resources/FormatterSuite/conditions.expected index 3ceb8cdac..0d542242d 100644 --- a/tests/unittests/resources/FormatterSuite/conditions.expected +++ b/tests/unittests/resources/FormatterSuite/conditions.expected @@ -6,6 +6,7 @@ (if (cond) (do) (stuff)) + # conditions in functions are on their own line (fun () (if true 0)) diff --git a/tests/unittests/resources/FormatterSuite/field.expected b/tests/unittests/resources/FormatterSuite/field.expected index a25f4749f..54799a5e8 100644 --- a/tests/unittests/resources/FormatterSuite/field.expected +++ b/tests/unittests/resources/FormatterSuite/field.expected @@ -1,4 +1,5 @@ (let a foo.closure.name) + (foo.closure.name # test this.bar.egg.qux)