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.
PFLAGS=
CFLAGS=$(PREFLAGS) $(PFLAGS) -O -DNDEBUG
LDFLAGS=-i $(PFLAGS)
LINTOPTS=-hbxac
CDIR=$(EM)/mach/proto/top
CDIR=$(EMHOME)/mach/proto/top
CFILES=$(CDIR)/top.c $(CDIR)/queue.c
OFILES=top.o queue.o
@ -21,13 +22,13 @@ queue.o: $(CDIR)/queue.c
$(CC) -c $(CFLAGS) $(CDIR)/queue.c
install: all
$(EM)/mach/install top
$(EMHOME)/mach/install top
cmp: all
-$(EM)/mach/compare top
-$(EMHOME)/mach/compare top
gen.c: table
$(EM)/lib/topgen table
$(EMHOME)/lib/topgen table
lint: $(CFILES)
lint $(LINTOPTS) $(PREFLAGS) $(CFILES)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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