I realized there is a Tcl interface to librivetparser implemented in
src/parser/parserPkgInit.c.

Well this is unforgivable (am I going to be defrocked of my rank of
project chair??)....I changed the command creation calls in order to
move the commands into the ::rivet namespace but forgot about it
altogether.

Time for writing some documentation about it, so that the memory of it
can fix into my mind.

The code implementing the command ::rivet::parserivetdata
(Parse_RivetData) is nearly the same code I put in Rivet_ParseExecString
except for my version calling also Rivet_ExecuteAndCheck.

On 07/05/2013 01:19 PM, Kirill Shtumf wrote:
> For example, I use templates for email-newsletters.
> 
> At the moment I use for this the parser implementation on Tcl.
> 
> register.html looks like this: <p>Hello <? append output $vars(username)
> ?>!</p> ...
> 
> package require tclrivetparser
> set text_for_parse [read_file [file join $::conf(template) {mail}
> {register.html}]]
> set output ""
> ::tclrivetparser::setoutputcmd {append output }
> set data [::tclrivetparser::parserivetdata $text_for_parse]
> eval $data
> functions-> mail $vars(email) $vars(from) $vars(subj) $output
> 

Unless you need a pure Tcl implementation for the parser the way
tclrivetparser does, it seems ::rivet::parserivetdata might work out a
solution for your problem.

-- 
-- Massimo Manghi

Dipartimento di Neuroscienze
Unità di Biofisica e Fisica Sanitaria
via Volturno 39
43125 Parma

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to