Skip to content

Commit bf3fb7d

Browse files
committed
Move function
1 parent 3630bec commit bf3fb7d

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/cc/frontend/parser.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,22 @@ static void def_type(Type *type, Token *ident) {
169169
}
170170
}
171171

172+
Type *parse_var_def(Type **prawType, int *pstorage, Token **pident) {
173+
Type *rawType = prawType != NULL ? *prawType : NULL;
174+
if (rawType == NULL) {
175+
rawType = parse_raw_type(pstorage);
176+
if (rawType == NULL)
177+
return NULL;
178+
if (prawType != NULL)
179+
*prawType = rawType;
180+
}
181+
182+
if (rawType->kind == TY_AUTO)
183+
return parse_direct_declarator(rawType, pident);
184+
185+
return parse_declarator(rawType, pident);
186+
}
187+
172188
static Vector *parse_vardecl_cont(Type *rawType, Type *type, int storage, Token *ident) {
173189
Vector *decls = NULL;
174190
bool first = true;

src/cc/frontend/parser_expr.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,6 @@ static Expr *parse_member_access(Expr *target, Token *acctok) {
111111
}
112112
}
113113

114-
Type *parse_var_def(Type **prawType, int *pstorage, Token **pident) {
115-
Type *rawType = prawType != NULL ? *prawType : NULL;
116-
if (rawType == NULL) {
117-
rawType = parse_raw_type(pstorage);
118-
if (rawType == NULL)
119-
return NULL;
120-
if (prawType != NULL)
121-
*prawType = rawType;
122-
}
123-
124-
if (rawType->kind == TY_AUTO)
125-
return parse_direct_declarator(rawType, pident);
126-
127-
return parse_declarator(rawType, pident);
128-
}
129-
130114
static Expr *parse_compound_literal(Type *type) {
131115
Token *token = fetch_token();
132116
Initializer *init = parse_initializer();

0 commit comments

Comments
 (0)