Skip to content

Commit

Permalink
fixup, the fix for #353 could lead to missing comments (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
Basile-z authored and Lars-Kristiansen committed May 28, 2019
1 parent 4c0e521 commit 3931fc8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dparse/parser.d
Original file line number Diff line number Diff line change
Expand Up @@ -2304,10 +2304,13 @@ class Parser
return null;
}
const b2 = setBookmark();
auto savedComment = comment;
node.variableDeclaration = parseVariableDeclaration(t, false);
if (node.variableDeclaration is null)
{
goToBookmark(b2);
if (savedComment && comment is null)
comment = savedComment;
node.functionDeclaration = parseFunctionDeclaration(t, false);
}
else abandonBookmark(b2);
Expand Down

0 comments on commit 3931fc8

Please sign in to comment.