Skip to content

Commit

Permalink
Merge pull request #3715 from ntrel/ptr-param
Browse files Browse the repository at this point in the history
D: fix parsing parameter with pointer
  • Loading branch information
masatake committed May 10, 2023
2 parents 6b06565 + 3c58e8d commit db05406
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 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 @@ -12,6 +12,7 @@ bar input.d /^ bar,$/;" e enum:Enum file:
bar input.d /^ public AliasInt bar()$/;" f class:Class
conditional input.d /^ T conditional;$/;" v file:
foo input.d /^ foo,$/;" e enum:Enum file:
g_inout input.d /^inout(int)* g_inout(inout(int)* p) { return p; }$/;" f
globalVar input.d /^__gshared int globalVar;$/;" v
i input.d /^int i;$/;" v
main input.d /^void main(string[] args)$/;" f file:
Expand Down
7 changes: 4 additions & 3 deletions Units/parser-d.r/simple.d.d/input.d
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ enum Enum : int

interface Interface
{
public AliasInt bar();
public AliasInt bar(); // FIXME prototypes
}

class Class : Interface
Expand Down Expand Up @@ -62,7 +62,8 @@ Object obj;

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

private:
Expand All @@ -75,7 +76,7 @@ int error;
@attr(i) int attr_decl = 1;
@attr(i) attr_decl_infer = 1; // FIXME
@(obj) T attr_anon;
void attr_post() @attr(obj); // FIXME
void attr_post() @attr(obj); // FIXME prototypes

static if (is(typeof(__traits(getMember, a, name)) == function))
T conditional;
Expand Down
3 changes: 0 additions & 3 deletions parsers/c-based.c
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,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 @@ -2306,8 +2305,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 db05406

Please sign in to comment.