diff --git a/core/src/main/java/lucee/transformer/cfml/Data.java b/core/src/main/java/lucee/transformer/cfml/Data.java index 357e227e45..ab6e2584df 100644 --- a/core/src/main/java/lucee/transformer/cfml/Data.java +++ b/core/src/main/java/lucee/transformer/cfml/Data.java @@ -57,6 +57,9 @@ public class Data { private Body parent; public ExprTransformer transformer; + public boolean insideTenaryMiddle = false; + public boolean insideCase = false; + public Data(Factory factory, Config config, Page page, SourceCode srcCode, EvaluatorPool ep, TransfomerSettings settings, TagLib[][] tlibs, FunctionLib flibs, TagLibTag[] scriptTags, boolean allowLowerThan) { this.page = page; diff --git a/core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java b/core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java index 892922f852..0e284a43b6 100755 --- a/core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java +++ b/core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java @@ -181,9 +181,6 @@ public abstract class AbstrCFMLExprTransformer { protected short ATTR_TYPE_OPTIONAL = TagLibTagAttr.SCRIPT_SUPPORT_OPTIONAL; protected short ATTR_TYPE_REQUIRED = TagLibTagAttr.SCRIPT_SUPPORT_REQUIRED; - private short tenaryContext = 0; - protected boolean insideCase = false; - protected static EndCondition SEMI_BLOCK = new EndCondition() { @Override public boolean isEnd(Data data) { @@ -388,14 +385,14 @@ private Expression conditionalOp(Data data) throws TemplateException { // tenary middle Expression left; - short pre = 0; + boolean pre = false; try { - pre = tenaryContext; - tenaryContext = CTX_TENARY_MIDDLE; + pre = data.insideTenaryMiddle; + data.insideTenaryMiddle = true; left = assignOp(data); } finally { - tenaryContext = pre; + data.insideTenaryMiddle = pre; } comments(data); if (!data.srcCode.forwardIfCurrent(':')) throw new TemplateException(data.srcCode, "invalid conditional operator"); @@ -1879,7 +1876,7 @@ private FunctionMember getFunctionMember(Data data, final ExprString name, boole } private Expression getListener(Data data) throws TemplateException { - if (!insideCase && tenaryContext != CTX_TENARY_MIDDLE && data.srcCode.isPreviousIgnoreSpace(')') && data.srcCode.forwardIfCurrent(':')) { + if (!data.insideCase && data.insideTenaryMiddle && data.srcCode.isPreviousIgnoreSpace(')') && data.srcCode.forwardIfCurrent(':')) { int pos = data.srcCode.getPos(); comments(data); Expression expr = assignOp(data); diff --git a/core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java b/core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java index 94cea4705d..1cc3495f91 100755 --- a/core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java +++ b/core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java @@ -511,13 +511,13 @@ private final boolean caseStatement(Data data, Switch swit) throws TemplateExcep // int line=data.srcCode.getLine(); comments(data); Expression expr; - boolean pre = insideCase; + boolean pre = data.insideCase; try { - insideCase = true; + data.insideCase = true; expr = super.expression(data); } finally { - insideCase = pre; + data.insideCase = pre; } comments(data); diff --git a/loader/build.xml b/loader/build.xml index 98c8b43c73..e41cce1ad6 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index 4a12f4201a..9d09cc6e63 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.1.0.205-SNAPSHOT + 6.1.0.206-SNAPSHOT jar Lucee Loader Build