*** master/spider.web.old	Wed Aug 23 14:08:45 1989
--- master/spider.web	Wed Aug 23 14:03:12 1989
***************
*** 314,322 ****
  
  # If the macro facility worked right, 
  we would use the following patterns to recognize items as they occur:
! #d cat_pattern = #=/[a-z][a-z_]*/#>
! #d trans_pattern = #=/<(([0-9]|[a-z][a-z_]*|"([^"]*\\")*[^"]*"|\*)-)*#>#&
!                       #=([0-9]|[a-z][a-z_]*|"([^"]*\\")*[^"]*"|\*)>/#>
  
  # Here's where we swallow a translation and spit out the \.{WEAVE} code
  to handle that translation.
--- 314,322 ----
  
  # If the macro facility worked right, 
  we would use the following patterns to recognize items as they occur:
! #d cat_pattern = #=/[a-zA-Z][a-zA-Z_]*/#>
! #d trans_pattern = #=/<(([0-9]|[a-zA-Z][a-zA-Z_]*|"([^"]*\\")*[^"]*"|\*)-)*#>#&
!                       #=([0-9]|[a-zA-Z][a-zA-Z_]*|"([^"]*\\")*[^"]*"|\*)>/#>
  
  # Here's where we swallow a translation and spit out the \.{WEAVE} code
  to handle that translation.
***************
*** 341,347 ****
  	if (alternate ~ #=/^[0-9]$/#>) { ## digit
  		temp = sprintf("\tapp_str(\"%s\");\n",alternate)
  		outstring=outstring temp
! 	} else if (alternate ~ #=/^[a-z_]+$/#>) { ## key word
  		translation_keywords[alternate]=1 ## remember
  		temp = sprintf("\t%s(%s);\n",append_keyword,alternate) 
  ##Call |app| or |small_app| depending whether we're reducing or creating scraps
--- 341,347 ----
  	if (alternate ~ #=/^[0-9]$/#>) { ## digit
  		temp = sprintf("\tapp_str(\"%s\");\n",alternate)
  		outstring=outstring temp
! 	} else if (alternate ~ #=/^[a-zA-Z_]+$/#>) { ## key word
  		translation_keywords[alternate]=1 ## remember
  		temp = sprintf("\t%s(%s);\n",append_keyword,alternate) 
  ##Call |app| or |small_app| depending whether we're reducing or creating scraps
***************
*** 394,400 ****
      if (alternate ~ #=/^[0-9]$/#>) { ## digit
          print "Digit not allowed in restricted translation", wherestring
          exitcode = -1
!     } else if (alternate ~ #=/^[a-z_]+$/#>) { ## key word
          print "Key word not allowed in restricted translation", wherestring
          exitcode = -1
      } else if (alternate ~ #=/^\"([^"]*\\\")*[^"]*\"$/#>) { ## string
--- 394,400 ----
      if (alternate ~ #=/^[0-9]$/#>) { ## digit
          print "Digit not allowed in restricted translation", wherestring
          exitcode = -1
!     } else if (alternate ~ #=/^[a-zA-Z_]+$/#>) { ## key word
          print "Key word not allowed in restricted translation", wherestring
          exitcode = -1
      } else if (alternate ~ #=/^\"([^"]*\\\")*[^"]*\"$/#>) { ## string
***************
*** 576,582 ****
  		#<Process newline token description#>
  	} else	if ($2=="pseudo_semi") {
  		#<Process |pseudo_semi| token description#>
! 	} else if ($2 ~ #=/[a-zA-Z0-9]+/#>) { 
  		## we recognize no other names
  		print "Error: unknown token species:", $2
  		#<Punt this command#>
--- 576,582 ----
  		#<Process newline token description#>
  	} else	if ($2=="pseudo_semi") {
  		#<Process |pseudo_semi| token description#>
! 	} else if ($2 ~ #=/[a-zA-ZA-Z0-9]+/#>) { 
  		## we recognize no other names
  		print "Error: unknown token species:", $2
  		#<Punt this command#>
***************
*** 1200,1206 ****
  that an item of ilk |fish_like| will get category |fish|.
  
  #<If no category is specified, invent a default if you can#>=
! 	if ($2 ~ #=/^[a-z_]+_like$/#> && $0 !~ #=/ category /#>) { 
  		## give default category
  		this_category = substr($2,1,length($2)-5)
  		categories[this_category]=1
--- 1200,1206 ----
  that an item of ilk |fish_like| will get category |fish|.
  
  #<If no category is specified, invent a default if you can#>=
! 	if ($2 ~ #=/^[a-zA-Z_]+_like$/#> && $0 !~ #=/ category /#>) { 
  		## give default category
  		this_category = substr($2,1,length($2)-5)
  		categories[this_category]=1
***************
*** 1490,1498 ****
  for (i=1; i<=NF; i++) {
  	if ($i ~ #=/<.*>/#>) { ##  should be |trans_pattern|
  		#<Process a translation in |$i|#>
! 	} else if ($i ~ #=/^!?[a-z_]+(\*\*?)?$/#>) { ## |cat_pattern|
  		#<Process a single category#>
! 	} else if ($i ~ #=/^!?\(([a-z_]+\|)*[a-z_]+\)(\*\*?)?$/#>){
  		#<Process a list of alternative categories#>
  	} else if ($i == "?") {
  		#<Process a category wild card#>
--- 1490,1498 ----
  for (i=1; i<=NF; i++) {
  	if ($i ~ #=/<.*>/#>) { ##  should be |trans_pattern|
  		#<Process a translation in |$i|#>
! 	} else if ($i ~ #=/^!?[a-zA-Z_]+(\*\*?)?$/#>) { ## |cat_pattern|
  		#<Process a single category#>
! 	} else if ($i ~ #=/^!?\(([a-zA-Z_]+\|)*[a-zA-Z_]+\)(\*\*?)?$/#>){
  		#<Process a list of alternative categories#>
  	} else if ($i == "?") {
  		#<Process a category wild card#>
***************
*** 1632,1642 ****
  
  #<Strip stars from |$i| (if any) and add appropriate
  	translations to |trans[pos]|#>=
! if ($i ~ #=/^([a-z_]+|\(([a-z_]+\|)*[a-z_]+\))\*\*$/#>) { ## it's double-starred
  	temp = sprintf("\tmake_underlined(pp+%d);\n",pos-1)
  	trans[pos] = trans[pos] temp
  	$i = substr($i,1,length($i)-2)
! } else if ($i ~ #=/^([a-z_]+|\(([a-z_]+\|)*[a-z_]+\))\*$/#>) { ## it's starred
  	temp = sprintf("\tmake_underlined(pp+%d);\n",pos-1)
  	trans[pos] = trans[pos] temp
  	$i = substr($i,1,length($i)-1)
--- 1632,1642 ----
  
  #<Strip stars from |$i| (if any) and add appropriate
  	translations to |trans[pos]|#>=
! if ($i ~ #=/^([a-zA-Z_]+|\(([a-zA-Z_]+\|)*[a-zA-Z_]+\))\*\*$/#>) { ## it's double-starred
  	temp = sprintf("\tmake_underlined(pp+%d);\n",pos-1)
  	trans[pos] = trans[pos] temp
  	$i = substr($i,1,length($i)-2)
! } else if ($i ~ #=/^([a-zA-Z_]+|\(([a-zA-Z_]+\|)*[a-zA-Z_]+\))\*$/#>) { ## it's starred
  	temp = sprintf("\tmake_underlined(pp+%d);\n",pos-1)
  	trans[pos] = trans[pos] temp
  	$i = substr($i,1,length($i)-1)
***************
*** 1751,1757 ****
  		targetcategory[prodnum]="Unnamed category"
  		temp = sprintf("(pp+%d)->cat", $i-1)
  		unnamed_cat[prodnum]=temp
! 	} else if ($i ~ #=/[a-z][a-z_]*/#>) { ## a category
  		targetcategory[prodnum]=$i
  		categories[$i]=1 ## remember this is a category
  	} else {
--- 1751,1757 ----
  		targetcategory[prodnum]="Unnamed category"
  		temp = sprintf("(pp+%d)->cat", $i-1)
  		unnamed_cat[prodnum]=temp
! 	} else if ($i ~ #=/[a-zA-Z][a-zA-Z_]*/#>) { ## a category
  		targetcategory[prodnum]=$i
  		categories[$i]=1 ## remember this is a category
  	} else {
***************
*** 1827,1833 ****
  temp = field[pos]
  tempa = substr(temp,1,1)
  if (tempa != "!") {	
! 	if (temp ~ #=/^\(([a-z_]+\|)*[a-z_]+\)(\*\*?)?$/#>) {
  		## list of alternatives
  		#<Remove trailing stars from |temp|#>
  		temp = substr(temp,2,length(temp)-2)
--- 1827,1833 ----
  temp = field[pos]
  tempa = substr(temp,1,1)
  if (tempa != "!") {	
! 	if (temp ~ #=/^\(([a-zA-Z_]+\|)*[a-zA-Z_]+\)(\*\*?)?$/#>) {
  		## list of alternatives
  		#<Remove trailing stars from |temp|#>
  		temp = substr(temp,2,length(temp)-2)
***************
*** 1836,1842 ****
  			alternate = tok[j]
  			reduced[alternate]=1
  			}
! 	} else if (temp ~ #=/^[a-z_]+(\*\*?)?$/#>) {
  		#<Remove trailing stars from |temp|#>
  		reduced[temp]=1
  	} else if (temp != "?") {
--- 1836,1842 ----
  			alternate = tok[j]
  			reduced[alternate]=1
  			}
! 	} else if (temp ~ #=/^[a-zA-Z_]+(\*\*?)?$/#>) {
  		#<Remove trailing stars from |temp|#>
  		reduced[temp]=1
  	} else if (temp != "?") {