diff --git a/asm-savers.h b/asm-savers.h index c807612..272d738 100644 --- a/asm-savers.h +++ b/asm-savers.h @@ -1,7 +1,7 @@ #if (!defined(NTSYS__S_ASSEMBLER_H___)) #define NTSYS__S_ASSEMBLER_H___ -#define create_ntsys_asm_parser(cache, str, table) ((ntsys_argument_parser_t){(cache), (str), (table)}) +#define create_ntsys_asm_parser(cache, str, fp, table) ((ntsys_argument_parser_t){(cache), (fp), (str), (table)}) #define create_ntsys_asm_save(ss) ((ntsys_asm_save_t){(ss), (ss)}) #define create_ntsys_asm_cache(ss) ((ntsys_asm_cache_t)&(ss)) #define ntsys_asm_arg_new(str, __cache) ((ntsys_get_arg((__cache))) && ((str) = __cache->string)) @@ -128,12 +128,16 @@ char* ntsys_get_arg(ntsys_asm_cache_t save) { typedef struct { ntsys_asm_cache_t cache; + FILE* fp; char* string; char** table; } ntsys_argument_parser_t; int ntsys_run_asm_parser(ntsys_argument_parser_t parser) { - ntsys_asm_arg_new(parser.string, parser.cache); + char* str = parser.string; + while (ntsys_asm_arg_new(str, parser.cache)) { + puts(str); + } return EXIT_SUCCESS; } diff --git a/ntsys b/ntsys index ace9875..abfa6f6 100755 Binary files a/ntsys and b/ntsys differ diff --git a/ntsys-assembler.h b/ntsys-assembler.h index 033568a..6f12f24 100644 --- a/ntsys-assembler.h +++ b/ntsys-assembler.h @@ -12,7 +12,7 @@ char* ntsys_asm_table[] = { int ntsys_asm_from_string(size_t* mempos, char* str, FILE* fp) { ntsys_asm_save_t __save = create_ntsys_asm_save(str); ntsys_asm_cache_t __cache = create_ntsys_asm_cache(__save); - ntsys_argument_parser_t __parser = create_ntsys_asm_parser(__cache, str, ntsys_asm_table); + ntsys_argument_parser_t __parser = create_ntsys_asm_parser(__cache, str, fp, ntsys_asm_table); return ntsys_run_asm_parser(__parser); }