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


Ignore:
Timestamp:
02/18/05 11:26:45 (19 years ago)
Author:
peichman
Message:

field groups can be directly named as the type in a fieldspec

File:
1 edited

Legend:

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

    r62 r63  
    104104 
    105105field_line: <skip:'[ \t]*'> ( field | comment | blank ) "\n" 
    106 line: <skip:'[ \t]*'> ( title | author | pattern_def | section_head | heading | group_field | unknown_directive | field | comment | blank ) "\n" 
     106line: <skip:'[ \t]*'> ( title | author | pattern_def | section_head | heading | group_field | field_group | unknown_directive | field | comment | blank ) "\n" 
    107107 
    108108title: '!title' /.*/ 
     
    151151group_name: /%[A-Z_]+/ 
    152152 
     153field_group: name label(?) group_type 
     154    {  
     155        #warn "[$thisline] field $item{name} is $item{group_type}\n"; 
     156        push @lines, [ 'group', { name => $item{name}, label => $item{'label(?)'}[0], group => $item{group_type} } ]; 
     157    } 
     158 
     159group_type: ':' var_name 
     160 
    153161field: name field_size(?) growable(?) label(?) hint(?) type(?) default(?) option_list(?) validate(?) 
    154162    { 
     
    160168            type     => $item{'type(?)'}[0], 
    161169            value    => $item{'default(?)'}[0], 
    162             list     => $list_var, 
    163             validate => $item{'validate(?)'}[0], 
     170            list     => $list_var, 
     171            validate => $item{'validate(?)'}[0], 
    164172            required => $required || 0, 
    165173        }; 
     
    187195        $maxlength = undef; 
    188196        @options = (); 
    189          
     197         
    190198        $field; 
    191199    } 
     
    211219hint: '[' /[^\]]+/ ']'    { $item[2] } 
    212220 
    213 # TODO: differentiate between builtins and custom field groups 
    214 type: ':' ( builtin_field | var_name { warn "[Text::FormBuilder] Using field group names directly is not (yet) supported (input line $thisline)\n"; 'text' } ) 
     221type: ':' builtin_field 
    215222 
    216223builtin_field: /textarea|text|password|file|checkbox|radio|select|hidden|static/ 
Note: See TracChangeset for help on using the changeset viewer.