[Petal] Escaped semicolons in meta-templates

Kurt Stephens kstep at pepsdesign.com
Mon Feb 10 10:11:07 GMT 2003


Hi Jean,

I have attached an archive that demonstrates the semicolon delimiter
problem that occurs when filling in petal:attribute commands from
a Petal meta-template.  Pardon me if the test program is a bit long,
but it examines 5 different cases.  The program displays the input 
meta-templates, generated templates, and output for each case.

Case 1) Unescaped semicolons - the generated template is not
filled in correctly, however Petal is parsing as it should.

Case 2) Escaped semicolons - The semicolons are never
unescaped.  The generated template fails.

Case 3) ${SC} variable kluge - this works.

Case 4) Unescape semicolons with the 'unquotemeta:' filter.  This
filter uses a bunch of substitution regexen to expand backslash-escape
sequences.  Implements all perl escape sequences except for named
unicode characters.  See Unquotemeta.pm.

Case 5) Unescape semicolons with the 'qq:' operator.  This operator
calls Petal::Hash::String->process directly with the input args and
unescapes the result using Safe $cpt->reval("qq{$result}").  See QQ.pm.

Anyway, a bunch of ideas.  I don't know whether the escaping
issue should be considered a bug or not, but here are the tests
and workarounds.

Best Regards,

Kurt Stephens
kstep at pepsdesign.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_meta_attributes.tar.gz
Type: application/x-gzip
Size: 3932 bytes
Desc: not available
Url : http://lists.webarch.co.uk/pipermail/petal/attachments/20030210/02cced41/test_meta_attributes.tar.bin


More information about the Petal mailing list