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 May 28, 2019
1 parent cf12c2d commit 5270739
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 @@ -2319,10 +2319,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 5270739

Please sign in to comment.