Skip to content

Commit

Permalink
Parser
Browse files Browse the repository at this point in the history
- Added `parseStar()`
  • Loading branch information
deavmi committed May 21, 2024
1 parent 2098182 commit 4661a90
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions source/tlang/compiler/parsing/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -2242,6 +2242,28 @@ public final class Parser
}
}

/**
* Handles cases where we start
* with the `*` token. This could
* include `*ptr = ...` or, perhaps,
* a function call with `*n.n()`
*
* Returns: a `Statement`
*/
private Statement parseStar()
{
WARN("parseStar(): Enter");

Statement stmt = parseDerefAssignment();




WARN("parseStar(): Leave");
return stmt;
}


private Statement parseDerefAssignment()
{
WARN("parseDerefAssignment(): Enter");
Expand Down Expand Up @@ -2480,10 +2502,10 @@ public final class Parser
/* Parse the discard statement */
statement = parseDiscard();
}
/* If it is a dereference assigment (a `*`) */
/* If it is a dereference (a `*`) */
else if(symbol == SymbolType.STAR)
{
statement = parseDerefAssignment();
statement = parseStar();
}
/* If it is a kind-of comment */
else if(symbol == SymbolType.SINGLE_LINE_COMMENT || symbol == SymbolType.MULTI_LINE_COMMENT)
Expand Down

0 comments on commit 4661a90

Please sign in to comment.