Changeset 22 in text-formbuilder for trunk


Ignore:
Timestamp:
11/15/04 15:47:29 (20 years ago)
Author:
peter
Message:

added single-quoted strings for label and default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Text/FormBuilder/grammar

    r21 r22  
    142142    { $rows = $item[1]; $cols = $item[3] } 
    143143 
    144 #TODO: zero width labels 
    145 label: '|' /[^:\[\{\/\n]*/i { $item[2] } 
     144label: '|' (simple_multiword | quoted_string) { $item[2] } 
    146145 
    147146hint: '[' /[^\]]+/ ']'    { $item[2] } 
     
    149148type: ':' /textarea|text|password|file|checkbox|radio|select|hidden|static/ 
    150149 
    151 default: '=' /[^\@\{\s]+/ 
     150default: '=' (simple_multiword | quoted_string) { $item[2] } 
     151 
     152# for simple multiword values not involving punctuation 
     153simple_multiword: <skip:''> /[\w\t ]+/ { $item[2] } 
     154 
     155# my attempt at a single-quoted, non-interpolating string 
     156# where the backslash can escape literal single quotes 
     157quoted_string: <skip:''> "'" /(\\'|[^'])*/ "'" 
     158    { $item[3] =~ s/\\'/'/g; $item[3] } 
    152159 
    153160option_list: options | list_var 
Note: See TracChangeset for help on using the changeset viewer.