Index: trunk/lib/Text/FormBuilder/grammar
===================================================================
--- trunk/lib/Text/FormBuilder/grammar	(revision 62)
+++ trunk/lib/Text/FormBuilder/grammar	(revision 63)
@@ -104,5 +104,5 @@
 
 field_line: <skip:'[ \t]*'> ( field | comment | blank ) "\n"
-line: <skip:'[ \t]*'> ( title | author | pattern_def | section_head | heading | group_field | unknown_directive | field | comment | blank ) "\n"
+line: <skip:'[ \t]*'> ( title | author | pattern_def | section_head | heading | group_field | field_group | unknown_directive | field | comment | blank ) "\n"
 
 title: '!title' /.*/
@@ -151,4 +151,12 @@
 group_name: /%[A-Z_]+/
 
+field_group: name label(?) group_type
+    { 
+	#warn "[$thisline] field $item{name} is $item{group_type}\n";
+	push @lines, [ 'group', { name => $item{name}, label => $item{'label(?)'}[0], group => $item{group_type} } ];
+    }
+
+group_type: ':' var_name
+
 field: name field_size(?) growable(?) label(?) hint(?) type(?) default(?) option_list(?) validate(?)
     {
@@ -160,6 +168,6 @@
 	    type     => $item{'type(?)'}[0],
 	    value    => $item{'default(?)'}[0],
-            list     => $list_var,
-            validate => $item{'validate(?)'}[0],
+	    list     => $list_var,
+	    validate => $item{'validate(?)'}[0],
 	    required => $required || 0,
 	};
@@ -187,5 +195,5 @@
 	$maxlength = undef;
 	@options = ();
-        
+	
 	$field;
     }
@@ -211,6 +219,5 @@
 hint: '[' /[^\]]+/ ']'    { $item[2] }
 
-# TODO: differentiate between builtins and custom field groups
-type: ':' ( builtin_field | var_name { warn "[Text::FormBuilder] Using field group names directly is not (yet) supported (input line $thisline)\n"; 'text' } )
+type: ':' builtin_field
 
 builtin_field: /textarea|text|password|file|checkbox|radio|select|hidden|static/
