Skip to content

Commit 0fb5797

Browse files
committed
AST WIP
1 parent 6eda17a commit 0fb5797

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

include/ps_ast.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ extern "C"
6060
ps_symbol *result_type; // for functions, NULL for procedures
6161
ps_symbol_table
6262
*symbol_table; /** @brief constants, types, variables, functions and procedures defined in this block */
63-
ps_ast_node_statement_list instructions;
63+
ps_ast_node_statement_list statements;
6464
} ps_ast_node_block;
6565

6666
typedef struct ps_parameter

include/ps_symbol.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,18 @@ extern "C"
3030
PS_SYMBOL_KIND_PROCEDURE,
3131
PS_SYMBOL_KIND_FUNCTION,
3232
// ...
33-
} /*__attribute__((__packed__))*/ ps_symbol_kind;
33+
} __attribute__((__packed__)) ps_symbol_kind;
3434

3535
/** @brief Symbol is a named typed value */
3636
typedef struct s_ps_symbol
3737
{
38-
ps_identifier name; /** @brief Symbol name in uppercase */
39-
ps_value *value; /** @brief current value, must be a pointer as it is a forward reference */
40-
ps_symbol_kind kind : 6; /** @brief Auto, type definition, program, ... */
41-
bool system : 1; /** @brief true if symbol is a system symbol (predefined) */
42-
bool allocated : 1; /** @brief true if symbol was allocated (and must be freed) */
38+
// clang-format off
39+
ps_identifier name; /** @brief Symbol name in uppercase */
40+
ps_value *value; /** @brief current value, must be a pointer as it is a forward reference */
41+
ps_symbol_kind kind:6; /** @brief Auto, type definition, program, ... */
42+
bool system:1; /** @brief true if symbol is a system symbol (predefined) */
43+
bool allocated:1; /** @brief true if symbol was allocated (and must be freed) */
44+
// clang-format on
4345
} /*__attribute__((__packed__))*/ ps_symbol;
4446

4547
#define PS_SYMBOL_KIND_SIZE sizeof(ps_symbol_kind)

0 commit comments

Comments
 (0)