diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-04-18 21:43:24 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-04-18 22:29:41 -0400 |
commit | 85c5f17dcd09540e31dc879166502984e483609d (patch) | |
tree | 6bc4c9ea1f265756e8b563885dabcdc0af09b0cf /dimension/parse.h | |
parent | 6437ab96674accfb5d5d85066e58d20887c926d7 (diff) | |
download | dimension-85c5f17dcd09540e31dc879166502984e483609d.tar.xz |
Have dmnsn_diagnostic() take a dmnsn_parse_location.
Diffstat (limited to 'dimension/parse.h')
-rw-r--r-- | dimension/parse.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/dimension/parse.h b/dimension/parse.h index 6e5ef09..3a830b8 100644 --- a/dimension/parse.h +++ b/dimension/parse.h @@ -165,8 +165,16 @@ typedef enum { DMNSN_AST_MACRO } dmnsn_astnode_type; +typedef struct dmnsn_astnode dmnsn_astnode; + +typedef struct dmnsn_parse_location { + const char *first_filename, *last_filename; + int first_line, last_line; + int first_column, last_column; +} dmnsn_parse_location; + /* Abstract syntax tree node (a dmnsn_array* of these is an AST) */ -typedef struct dmnsn_astnode { +struct dmnsn_astnode { dmnsn_astnode_type type; /* Child nodes */ @@ -180,9 +188,8 @@ typedef struct dmnsn_astnode { unsigned int *refcount; /* File name, and line and column numbers from source code */ - const char *filename; - int line, col; -} dmnsn_astnode; + dmnsn_parse_location location; +}; typedef dmnsn_array dmnsn_astree; @@ -241,13 +248,6 @@ dmnsn_astree *dmnsn_parse_string(const char *str, dmnsn_symbol_table *symtable); /* * Parser internals */ - -typedef struct dmnsn_parse_location { - const char *first_filename, *last_filename; - int first_line, last_line; - int first_column, last_column; -} dmnsn_parse_location; - typedef union dmnsn_parse_item { char *value; dmnsn_astnode astnode; |