Show
Ignore:
Timestamp:
05/22/08 14:14:40 (7 months ago)
Author:
oren
Message:

Fix bug in naming of production link;
Enhance verifiers to catch this sort of problem.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/spec/verify_terms.pl

    r7 r12  
    2121} 
    2222 
     23my $in_non_term = 0; 
     24 
    2325sub StartTag { 
    2426  my $tag = $_; 
    2527  my $attr = \%_; 
     28 
     29  if ($tag =~ /<nonterminal def="#(.[^("]*)/) { 
     30    $in_non_term = $1; 
     31    $in_non_term =~ s/\+/\\+/g; 
     32    $in_non_term = 0 if $in_non_term eq 'c-reserved'; 
     33  } 
    2634 
    2735  if ($tag =~ /^<sect|^<chapter|^<book>/) { 
     
    6270 
    6371sub Text { 
     72  my $text = $_; 
     73  warn("PRD-REF $text => $in_non_term") if $in_non_term and $text !~ /^.$|^${in_non_term}/; 
    6474  if ($keep_next_text) { 
    65     my $text = $_; 
    6675    $text =~ s/(?:\s|\n)+/ /g; 
    6776    push(@parts_stack, $text); 
     
    7382  my $tag = $_; 
    7483  my $attr = \%_; 
     84  $in_non_term = 0 if ($tag =~ /nonterminal/); 
     85 
    7586  pop(@parts_stack) if ($tag =~ /sect|chapter|book/); 
    7687}