*** master/spider.web.old	Mon Jul  3 12:46:05 1989
--- master/spider.web	Thu Jul 20 19:00:04 1989
***************
*** 1532,1537 ****
--- 1532,1541 ----
  each scrap is true, the whole production will fire.
  If we're called upon to make a scrap underlined or reserved, we'll add
  to |trans[pos]|.
+ 
+ If a category is negated we add an extra clause to make
+ sure nothing matches the zero category, since {\tt WEAVE} assumes
+ no production ever matches a scrap with category zero.
  #<Process a single category#>=
  	field[pos]=$i ## save this field to compare RHS
  	#<Set |negation|, and remove leading |"!"| from |$i| if necessary#>
***************
*** 1540,1548 ****
  	cat = $i
  	categories[cat]=1 ## remember |cat| is a category
  	if (negation==0) {
! 		test[pos]=sprintf("(pp+%d)->cat==SP_%s",pos-1,cat)
  	} else {
! 		test[pos]=sprintf("(pp+%d)->cat!=SP_%s",pos-1,cat)
  	}
  	#<Update the record of the rightmost occurrence of category |cat|#>
  	#<Advance |pos|, making the new |trans[pos]| empty#>
--- 1544,1553 ----
  	cat = $i
  	categories[cat]=1 ## remember |cat| is a category
  	if (negation==0) {
! 	    test[pos]=sprintf("(pp+%d)->cat==SP_%s",pos-1,cat)
  	} else {
! 	    test[pos]=sprintf("((pp+%d)->cat!=SP_%s && (pp+%d)->cat != 0)",\
! 			pos-1,cat,pos-1)
  	}
  	#<Update the record of the rightmost occurrence of category |cat|#>
  	#<Advance |pos|, making the new |trans[pos]| empty#>
***************
*** 1551,1556 ****
--- 1556,1565 ----
  categories are separated by vertical bars.
  We have to make the test for these things a disjunction, but
  processing is more or less like the processing for a single category.
+ 
+ If a list of alternatives is negated we add an extra clause to make
+ sure nothing matches the zero category, since {\tt WEAVE} assumes
+ no production ever matches a scrap with category zero.
  #<Process a list of alternative categories#>=
  	field[pos]=$i ## save this field to compare RHS
  	#<Set |negation|, and remove leading |"!"| from |$i| if necessary#>
***************
*** 1557,1563 ****
  	if (negation==0) {
  		test[pos]="(" ## open for a list of good alternatives
  	} else {
! 		test[pos]="!(" ## open for a list of bad alternatives
  	}
  	#<Strip stars from |$i| (if any) and add appropriate
  		translations to |trans[pos]|#>
--- 1566,1573 ----
  	if (negation==0) {
  		test[pos]="(" ## open for a list of good alternatives
  	} else {
! 		temp=sprintf("(pp+%d)->cat==0",pos-1)
! 		test[pos]="!(" temp "||" ## open for a list of bad alternatives
  	}
  	#<Strip stars from |$i| (if any) and add appropriate
  		translations to |trans[pos]|#>
***************
*** 1635,1644 ****
  	#<Forget this production#>
  }
  
! # Wild cards are easy to process
  #<Process a category wild card#>=
  	field[pos]=$i ## save this field to compare RHS
! 	test[pos]="(1)" ## anything matches
  	highwildcard=pos ## we don't really need this?
  	#<Advance |pos|, making the new |trans[pos]| empty#>
  
--- 1645,1655 ----
  	#<Forget this production#>
  }
  
! # Wild cards are easy to process, but we do have to remember that
! not even a wild card matches a scrap of category zero.
  #<Process a category wild card#>=
  	field[pos]=$i ## save this field to compare RHS
!         test[pos]=sprintf("(pp+%d)->cat!=0",pos-1) ## anything nonzero matches
  	highwildcard=pos ## we don't really need this?
  	#<Advance |pos|, making the new |trans[pos]| empty#>