fixed for operand separators within operands

This commit is contained in:
ceriel 1988-03-14 15:58:07 +00:00
parent e8f4ce0886
commit ea9e90d785
7 changed files with 47 additions and 32 deletions

View file

@ -1,10 +1,11 @@
EM=../../.. EMHOME=../../..
LIBS=$(EMHOME)/modules/lib/libstring.a
PREFLAGS=-I. PREFLAGS=-I.
PFLAGS= PFLAGS=
CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG
LDFLAGS=-i $(PFLAGS) LDFLAGS=-i $(PFLAGS)
LINTOPTS=-hbxac LINTOPTS=-hbxac
CDIR=$(EM)/mach/proto/top CDIR=$(EMHOME)/mach/proto/top
CFILES=$(CDIR)/top.c $(CDIR)/queue.c CFILES=$(CDIR)/top.c $(CDIR)/queue.c
OFILES=top.o queue.o OFILES=top.o queue.o
@ -21,13 +22,13 @@ queue.o: $(CDIR)/queue.c
$(CC) -c $(CFLAGS) $(CDIR)/queue.c $(CC) -c $(CFLAGS) $(CDIR)/queue.c
install: all install: all
$(EM)/mach/install top $(EMHOME)/mach/install top
cmp: all cmp: all
-$(EM)/mach/compare top -$(EMHOME)/mach/compare top
gen.c: table gen.c: table
$(EM)/lib/topgen table $(EMHOME)/lib/topgen table
lint: $(CFILES) lint: $(CFILES)
lint $(LINTOPTS) $(PREFLAGS) $(CFILES) lint $(LINTOPTS) $(PREFLAGS) $(CFILES)

View file

@ -1,10 +1,11 @@
EM=../../.. EMHOME=../../..
LIBS=$(EMHOME)/modules/lib/libstring.a
PREFLAGS=-I. PREFLAGS=-I.
PFLAGS= PFLAGS=
CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG
LDFLAGS=-i $(PFLAGS) LDFLAGS=-i $(PFLAGS)
LINTOPTS=-hbxac LINTOPTS=-hbxac
CDIR=$(EM)/mach/proto/top CDIR=$(EMHOME)/mach/proto/top
CFILES=$(CDIR)/top.c $(CDIR)/queue.c CFILES=$(CDIR)/top.c $(CDIR)/queue.c
OFILES=top.o queue.o OFILES=top.o queue.o
@ -21,13 +22,13 @@ queue.o: $(CDIR)/queue.c
$(CC) -c $(CFLAGS) $(CDIR)/queue.c $(CC) -c $(CFLAGS) $(CDIR)/queue.c
install: all install: all
$(EM)/mach/install top $(EMHOME)/mach/install top
cmp: all cmp: all
-$(EM)/mach/compare top -$(EMHOME)/mach/compare top
gen.c: table gen.c: table
$(EM)/lib/topgen table $(EMHOME)/lib/topgen table
lint: $(CFILES) lint: $(CFILES)
lint $(LINTOPTS) $(PREFLAGS) $(CFILES) lint $(LINTOPTS) $(PREFLAGS) $(CFILES)

View file

@ -1,10 +1,11 @@
EM=../../.. EMHOME=../../..
LIBS=$(EMHOME)/modules/lib/libstring.a
PREFLAGS=-I. PREFLAGS=-I.
PFLAGS= PFLAGS=
CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG
LDFLAGS=-i $(PFLAGS) LDFLAGS=-i $(PFLAGS)
LINTOPTS=-hbxac LINTOPTS=-hbxac
CDIR=$(EM)/mach/proto/top CDIR=$(EMHOME)/mach/proto/top
CFILES=$(CDIR)/top.c $(CDIR)/queue.c CFILES=$(CDIR)/top.c $(CDIR)/queue.c
OFILES=top.o queue.o OFILES=top.o queue.o
@ -21,13 +22,13 @@ queue.o: $(CDIR)/queue.c
$(CC) -c $(CFLAGS) $(CDIR)/queue.c $(CC) -c $(CFLAGS) $(CDIR)/queue.c
install: all install: all
$(EM)/mach/install top $(EMHOME)/mach/install top
cmp: all cmp: all
-$(EM)/mach/compare top -$(EMHOME)/mach/compare top
gen.c: table gen.c: table
$(EM)/lib/topgen table $(EMHOME)/lib/topgen table
lint: $(CFILES) lint: $(CFILES)
lint $(LINTOPTS) $(PREFLAGS) $(CFILES) lint $(LINTOPTS) $(PREFLAGS) $(CFILES)

View file

