1<!---
2Copyright 2006-2007 TeraTech, Inc. http://teratech.com/
3 4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7 8http://www.apache.org/licenses/LICENSE-2.0
9 10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15--->
16<cfscript>
17 if (fb_.verbInfo.executionMode is "start") {
18 // validate attributes
19 // <true> has no attributes
20 // <true> must be nested inside an <if>
21 if (not structKeyExists(fb_.verbInfo,"parent") or fb_.verbInfo.parent.lexiconVerb is not "if") {
22 fb_throw("fusebox.badGrammar.trueNeedsIf",
23 "Verb 'true' has no parent 'if' verb",
24 "Found 'true' verb with no parent 'if' verb in fuseaction #fb_.verbInfo.circuit#.#fb_.verbInfo.fuseaction#.");
25 }
26 // strict mode - check attribute count:
27 if (fb_.verbInfo.action.getCircuit().getApplication().strictMode) {
28 if (structCount(fb_.verbInfo.attributes) neq 0) {
29 fb_throw("fusebox.badGrammar.unexpectedAttributes",
30 "Unexpected attributes",
31 "Unexpected attributes were found in a 'true' verb in fuseaction #fb_.verbInfo.circuit#.#fb_.verbInfo.fuseaction#.");
32 }
33 }
34 35 // compile <true>
36 if (fb_.verbInfo.parent.ifUsed) {
37 fb_appendLine("<cfelse>");
38 } else {
39 fb_appendLine("<cfif #fb_.verbInfo.parent.condition#>");
40 fb_.verbInfo.parent.ifUsed = true;
41 }
42 }
43</cfscript>