Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71fffea
commit 2598a87
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
railo-java/railo-core/src/railo/transformer/cfml/evaluator/func/impl/PrecisionEvaluate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package railo.transformer.cfml.evaluator.func.impl; | ||
|
||
import railo.runtime.exp.TemplateException; | ||
import railo.transformer.bytecode.Position; | ||
import railo.transformer.bytecode.expression.Expression; | ||
import railo.transformer.bytecode.expression.var.Argument; | ||
import railo.transformer.bytecode.expression.var.BIF; | ||
import railo.transformer.bytecode.literal.LitString; | ||
import railo.transformer.bytecode.op.OpDouble; | ||
import railo.transformer.cfml.evaluator.FunctionEvaluator; | ||
import railo.transformer.library.function.FunctionLibFunction; | ||
|
||
|
||
public class PrecisionEvaluate implements FunctionEvaluator { | ||
|
||
@Override | ||
public void evaluate(BIF bif, FunctionLibFunction flf) throws TemplateException { | ||
|
||
Argument[] args = bif.getArguments(); | ||
|
||
for (Argument arg : args) { | ||
|
||
Expression value = arg.getValue(); | ||
|
||
if (value instanceof OpDouble) { | ||
|
||
/* this works: | ||
String lit = "p1 + p2"; | ||
Position p1 = new Position(0,0,0), p2 = new Position(0,lit.length()-1,lit.length()-1); | ||
arg.setValue(LitString.toExprString( lit, p1, p2 ), "string"); //*/ | ||
|
||
// TODO: HOW DO WE GET THE ORIGINAL CFML STRING HERE? | ||
// arg.setValue(LitString.toExprString( arg.getRawValue(), value.getStart(), value.getEnd() ), "string"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters