Browse Source

lexical.c, simplify using cp_readchar()

pre-master-46
rlar 12 years ago
parent
commit
8c7ae0d61c
  1. 6
      src/frontend/parser/lexical.c

6
src/frontend/parser/lexical.c

@ -142,13 +142,13 @@ nloop:
for (;;) { for (;;) {
if (string) { if (string) {
c = *string++;
c = cp_readchar(&string, cp_inp_cur);
if (c == '\0') if (c == '\0')
c = '\n'; c = '\n';
if (c == ESCAPE) if (c == ESCAPE)
c = '['; c = '[';
} else { } else {
c = input(cp_inp_cur);
c = cp_readchar(&string, cp_inp_cur);
} }
gotchar: gotchar:
@ -191,7 +191,7 @@ nloop:
wlist = cw = NULL; wlist = cw = NULL;
if (string) if (string)
return NULL; return NULL;
while (((c = input(cp_inp_cur)) != '\n') && (c != EOF))
while (((c = cp_readchar(&string, cp_inp_cur)) != '\n') && (c != EOF))
; ;
goto nloop; goto nloop;
} }

Loading…
Cancel
Save