Changeset 12 for trunk/spec

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.

Location:
trunk/spec
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/spec/spec.dbk

    r8 r12  
    96659665                <nonterminal 
    96669666                  def="#c-mapping-value"><quote>:</quote></nonterminal> 
    9667                 ( <nonterminal def="#s-l+block-indented(n,c)" 
     9667                ( <nonterminal def="#s-l+block-node(n,c)" 
    96689668                  >s-l+block-node(n,block-out)</nonterminal><sbr/> 
    96699669                &nbsp;&nbsp;&nbsp;&nbsp;| <nonterminal def="#e-node"/> 
     
    1018610186            <rhs> 
    1018710187              <nonterminal def="#s-l+block-node(n,c)" 
    10188                 >ns-l+block-node(-1,block-in)</nonterminal><sbr/> 
     10188                >s-l+block-node(-1,block-in)</nonterminal><sbr/> 
    1018910189              /* Excluding <nonterminal def="#c-forbidden"/> content */ 
    1019010190            </rhs> 
  • 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}