comparison src/pass1.c @ 35:39d750ee8d34

Added error display and fixed infinite loop in lwasm_parse_line()
author lost
date Fri, 02 Jan 2009 06:07:10 +0000
parents c0ff62e5ad39
children 538e15927776
comparison
equal deleted inserted replaced
34:b29eec6f3819 35:39d750ee8d34
57 #include <stdio.h> 57 #include <stdio.h>
58 #include <stdlib.h> 58 #include <stdlib.h>
59 59
60 #include "lwasm.h" 60 #include "lwasm.h"
61 #include "util.h" 61 #include "util.h"
62
63
64 extern int lwasm_parse_line(asmstate_t *as, lwasm_line_t *l);
62 65
63 // we can't use standard line inputting functions here because we have to 66 // we can't use standard line inputting functions here because we have to
64 // handle non-standard line terminations (CR, LF, CRLF, or LFCR) 67 // handle non-standard line terminations (CR, LF, CRLF, or LFCR)
65 int lwasm_read_file(asmstate_t *as, const char *filename) 68 int lwasm_read_file(asmstate_t *as, const char *filename)
66 { 69 {
136 as -> linestail -> next = nl; 139 as -> linestail -> next = nl;
137 else 140 else
138 as -> linestail = nl; 141 as -> linestail = nl;
139 if (!(as -> lineshead)) 142 if (!(as -> lineshead))
140 as -> lineshead = nl; 143 as -> lineshead = nl;
144 lwasm_parse_line(as, nl);
141 } 145 }
142 if (c == EOF) 146 if (c == EOF)
143 break; 147 break;
144 } 148 }
145 149