Rev 8400 | Rev 8850 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8400 | Rev 8843 | ||
---|---|---|---|
Line 106... | Line 106... | ||
106 | } |
106 | } |
107 | if(*p!='\\') continue; |
107 | if(*p!='\\') continue; |
108 | c=*(p+1); |
108 | c=*(p+1); |
109 | if(isalnum(c)) { |
109 | if(isalnum(c)) { |
110 | /* exit */ |
110 | /* exit */ |
111 | if(strncmp(p+1,"exit", |
111 | if(strncmp(p+1,"exit",strlen("exit"))==0 && !isalnum(*(p+strlen("exit")+1))) { |
112 | *p=0; fprintf(outf,"%s\n!exit\n",ps); p+=5; ps=p; |
112 | *p=0; fprintf(outf,"%s\n!exit\n",ps); p+=5; ps=p; |
113 | continue; |
113 | continue; |
114 | } |
114 | } |
115 | /* for */ |
115 | /* for */ |
116 | if(strncmp(p+1,"for", |
116 | if(strncmp(p+1,"for",strlen("for"))==0 && *find_word_start(p+strlen("for")+1)=='{') { |
117 | char *pt; |
117 | char *pt; |
118 | *p=0; fprintf(outf,"%s",ps); p++; ps=p; |
118 | *p=0; fprintf(outf,"%s",ps); p++; ps=p; |
119 | pt=exec_for(p+3); if(pt>p+3) {p=pt-1;ps=pt;} |
119 | pt=exec_for(p+3); if(pt>p+3) {p=pt-1;ps=pt;} |
120 | continue; |
120 | continue; |
121 | } |
121 | } |
122 | /* if */ |
122 | /* if */ |
123 | if(strncmp(p+1,"if", |
123 | if(strncmp(p+1,"if",strlen("if"))==0 && *find_word_start(p+strlen("if")+1)=='{') { |
124 | char *pt; |
124 | char *pt; |
125 | *p=0; fprintf(outf,"%s",ps); p++; ps=p; |
125 | *p=0; fprintf(outf,"%s",ps); p++; ps=p; |
126 | pt=exec_if(p+2); if(pt>p+2) {p=pt-1;ps=pt;} |
126 | pt=exec_if(p+2); if(pt>p+2) {p=pt-1;ps=pt;} |
127 | continue; |
127 | continue; |
128 | } |
128 | } |
129 | /* ifval */ |
129 | /* ifval */ |
130 | if(strncmp(p+1,"ifval", |
130 | if(strncmp(p+1,"ifval",strlen("ifval"))==0 && *find_word_start(p+strlen("ifval")+1)=='{') { |
131 | char *pt; |
131 | char *pt; |
132 | *p=0; fprintf(outf,"%s",ps); p++; ps=p; |
132 | *p=0; fprintf(outf,"%s",ps); p++; ps=p; |
133 | pt=exec_if(p+5); if(pt>p+5) {p=pt-1;ps=pt;} |
133 | pt=exec_if(p+5); if(pt>p+5) {p=pt-1;ps=pt;} |
134 | continue; |
134 | continue; |
135 | } |
135 | } |
136 | /* canvasdraw */ |
136 | /* canvasdraw */ |
137 | if(strncmp(p+1,"canvasdraw", |
137 | if(strncmp(p+1,"canvasdraw",strlen("canvasdraw"))==0 && *find_word_start(p+strlen("canvasdraw")+1)=='{') { |
138 | pe=pp2=pe2=""; |
138 | pe=pp2=pe2=""; |
139 | pp=find_word_start(p+11); |
139 | pp=find_word_start(p+11); |
140 | if(*pp) pe=find_matching(pp+1,'}'); |
140 | if(*pp) pe=find_matching(pp+1,'}'); |
141 | if(pe) pp2=find_word_start(pe+1); else continue; |
141 | if(pe) pp2=find_word_start(pe+1); else continue; |
142 | if(pp2) pe2=find_matching(pp2+1,'}'); else continue; |
142 | if(pp2) pe2=find_matching(pp2+1,'}'); else continue; |
Line 147... | Line 147... | ||
147 | ps=p=pe2; ps++; continue; |
147 | ps=p=pe2; ps++; continue; |
148 | } |
148 | } |
149 | } |
149 | } |
150 | 150 | ||
151 | /* draw */ |
151 | /* draw */ |
152 | if(strncmp(p+1,"draw", |
152 | if(strncmp(p+1,"draw",strlen("draw"))==0 && *find_word_start(p+strlen("draw")+1)=='{') { |
153 | pe=pp2=pe2=""; |
153 | pe=pp2=pe2=""; |
154 | pp=find_word_start(p+5); |
154 | pp=find_word_start(p+5); |
155 | if(*pp) pe=find_matching(pp+1,'}'); |
155 | if(*pp) pe=find_matching(pp+1,'}'); |
156 | if(pe) pp2=find_word_start(pe+1); else continue; |
156 | if(pe) pp2=find_word_start(pe+1); else continue; |
157 | if(pp2) pe2=find_matching(pp2+1,'}'); else continue; |
157 | if(pp2) pe2=find_matching(pp2+1,'}'); else continue; |
Line 200... | Line 200... | ||
200 | fprintf(outf,"%s \n\ |
200 | fprintf(outf,"%s \n\ |
201 | !read oef/audio.phtml %s %s \n$()", ps,pp,pp2); |
201 | !read oef/audio.phtml %s %s \n$()", ps,pp,pp2); |
202 | ps=p=pe2; ps++; continue; |
202 | ps=p=pe2; ps++; continue; |
203 | } |
203 | } |
204 | } |
204 | } |
- | 205 | /* embed */ |
|
- | 206 | ||
205 | if(strncmp(p+1,"embed", |
207 | if(strncmp(p+1,"embed",strlen("embed"))==0 && *find_word_start(p+strlen("embed")+1)=='{') { |
206 | pe=pp2=pe2=""; |
208 | pe=pp2=pe2=""; |
207 | pp=find_word_start(p+6); |
209 | pp=find_word_start(p+6); |
208 | if(*pp) pe=find_matching(pp+1,'}'); |
210 | if(*pp) pe=find_matching(pp+1,'}'); |
209 | if(pe && *pp=='{' && *pe=='}') { |
211 | if(pe && *pp=='{' && *pe=='}') { |
210 | pp++; *p=*pe=0; |
212 | pp++; *p=*pe=0; |
211 | fprintf(outf,"%s \n\ |
213 | fprintf(outf,"%s \n\ |
212 | !read oef/embed.phtml %s \n$()", ps,pp); |
214 | !read oef/embed.phtml %s \n$()", ps,pp); |
213 | ps=p=pe; ps++; embedcnt++; continue; |
215 | ps=p=pe; ps++; embedcnt++; continue; |
214 | } |
216 | } |
215 | } |
217 | } |
216 | if(strncmp(p+1,"special", |
218 | if(strncmp(p+1,"special",strlen("special"))==0 && *find_word_start(p+strlen("special"))=='{') { |
217 | pe=pp2=pe2=""; |
219 | pe=pp2=pe2=""; |
218 | pp=find_word_start(p+8); |
220 | pp=find_word_start(p+8); |
219 | if(*pp) pe=find_matching(pp+1,'}'); |
221 | if(*pp) pe=find_matching(pp+1,'}'); |
220 | if(pe && *pp=='{' && *pe=='}') { |
222 | if(pe && *pp=='{' && *pe=='}') { |
221 | pp++; *p=*pe=0; |
223 | pp++; *p=*pe=0; |