Changeset 28 in text-formbuilder for trunk/lib/Text/FormBuilder/grammar


Ignore:
Timestamp:
11/17/04 09:07:38 (19 years ago)
Author:
peter
Message:

fixed errors from undefined references
removed old field/heading code from grammar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Text/FormBuilder/grammar

    r25 r28  
    88        %lists, 
    99        %patterns, 
    10         @fields, 
    1110        @group,        # current group 
    1211        %groups,       # stored groups of fields 
    13         @headings, 
    1412        $type, 
    1513        @options, 
     
    2321} 
    2422 
    25 form_spec: (list_def | description_def | group_def | line)(s)  
     23form_spec: (list_def | description_def | group_def | line)(s) 
    2624    { 
    2725        $return = { 
     
    2927            author   => $author, 
    3028            description => $description, 
    31             lists    => \%lists    || {},  
    32             patterns => \%patterns || {},  
    33             headings => \@headings || [], 
    34             fields   => \@fields   || [], 
    35             lines    => \@lines    || [], 
    36             groups   => \%groups   || {}, 
     29            lists    => \%lists, 
     30            patterns => \%patterns, 
     31            lines    => \@lines, 
     32            groups   => \%groups, 
    3733        } 
    3834    } 
     
    7167 
    7268title: '!title' /.*/ 
    73     { warn "[Text::Formbuilder] Title redefined at input text line $thisline\n" if defined $title; 
    74     $title = $item[2] } 
     69    { 
     70        warn "[Text::Formbuilder] Title redefined at input text line $thisline\n" if defined $title; 
     71        $title = $item[2]; 
     72    } 
    7573 
    7674author: '!author' /.*/ 
    77     { $author = $item[2] } 
     75    { 
     76        warn "[Text::Formbuilder] Author redefined at input text line $thisline\n" if defined $author; 
     77        $author = $item[2]; 
     78    } 
    7879 
    7980pattern_def: '!pattern' var_name pattern 
     
    8283pattern: /.*/ 
    8384 
    84 heading: '!head' /.*/ 
    85     { 
    86         warn "[Text::FormBuilder] Header before field " . scalar(@fields) . " redefined at input text line $thisline\n" if defined $headings[@fields]; 
    87         $headings[@fields] = $item[2]; 
    88         push @lines, [ 'head', $item[2] ]; 
    89     } 
     85heading: '!head' /.*/    { push @lines, [ 'head', $item[2] ] } 
    9086 
    9187group_field: '!field' group_name name label(?) 
    92     { #warn "[$thisline] $item{group_name}\n";  
    93     push @lines, [ 'group', { name => $item{name}, label => $item{'label(?)'}[0], group => $item{group_name} } ]; 
     88    {  
     89        push @lines, [ 'group', { name => $item{name}, label => $item{'label(?)'}[0], group => $item{group_name} } ]; 
    9490    } 
    9591 
     
    115111        $$field{size} = $size if defined $size; 
    116112         
    117         #warn "[$thisline] field $item{name}; context $context\n";    
     113        #warn "[$thisline] field $item{name}; context $context\n"; 
    118114        if ($context eq 'group') { 
    119115            push @group, $field; 
    120116        } else { 
    121             push @fields, $field; 
    122117            push @lines, [ 'field', $field ]; 
    123118        } 
    124          
    125         #warn "field $item{name} is required" if $required; 
    126119         
    127120        $type = undef; 
Note: See TracChangeset for help on using the changeset viewer.