Changeset 24 in text-formbuilder for trunk/lib/Text/FormBuilder
- Timestamp:
- 11/16/04 14:00:41 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Text/FormBuilder/grammar
r23 r24 14 14 $type, 15 15 @options, 16 $required, 16 17 $list_var, 17 18 $size, … … 105 106 list => $list_var, 106 107 validate => $item{'validate(?)'}[0], 108 required => $required || 0, 107 109 }; 108 110 … … 121 123 } 122 124 125 #warn "field $item{name} is required" if $required; 126 123 127 $type = undef; 128 $required = 0; 124 129 $list_var = undef; 125 130 $size = undef; … … 164 169 list_var: /@[A-Z_]+/ { $list_var = $item[1] } 165 170 166 option: ( simple_multiword | quoted_string) display_text(?)171 option: (value | simple_multiword | quoted_string) display_text(?) 167 172 { push @options, { $item[1] => $item{'display_text(?)'}[0] } } 168 173 … … 171 176 display_text: '[' /[^\]]+/i ']' { $item[2] } 172 177 173 validate: '//' value 178 validate: '//' (optional_pattern | required_pattern) { $item[2] } 179 180 optional_pattern: /[A-Z_]+/ '?' { $required = 0; $item[1] } 181 182 required_pattern: /[A-Z_]+/ { $required = 1; $item[1] } 174 183 175 184 comment: '#' /.*/
Note: See TracChangeset
for help on using the changeset viewer.