Changeset 63 in text-formbuilder for trunk/lib/Text/FormBuilder/grammar
- Timestamp:
- 02/18/05 11:26:45 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Text/FormBuilder/grammar
r62 r63 104 104 105 105 field_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"106 line: <skip:'[ \t]*'> ( title | author | pattern_def | section_head | heading | group_field | field_group | unknown_directive | field | comment | blank ) "\n" 107 107 108 108 title: '!title' /.*/ … … 151 151 group_name: /%[A-Z_]+/ 152 152 153 field_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 159 group_type: ':' var_name 160 153 161 field: name field_size(?) growable(?) label(?) hint(?) type(?) default(?) option_list(?) validate(?) 154 162 { … … 160 168 type => $item{'type(?)'}[0], 161 169 value => $item{'default(?)'}[0], 162 163 170 list => $list_var, 171 validate => $item{'validate(?)'}[0], 164 172 required => $required || 0, 165 173 }; … … 187 195 $maxlength = undef; 188 196 @options = (); 189 197 190 198 $field; 191 199 } … … 211 219 hint: '[' /[^\]]+/ ']' { $item[2] } 212 220 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' } ) 221 type: ':' builtin_field 215 222 216 223 builtin_field: /textarea|text|password|file|checkbox|radio|select|hidden|static/
Note: See TracChangeset
for help on using the changeset viewer.