79 lines
1.2 KiB
Plaintext
79 lines
1.2 KiB
Plaintext
|
head 1.2;
|
||
|
access;
|
||
|
symbols;
|
||
|
locks; strict;
|
||
|
comment @# @;
|
||
|
|
||
|
|
||
|
1.2
|
||
|
date 2007.01.16.04.12.02; author TWikiContributor; state Exp;
|
||
|
branches;
|
||
|
next 1.1;
|
||
|
|
||
|
1.1
|
||
|
date 2006.02.01.12.01.25; author TWikiContributor; state Exp;
|
||
|
branches;
|
||
|
next ;
|
||
|
|
||
|
|
||
|
desc
|
||
|
@new-topic
|
||
|
@
|
||
|
|
||
|
|
||
|
1.2
|
||
|
log
|
||
|
@buildrelease
|
||
|
@
|
||
|
text
|
||
|
@---+ Package =TWiki::If=
|
||
|
|
||
|
Support for the conditions in %IF{} statements. Basically a simple
|
||
|
stack-based parser for infix expressions that generates a parse
|
||
|
tree that can subsequently be evaluated.
|
||
|
|
||
|
|
||
|
%TOC%
|
||
|
|
||
|
---++ ClassMethod *new* <tt>(\%operators) -> \%factory</tt>
|
||
|
|
||
|
Construct a new if node factory.
|
||
|
|
||
|
* =\%operators= reference to a hash of operators.
|
||
|
|
||
|
Each operator must have the following fields: prec (precedence) type (0 unary 1 binary) exec (ref to a function to execute). If not provided, the default set of boolean operations supported by %IF is used.
|
||
|
|
||
|
|
||
|
|
||
|
---++ ObjectMethod *evaluate* <tt>($twiki) -> $result</tt>
|
||
|
|
||
|
Execute the parse node.
|
||
|
|
||
|
|
||
|
|
||
|
!!!new!!!
|
||
|
|
||
|
---++ ObjectMethod *parse* <tt>($string) -> \$if</tt>
|
||
|
|
||
|
* =$string= - string containing an expression to parse
|
||
|
|
||
|
Construct a new search node by parsing the passed expression. Return
|
||
|
the new object.
|
||
|
|
||
|
|
||
|
@
|
||
|
|
||
|
|
||
|
1.1
|
||
|
log
|
||
|
@buildrelease
|
||
|
@
|
||
|
text
|
||
|
@d11 1
|
||
|
d13 1
|
||
|
d15 1
|
||
|
d21 1
|
||
|
d29 1
|
||
|
d31 1
|
||
|
@
|