Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D: fix parsing parameter with pointer #3715

Merged
merged 1 commit into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -17,6 +17,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 @@ -73,7 +73,8 @@ Object obj;

const(int)* type_con;
immutable(int)* type_imm;
inout(int)* f_inout(inout Object); // FIXME
masatake marked this conversation as resolved.
Show resolved Hide resolved
inout(int)* f_inout(inout Object); // FIXME prototypes
inout(int)* g_inout(inout(int)* p) { return p; }
shared(int)[] type_shar;

private:
Expand All @@ -86,7 +87,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 @@ -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