Changeset 57 in text-formbuilder for trunk


Ignore:
Timestamp:
01/18/05 15:19:14 (19 years ago)
Author:
peichman
Message:

BUGFIX: can have "unbalanced" quotes in note or description blocks (wrote own grammar rule instead of using the built-in <perl_codeblock> directive)

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Changes

    r56 r57  
    330.09 
    44    * single-line textfields can be given a maxlength 
     5    * BUGFIX: !note and !description blocks can now 
     6      contain "unbalanced" quotes (fixed the gramamr) 
    57     
    680.08 - 10 Jan 2005 
  • trunk/lib/Text/FormBuilder.pm

    r56 r57  
    982982=back 
    983983 
    984 B<Known BUG:> If you include an odd number of C<'> or C<"> characters in a 
    985 C<!description> or C<!note>, then that directive will mistakenly be skipped. 
    986 This is a bug casued by me taking a shortcut in the parser C<:-/> 
    987  
    988984=head2 Fields 
    989985 
     
    11621158=head1 TODO 
    11631159 
    1164 Improve the commmand line tools 
     1160Document the commmand line tool 
    11651161 
    11661162Allow renaming of the submit button; allow renaming and inclusion of a  
     
    11931189=head1 BUGS 
    11941190 
    1195 Having a single C<'> or C<"> in a C<!description> or C<!note> directive causes that 
    1196 directive to get skipped. This is an issue with the C<perl_codeblock> shortcut in 
    1197 Parse::RecDescent. 
    1198  
    11991191Creating two $parsers in the same script causes the second one to get the data 
    12001192from the first one. 
  • trunk/lib/Text/FormBuilder/grammar

    r56 r57  
    6868    } 
    6969 
    70 description_def: '!description' <perl_codeblock> 
     70description_def: '!description' block 
    7171    { warn "[Text::FormBuilder] Description redefined at input text line $thisline\n" if defined $description; 
    7272     
     
    8585    } 
    8686 
    87 note: '!note' <perl_codeblock> 
     87note: '!note' block 
    8888    {    
    8989        (my $note = $item[2]) =~ s/^{\s*|\s*}$//g; 
     
    9191    } 
    9292 
     93# curly-brace delimited block, that can contain properly 
     94# nested curly brackets, along with any other characters 
     95# return with the '{...}' so that nested blocks get the 
     96# brackets treated as literals 
     97block: '{' <skip:''> block_content(s) '}' 
     98    { 
     99        '{' . join('', @{ $item[3] }) . '}'; 
     100    } 
     101 
     102block_content: /[^\{\}]+?/ | block 
     103 
    93104 
    94105field_line: <skip:'[ \t]*'> ( field | comment | blank ) "\n" 
     
    97108title: '!title' /.*/ 
    98109    { 
    99         warn "[Text::Formbuilder] Title redefined at input text line $thisline\n" if defined $title; 
     110        warn "[Text::FormBuilder] Title redefined at input text line $thisline\n" if defined $title; 
    100111        $title = $item[2]; 
    101112    } 
     
    103114author: '!author' /.*/ 
    104115    { 
    105         warn "[Text::Formbuilder] Author redefined at input text line $thisline\n" if defined $author; 
     116        warn "[Text::FormBuilder] Author redefined at input text line $thisline\n" if defined $author; 
    106117        $author = $item[2]; 
    107118    } 
Note: See TracChangeset for help on using the changeset viewer.