Changeset 14 in text-formbuilder for trunk/lib/Text/FormBuilder


Ignore:
Timestamp:
10/22/04 16:37:16 (20 years ago)
Author:
peter
Message:

added a !description directive
enabled showing checkboxes/radio groups as ulists when there are 3 or more options

File:
1 edited

Legend:

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

    r11 r14  
    1 { my ($title, $author, %lists, %patterns, @fields, @headings, $type, @options, $list_var, $size, $rows, $cols); } 
     1{ my ($title, $author, $description, %lists, %patterns, @fields, @headings, $type, @options, $list_var, $size, $rows, $cols); } 
    22 
    3 form_spec: (list_def | line)(s)  
     3form_spec: (list_def | description_def | line)(s)  
    44    { 
    55        $return = { 
    66            title    => $title, 
    77            author   => $author, 
     8            description => $description, 
    89            lists    => \%lists,  
    910            patterns => \%patterns,  
     
    2930 
    3031list_name: /[A-Z_]+/ 
     32 
     33description_def: '!description' <perl_codeblock> 
     34    { warn "[Text::FormBuilder] Description redefined at input text line $thisline\n" if defined $description; 
     35     
     36    $description = $item[2]; 
     37    $description =~ s/^{\s*|\s*}$//g; 
     38    } 
    3139 
    3240line: <skip:'[ \t]*'> ( title | author | pattern_def | heading | field | comment | blank ) "\n" 
Note: See TracChangeset for help on using the changeset viewer.