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


Ignore:
Timestamp:
06/29/05 16:46:56 (19 years ago)
Author:
peichman
Message:

BUGFIX: stopped crosstalk of data from one object to another (references were getting shared in the parser grammar code)

File:
1 edited

Legend:

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

    r87 r88  
    3737 
    3838form_spec: 
    39     {  
    40         %formspec = ();  # clear the old formspec data 
     39    { 
     40        # clear out old data, so we don't end up with old data in new objects 
     41        @lines    = (); 
     42        @sections = (); 
     43        %formspec = (); 
    4144    } 
    4245    (list_def | description_def | group_def | note | fb_params | unknown_block_directive | line)(s) 
     
    5255        } 
    5356         
     57        # make copies instead of taking references, again so we 
     58        # don't end up with connections between objects 
    5459        $return = { 
    5560            fb_params   => $formspec{fb_params}, 
     
    5762            author      => $formspec{author}, 
    5863            description => $formspec{description}, 
    59             lists       => \%lists, 
    60             patterns    => \%patterns, 
    61             subs        => \%subs, 
    62             groups      => \%groups, 
    63             sections    => \@sections, 
    64             ( @submit ?  
    65                 (submit => @submit == 1 ? $submit[0] : \@submit) : 
    66                 () 
    67             ), 
     64            lists       => { %lists }, 
     65            patterns    => { %patterns }, 
     66            subs        => { %subs }, 
     67            groups      => { %groups }, 
     68            sections    => [ @sections ], 
     69            ( @submit ? (submit => @submit == 1 ? $submit[0] : [ @submit ]) : () ), 
    6870            reset       => $formspec{reset}, 
    6971        } 
     
    233235        @options = (); 
    234236         
     237        #warn "$$field{name}: $field"; 
     238         
    235239        $field; 
    236240    } 
Note: See TracChangeset for help on using the changeset viewer.