Re: name:variable
Sovande Ulv <[email protected]>
| Newsgroups | gmane.text.clearsilver.general |
|---|---|
| Message-ID | <[email protected]> |
On Nov 27, 2007, at 10:09 PM, Sovande Ulv wrote: > I understand that '-' and '+' may be tricky in variable names, but > this could easily be handled by using the parse->hdf tree as a symbol > table and look up a variable there first. > Enclosed a patch which allows for using variable names with operator tokens such as [?<>=!#-+|&]. The patch use parse->hdf as a symbol table and first try to lookup a variable before parse, in csparse.c:var_parse(). If one have a hdf tree such as this > Request.Header.Host = localhost:8080 > Request.Header.Connection = keep-alive > Request.Header.Accept-Encoding = gzip, deflate > Request.Header.Accept-Language = en-us > Request.Header.Accept = text/xml,application/xml,application/xhtml > +xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 > Request.Header.Cache-Control = max-age=0 The patch will make statements such as <?cs var:Request.Header.Accept- Encoding ?> work as expected and print "gzip, deflate" instead of 0. There are no other expression side effects. The extra statement to lookup a variable in var_parse() may even speed up things in those cases where the var: statement is used with a var:variable which probably are most cases. Hope you will accept this patch Brandon. Best regards
patch
(application/octet-stream, 937 B) - not displayed