Skip to content

Commit

Permalink
add missing token ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 committed Jan 16, 2023
1 parent 113b518 commit 88f247e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/dparse/parser.d
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,10 @@ class Parser
if (currentIs(tok!","))
advance();
if (currentIs(tok!")"))
{
node.tokens = tokens[startIndex .. index];
return node;
}
mixin(parseNodeQ!(`node.message`, `AssignExpression`));
if (currentIs(tok!","))
advance();
Expand Down Expand Up @@ -1129,6 +1132,7 @@ class Parser
node.tokens = tokens[startIndex .. index];
return node;
}
ternary.tokens = tokens[startIndex .. index];
return ternary;
}

Expand Down Expand Up @@ -3929,6 +3933,7 @@ class Parser
if (node.indexer is null)
{
goToBookmark(b);
node.tokens = tokens[startIndex .. index];
return node;
}
// indexer followed by ".." -> sliceExp -> type suffix
Expand All @@ -3937,6 +3942,7 @@ class Parser
allocator.rollback(cp);
node.indexer = null;
goToBookmark(b);
node.tokens = tokens[startIndex .. index];
return node;
}
// otherwise either the index of a type list or a dim
Expand Down Expand Up @@ -4093,6 +4099,7 @@ class Parser
IfCondition parseIfCondition()
{
IfCondition node = allocator.make!IfCondition;
auto startIndex = index;
const b = setBookmark();

// ex. case:
Expand Down Expand Up @@ -4164,6 +4171,7 @@ class Parser
{
error("expression or declaration expected");
}
node.tokens = tokens[startIndex .. index];
return node;
}

Expand Down

0 comments on commit 88f247e

Please sign in to comment.