Annotation of parser3/src/www/htdocs/index.html, revision 1.209
1.200 parser 1: @main[]
1.208 parser 2: ^switch(2){
3: ^case(1;4;3){143}
4: ^case[DEFAULT]{default}
5: }
1.209 ! parser 6: <hr>
! 7: ^switch(2){
! 8: ^case(1;2;3){143}
! 9: ^case[DEFAULT]{default}
! 10: }
! 11: <hr>
! 12: ^switch(2){
! 13: ^case(1;5;3){143}
! 14: }
! 15:
! 16: <hr>
! 17: ^switch(2){
! 18: ^case(2){2}
! 19: }
1.208 parser 20:
21: <hr>
22:
23:
1.207 parser 24: $hash[$a[1]]
25: ^hash.default[0]
1.206 parser 26: ^rem{
27: $target[targetval]
28: $form_admin[formadminval]
29: ^if(def $target){<head><base target=$target^if(def $form_admin){_a}></head>}
30: ^if(def $target){<head><base target=${target}^if(def $form_admin){_a}></head>}
31:
32: если $target и $form_admin defined получаем
33: <head><base target={_a}></head>
34: <hr>
35: }
36:
1.205 parser 37: #$string:a(1)
38: #<hr>
39: #^if(^log(11)){y}{n}
40: #<hr>
1.204 parser 41:
1.205 parser 42: #@my_func[arg;z]
43: #2
1.204 parser 44:
1.205 parser 45: #@z[]
46: #^exp(^log(10))
47: #<hr>
1.203 parser 48: #$a[^table:load[a<b]]
1.201 parser 49: ^rem{
50: ^mail:send[
51: $from[paf@design.ru]
52: $to[paf@design.ru]
53: $subject[test]
54: $body[here]
55: ]
56: <hr>
57: }
1.200 parser 58: -^eol[]-
59: <hr>
60: ^if(1<2){$a[1]}
61: ^$a=$a
62: <hr>
1.197 parser 63:
1.200 parser 64: <form method=post>
65: <input type=hidden name=a value=123>
66: <table border=1 width=250><tr><td>$form:name</td></tr></table>
67: <textarea name=name rows=5 cols=40>^untaint[html]{^default[$form:name;Пробный текст: А.Ф._Петросян <<Жизнь в Аду>>
68: нажми Submit]}</textarea><BR>
69: <input type=submit>
70: </form>
71: <hr>
1.190 parser 72:
1.200 parser 73: #^main[]
74: #^use[$form:file]
1.184 parser 75:
1.200 parser 76: $строка[вася ЗдЕсЬ]
77: ^^строка.upper[]=^строка.upper[]<br>
78: ^^строка.lower[]=^строка.lower[]<br>
79: <hr>
80:
81:
82: $a[12]
83: ^a.int[]
1.206 parser 84:
1.200 parser 85: <hr>
86:
87:
88: $t[^table:set{key value
89: 1 v1
90: 2 v2}]
91: $h[^t.hash[key]]
92:
93: ^sql_test[$SQL.connect-string]
94: #^sql_test[mysql://test:test@localhost/test/cp1251_koi8]
95:
96: <HR>
97: $abc{}
98: $tn[^table:set[nameless]{a1 b1
99: a2 b2
100: }]
101: $x[^tn.locate[0;a2]]
102: ^$tn.1=$tn.1
103: <hr>
104: $t0[^table:set{key a b
105: 1 a1
106: 2 a2 b2
107: }]
108: ^if(^t0.locate[key;2] && "a" ne "b"){y;n}
109: <hr>
110: $currentFolder[/a/b]
111: $path[^currentFolder.lsplit[/]]
112: ^path.flip[]
113: $path{
114: ^menu{$0}{,}
115: }
116: <hr>
117: $t1[^table:set{key value
118: 1 v1
119: 2 v2}]
120: $h1[^t1.hash[key]]
121: ^h1.default[$value[nothing]]
122: ^$h1.2.value=$h1.2.value<br>
123: ^$h1.2x.value=$h1.2x.value<br>
124: <hr>
125: $t2[^table:set{key a b
126: 1 a1
127: 2 a2 b2
128: }]
129: t2 ^if(^t2.empty[]){empty}{not empty}<br>
130: ^t2.offset(1)
131: $t2.b
132: $r[^t2.record[]]
133: <hr>
134: $th[^t2.hash[b]]
135: ^$th.b2.a=$th.b2.a<br>
136: <hr>
137: $th[^t2.hash[key;a]]
138: ^$th.2.a=$th.2.a<br>
139: <hr>
140: #^OP:eval(1<2)
141:
142: $filelist[^table:dir[.]]
143: <hr>
144: $path[/news/tululu/]
145: #^path.flip[]
146: <hr>
147: $branches[^table:set{name val
148: index.cgihtml 123
149: }]
150: $splitURI[^request:uri.lsplit[/]]
151: name ^if(^branches.locate[name;$splitURI.1]){found;not found}:
152: $branches.name
153: <HR>
154: $splitURI[^request:uri.lsplit[/]]
155: $splitURI.0!$splitURI.1
156: <HR>
157:
158: $t2[^table:set{dir title
159: /here Here
160: }]
161: $t2{^menu{${dir}-$title}[,]}
162: <HR>
163: $dir[news]
164: $list[^table:dir[$dir]]
165: ^list.menu{
166: $subdir[$dir/$list.name]
167: $sublist[^table:dir[$subdir]]
168: ${list.name}/ $sublist{^menu{$name}[,]}<br>
169: }
170: <HR>
171: ^if(in "/otherdeeper"){y;n}
172: <HR>
173:
174: ^^table:dir[/]:<BR>
175: $d[^table:dir[/]]
176: $d{^menu{$name  ^; ^; ^; ^;^if(-f $name){-f} ^if(-d $name){-d};<BR>}}
177: <HR>
178:
179: $files[^table:set{name}]
180: $d{^menu{
181: ^if(-d "$name"){
182: ^:files.append{$name}
183: }
184: }}
185:
186: $files{^menu{$name}[,]}
187: <HR>
188:
189: @exception[origin;source;comment;type;code][i;j]
190: <body bgcolor=black>
191: <font color=white>
192: ERROR:
193: ^if(def $source){$origin '$source'}
194: ${comment}.
195: ^if(def $type){type=$type}
196: ^if(def $code){code=$code}
197:
198: @auto_test[]
199: ^BASE.auto_test[]
200: <li>${request:uri}!
201: @end
202:
203:
204: @sql_test[connect-string]
205: #^rem{
206: #^for[i](1;2){
207: ^connect[$connect-string]{
208: $shit[^taint[our's]]
209: # $paf[^table:sql{insert into paf (name, age) values ('$shit', ^random:generate(10000))}]
1.209 ! parser 210: ^void:sql{update paf set age=age+1}
1.200 parser 211: $paf[^table:sql{select * from paf order by id desc}(5)]
212: $paf{
213: ^if(^empty[]){query result is empty}{
214: <table border=1>
215: <tr><td>id</td><td>name</td><td>age</td></tr>
216: ^menu{<tr><td>$id</td><td>$name</td><td>$age</td></tr>}
217: </table>
218: }}
219: ^^string:sql{select name from paf where id=1}=^string:sql{select name from paf where id=1}<br>
220: ^^int:sql{select age from paf where id=1}=^int:sql{select age from paf where id=1}<br>
221: ^^double:sql{select age from paf where id=1}=^double:sql{select age from paf where id=1}<br>
222:
223: $paf[^hash:sql{select id,age from paf}]
224: ^$paf.2.age=$paf.2.age<br>
225: }
226: #}
227: #}
228:
229: @eol[]
230: eol
231:
232: @default[test;def]
233: $result[^if(^test.length[]){$test}{$def}]
E-mail: