*** 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 **** # } else if ($2=="pseudo_semi") { # ! } else if ($2 ~ #=/[a-zA-Z0-9]+/#>) { ## we recognize no other names print "Error: unknown token species:", $2 # --- 576,582 ---- # } else if ($2=="pseudo_semi") { # ! } else if ($2 ~ #=/[a-zA-ZA-Z0-9]+/#>) { ## we recognize no other names print "Error: unknown token species:", $2 # *************** *** 1200,1206 **** that an item of ilk |fish_like| will get category |fish|. #= ! 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 ($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| # ! } else if ($i ~ #=/^!?[a-z_]+(\*\*?)?$/#>) { ## |cat_pattern| # ! } else if ($i ~ #=/^!?\(([a-z_]+\|)*[a-z_]+\)(\*\*?)?$/#>){ # } else if ($i == "?") { # --- 1490,1498 ---- for (i=1; i<=NF; i++) { if ($i ~ #=/<.*>/#>) { ## should be |trans_pattern| # ! } else if ($i ~ #=/^!?[a-zA-Z_]+(\*\*?)?$/#>) { ## |cat_pattern| # ! } else if ($i ~ #=/^!?\(([a-zA-Z_]+\|)*[a-zA-Z_]+\)(\*\*?)?$/#>){ # } else if ($i == "?") { # *************** *** 1632,1642 **** #= ! 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 ---- #= ! 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 # 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 # temp = substr(temp,2,length(temp)-2) *************** *** 1836,1842 **** alternate = tok[j] reduced[alternate]=1 } ! } else if (temp ~ #=/^[a-z_]+(\*\*?)?$/#>) { # reduced[temp]=1 } else if (temp != "?") { --- 1836,1842 ---- alternate = tok[j] reduced[alternate]=1 } ! } else if (temp ~ #=/^[a-zA-Z_]+(\*\*?)?$/#>) { # reduced[temp]=1 } else if (temp != "?") {