README
1----------------
2NGINX let module
3----------------
4
5Adds support for arithmetic operations to NGINX config.
6
7(c) 2011 Roman Arutyunyan, arut@qip.ru
8
9
10
11Build:
12======
13
14Add this when configuring NGNIX:
15
16./configure --add-module=$PATH_TO_MODULE
17
18
19
20
21Examples:
22=========
23
24# adds variable $value equal to evaluated expression value
25
26let $value ( $uid + 0x12 ) * $offset - 100 ;
27
28let $remainer $number % 100 ;
29
30let $welcome "Hi, " . $user . ", you have " . $num . " data items";
31# echo $welcome ;
32
33let_rand $randval from to;
34
35
36IMPORTANT NOTE:
37
38let-module uses NGINX config parser as lexer.
39That means you should add spaces around each token.
40
41let $value (1+2); # ERROR!
42let $value ( 1 + 2 ); # OK
43
44let $value 1 + (2 * $uid); # ERROR!
45let $value 1 + ( 2 * $uid ); # OK
46
47
48
49Features supported:
50===================
51
52- operations with unsigned integers:
53
54 + - * / %
55
56- string operations:
57
58 . (concatenation)
59
60- hexadecimal numbers
61
62- grouping with parentheses
63
64
65
66Notes:
67======
68
69Use the following command to rebuild parser generator if you need that
70
71bison -d let.y
72