Skip to content

Commit

Permalink
Allow parsing the whole module
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuukk authored Nov 15, 2023
1 parent 09f4e7e commit 3ea5241
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dsymbol/src/dsymbol/conversion/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class AutocompleteParser : Parser
{
if (!currentIs(tok!"{"))
return null;
if (current.index > cursorPosition)
if (cursorPosition != -1 && current.index > cursorPosition)
{
BlockStatement bs = allocator.make!(BlockStatement);
bs.startLocation = current.index;
Expand All @@ -126,7 +126,7 @@ class AutocompleteParser : Parser
immutable start = current.index;
auto b = setBookmark();
skipBraces();
if (tokens[index - 1].index < cursorPosition)
if (cursorPosition != -1 && tokens[index - 1].index < cursorPosition)
{
abandonBookmark(b);
BlockStatement bs = allocator.make!BlockStatement();
Expand All @@ -142,7 +142,7 @@ class AutocompleteParser : Parser
}

private:
size_t cursorPosition;
long cursorPosition;
}

class SimpleParser : Parser
Expand Down

0 comments on commit 3ea5241

Please sign in to comment.