Skip to content

Commit

Permalink
D: fix parsing parameter with pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
ntrel committed May 8, 2023
1 parent 027c099 commit 69dd0ee
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions Units/parser-d.r/simple.d.d/expected.tags
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ attr_decl input.d /^@attr(i) int attr_decl = 1;$/;" v
bar input.d /^ bar,$/;" e enum:Enum file:
bar input.d /^ public AliasInt bar()$/;" f class:Class
conditional input.d /^ T conditional;$/;" v file:
f_inout input.d /^inout(int)* f_inout(inout(int)* p) { return p; }$/;" f
foo input.d /^ foo,$/;" e enum:Enum file:
globalVar input.d /^__gshared int globalVar;$/;" v
i input.d /^int i;$/;" v
Expand Down
2 changes: 1 addition & 1 deletion Units/parser-d.r/simple.d.d/input.d
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Object obj;

const(int)* type_con;
immutable(int)* type_imm;
inout(int)* f_inout(inout Object); // FIXME
inout(int)* f_inout(inout(int)* p) { return p; }
shared(int)[] type_shar;

private:
Expand Down
3 changes: 0 additions & 3 deletions parsers/c-based.c
Original file line number Diff line number Diff line change
Expand Up @@ -2285,7 +2285,6 @@ static void parseAtMarkStyleAnnotation (statementInfo *const st)
static int parseParens (statementInfo *const st, parenInfo *const info)
{
tokenInfo *const token = activeToken (st);
unsigned int identifierCount = 0;
unsigned int depth = 1;
bool firstChar = true;
int nextChar = '\0';
Expand All @@ -2307,8 +2306,6 @@ static int parseParens (statementInfo *const st, parenInfo *const info)
case '&':
case '*':
info->isPointer = true;
if (identifierCount == 0)
info->isParamList = false;
initToken (token);
break;

Expand Down

0 comments on commit 69dd0ee

Please sign in to comment.