Skip to content

Commit

Permalink
🎨 more ast cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
fennecdjay committed Jan 30, 2024
1 parent 0ba7b3b commit 56d8b92
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 129 deletions.
10 changes: 5 additions & 5 deletions include/absyn.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct Type_Decl_ {
ae_flag flag;
bool ref;
};
ANEW ANN AST_NEW(Type_Decl *, type_decl, const Symbol, const loc_t pos);
ANEW ANN AST_NEW(Type_Decl *, type_decl, const Symbol, const loc_t);
ANN void free_type_decl(MemPool p, Type_Decl *);

enum tmplarg_t {
Expand Down Expand Up @@ -126,7 +126,7 @@ typedef struct {
ANN2(1,2,4) AST_NEW(Exp, exp_lambda, const Symbol, const Arg_List, const Stmt_List,
const loc_t);
AST_NEW(Exp, exp_lambda2, const Symbol xid, const Arg_List args, const Exp exp,
const struct loc_t_ pos);
const loc_t);
/** array_subscript. @code [0][0] @endcode */
struct Array_Sub_ {
Exp exp;
Expand All @@ -143,7 +143,7 @@ typedef struct {
Array_Sub array;
} Exp_Array;
ANEW ANN AST_NEW(Exp, exp_array, const Exp, const Array_Sub,
const loc_t pos);
const loc_t);

/** range. @code [12:12] @endcode or @code [1:] @endcode or @code [:12]
* @endcode*/
Expand All @@ -159,7 +159,7 @@ typedef struct {
Exp base;
Range *range;
} Exp_Slice;
ANEW ANN AST_NEW(Exp, exp_slice, const Exp, Range *, const loc_t pos);
ANEW ANN AST_NEW(Exp, exp_slice, const Exp, Range *, const loc_t);

ANN void free_id_list(MemPool p, ID_List);

Expand Down Expand Up @@ -737,7 +737,7 @@ typedef struct Prim_Def_ {
ae_flag flag;
} *Prim_Def;

AST_NEW(Prim_Def, prim_def, const Symbol name, const m_uint size, const loc_t loc, const ae_flag flag);
AST_NEW(Prim_Def, prim_def, const Symbol name, const m_uint size, const loc_t, const ae_flag flag);
ANN void free_prim_def(MemPool p, Prim_Def);

static inline bool is_prim(const Exp e) { return e->exp_type == ae_exp_primary; }
Expand Down
2 changes: 1 addition & 1 deletion include/bison_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef __BISON_COMPAT
#define __BISON_COMPAT

#define YYLTYPE struct loc_t_
#define YYLTYPE loc_t

#define YYLTYPE_IS_DECLARED

Expand Down
2 changes: 1 addition & 1 deletion include/pp.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ typedef struct PPState_ {
void * data;
};
m_str filename;
loc_t pos;
loc_t loc;
enum pptype type;
} PPState;

Expand Down
4 changes: 2 additions & 2 deletions include/scanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ typedef struct Scanner_ {

ANN2(1, 2)
int scanner_error(Scanner *scan, const char *main, const char *explain,
const char *fix, const loc_t pos, uint error_code);
ANN int scanner_secondary(Scanner *scan, const char *main, const loc_t pos);
const char *fix, const loc_t loc, const uint error_code);
ANN int scanner_secondary(Scanner *scan, const char *main, const loc_t loc);

ANN loc_t defer_stmt(const Stmt stmt);
#endif
Loading

0 comments on commit 56d8b92

Please sign in to comment.