eolian: store unit inside lexer

This commit is contained in:
Daniel Kolesa 2017-12-14 16:38:35 +01:00
parent 011bbfdc93
commit f9868b541e
2 changed files with 3 additions and 0 deletions

View File

@ -1046,6 +1046,7 @@ eo_lexer_set_input(Eo_Lexer *ls, Eolian *state, const char *source)
next_char(ls);
Eolian_Unit *ncunit = calloc(1, sizeof(Eolian_Unit));
ls->unit = ncunit;
database_unit_init(state, ncunit, ls->filename);
eina_hash_add(state->units, ls->filename, ncunit);
}

View File

@ -168,6 +168,8 @@ typedef struct _Eo_Lexer
const char *stream_line;
/* a pointer to the state this lexer belongs to */
Eolian *state;
/* the unit being filled during current parsing */
Eolian_Unit *unit;
/* this is jumped to when an error happens */
jmp_buf err_jmp;