@ -1,10 +1,11 @@
EM=../../.. EMHOME=../../..
LIBS=$(EMHOME)/modules/lib/libstring.a
PREFLAGS=-I. PREFLAGS=-I.
PFLAGS= PFLAGS=
CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG
LDFLAGS=-i $(PFLAGS) LDFLAGS=-i $(PFLAGS)
LINTOPTS=-hbxac LINTOPTS=-hbxac
CDIR=$(EM)/mach/proto/top CDIR=$(EMHOME)/mach/proto/top
CFILES=$(CDIR)/top.c $(CDIR)/queue.c CFILES=$(CDIR)/top.c $(CDIR)/queue.c
OFILES=top.o queue.o OFILES=top.o queue.o
@ -21,13 +22,13 @@ queue.o: $(CDIR)/queue.c
$(CC) -c $(CFLAGS) $(CDIR)/queue.c $(CC) -c $(CFLAGS) $(CDIR)/queue.c
install: all install: all
$(EM)/mach/install top $(EMHOME)/mach/install top
cmp: all cmp: all
-$(EM)/mach/compare top -$(EMHOME)/mach/compare top
gen.c: table gen.c: table
$(EM)/lib/topgen table $(EMHOME)/lib/topgen table
lint: $(CFILES) lint: $(CFILES)
lint $(LINTOPTS) $(PREFLAGS) $(CFILES) lint $(LINTOPTS) $(PREFLAGS) $(CFILES)

View file

@ -1,10 +1,11 @@
EM=../../.. EMHOME=../../..
LIBS=$(EMHOME)/modules/lib/libstring.a
PREFLAGS=-I. PREFLAGS=-I.
PFLAGS= PFLAGS=
CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG
LDFLAGS=-i $(PFLAGS) LDFLAGS=-i $(PFLAGS)
LINTOPTS=-hbxac LINTOPTS=-hbxac
CDIR=$(EM)/mach/proto/top CDIR=$(EMHOME)/mach/proto/top
CFILES=$(CDIR)/top.c $(CDIR)/queue.c CFILES=$(CDIR)/top.c $(CDIR)/queue.c
OFILES=top.o queue.o OFILES=top.o queue.o
@ -21,13 +22,13 @@ queue.o: $(CDIR)/queue.c
$(CC) -c $(CFLAGS) $(CDIR)/queue.c $(CC) -c $(CFLAGS) $(CDIR)/queue.c
install: all install: all
$(EM)/mach/install top $(EMHOME)/mach/install top
cmp: all cmp: all
-$(EM)/mach/compare top -$(EMHOME)/mach/compare top
gen.c: table gen.c: table
$(EM)/lib/topgen table $(EMHOME)/lib/topgen table
lint: $(CFILES) lint: $(CFILES)
lint $(LINTOPTS) $(PREFLAGS) $(CFILES) lint $(LINTOPTS) $(PREFLAGS) $(CFILES)

View file

@ -342,13 +342,19 @@ bool operand(ip,n)
{ {
register char *p; register char *p;
int oplen; int oplen;
#ifdef PAREN_OPEN
int nesting = 0; int nesting = 0;
#else
#define nesting 0
#endif
skip_white(ip); skip_white(ip);
p = ip->rest_line; p = ip->rest_line;
while((*p != OP_SEPARATOR || nesting) && *p != '\n') { while((*p != OP_SEPARATOR || nesting) && *p != '\n') {
if (*p == '(') nesting++; #ifdef PAREN_OPEN
else if (*p == ')') nesting--; if (strindex(PAREN_OPEN, *p) != 0) nesting++;
else if (strindex(PAREN_CLOSE, *p) != 0) nesting--;
#endif
p++; p++;
} }
oplen = p - ip->rest_line; oplen = p - ip->rest_line;
@ -357,6 +363,9 @@ bool operand(ip,n)
ip->op[n][oplen] = '\0'; ip->op[n][oplen] = '\0';
ip->rest_line = p; ip->rest_line = p;
return TRUE; return TRUE;
#ifdef nesting
#undef nesting
#endif
} }

View file

@ -1,10 +1,11 @@
EM=../../.. EMHOME=../../..
LIBS=$(EMHOME)/modules/lib/libstring.a
PREFLAGS=-I. PREFLAGS=-I.
PFLAGS= PFLAGS=
CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG
LDFLAGS=-i $(PFLAGS) LDFLAGS=-i $(PFLAGS)
LINTOPTS=-hbxac LINTOPTS=-hbxac
CDIR=$(EM)/mach/proto/top CDIR=$(EMHOME)/mach/proto/top
CFILES=$(CDIR)/top.c $(CDIR)/queue.c CFILES=$(CDIR)/top.c $(CDIR)/queue.c
OFILES=top.o queue.o OFILES=top.o queue.o
@ -21,13 +22,13 @@ queue.o: $(CDIR)/queue.c
$(CC) -c $(CFLAGS) $(CDIR)/queue.c $(CC) -c $(CFLAGS) $(CDIR)/queue.c
install: all install: all
$(EM)/mach/install top $(EMHOME)/mach/install top
cmp: all cmp: all
-$(EM)/mach/compare top -$(EMHOME)/mach/compare top
gen.c: table gen.c: table
$(EM)/lib/topgen table $(EMHOME)/lib/topgen table
lint: $(CFILES) lint: $(CFILES)
lint $(LINTOPTS) $(PREFLAGS) $(CFILES) lint $(LINTOPTS) $(PREFLAGS) $(CFILES)