Changeset 80 in text-formbuilder for trunk/lib/Text/FormBuilder/grammar
- Timestamp:
- 04/12/05 11:23:36 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Text/FormBuilder/grammar
r77 r80 24 24 $rows, 25 25 $cols, 26 @submit, 26 27 ); 27 28 my $context = 'line'; # start in line context by default … … 38 39 %formspec = (); # clear the old formspec data 39 40 } 40 (list_def | description_def | group_def | note | line)(s)41 (list_def | description_def | group_def | note | unknown_block_directive | line)(s) 41 42 { 42 43 # grab the last section, if there is any … … 59 60 groups => \%groups, 60 61 sections => \@sections, 62 ( @submit ? 63 (submit => @submit == 1 ? $submit[0] : \@submit) : 64 () 65 ), 61 66 } 62 67 } … … 106 111 field_line: <skip:'[ \t]*'> ( field | comment | blank ) "\n" 107 112 108 line: <skip:'[ \t]*'> ( title | author | pattern_def | section_head | heading | group_field | field_group | unknown_directive | field | comment | blank ) "\n"113 line: <skip:'[ \t]*'> ( title | author | pattern_def | section_head | heading | submit | group_field | field_group | unknown_directive | field | comment | blank ) /\n+/ 109 114 110 115 title: '!title' /.*/ … … 145 150 146 151 heading: '!head' /.*/ { push @lines, [ 'head', $item[2] ] } 152 153 submit: '!submit' string(s /\s*,\s*/) 154 { 155 #warn scalar(@{ $item[2] }) . ' submit button(s)'; 156 push @submit, @{ $item[2] }; 157 } 147 158 148 159 group_field: '!field' group_name name label(?) … … 243 254 244 255 # for simple multiword values not involving punctuation 245 simple_multiword: <skip:''> /\w[\w\t ]*/ { $item[2] }256 simple_multiword: /\w/ <skip:''> /[\w\t ]*/ { $item[1] . $item[3] } 246 257 247 258 # my attempt at a single-quoted, non-interpolating string 248 259 # where the backslash can escape literal single quotes 249 quoted_string: <skip:''> "'"/(\\'|[^'])*/ "'"260 quoted_string: "'" <skip:''> /(\\'|[^'])*/ "'" 250 261 { $item[3] =~ s/\\'/'/g; $item[3] } 251 262 … … 278 289 unknown_directive: /\!\S*/ /.*/ 279 290 { warn "[Text::Formbuilder] Skipping unknown directive '$item[1]' at input text line $thisline\n"; } 291 292 unknown_block_directive: /\!\S*/ var_name(?) block 293 { warn "[Text::Formbuilder] Skipping unknown block directive '$item[1]' at input text line $thisline\n"; }
Note: See TracChangeset
for help on using the changeset viewer.