Skip to content

Commit

Permalink
fix(parser): better line tracking in parser when constructing a funct…
Browse files Browse the repository at this point in the history
…ion call
  • Loading branch information
SuperFola committed Jun 15, 2024
1 parent 8184f6f commit 250e332
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/arkreactor/Compiler/AST/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ namespace Ark::internal
{
if (!accept(IsChar('(')))
return std::nullopt;
auto cursor = getCursor();
std::string comment;
newlineOrComment(&comment);

Expand All @@ -708,7 +709,7 @@ namespace Ark::internal
}

std::optional<Node> leaf { call_type };
setNodePosAndFilename(leaf.value());
setNodePosAndFilename(leaf.value(), cursor);
leaf->push_back(func.value());

while (!isEOF())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
c # last element
]
[a b c] # list

(foo
# func
bar
Expand Down
1 change: 0 additions & 1 deletion tests/unittests/resources/FormatterSuite/field.expected
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(let a foo.closure.name)

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

0 comments on commit 250e332

Please sign in to comment.