From fc1706d0c23e692949eaaf1faf8fb7ad2e1ae393 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 11 Mar 2017 19:27:42 -0500 Subject: [PATCH] progress #369 --- .../src/com/fathzer/soft/javaluator/AbstractEvaluator.java | 2 +- java_console/models/src/com/rusefi/test/ParserTest.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/java_console/models/src/com/fathzer/soft/javaluator/AbstractEvaluator.java b/java_console/models/src/com/fathzer/soft/javaluator/AbstractEvaluator.java index 24330bd5b9..55ffc4e7cd 100644 --- a/java_console/models/src/com/fathzer/soft/javaluator/AbstractEvaluator.java +++ b/java_console/models/src/com/fathzer/soft/javaluator/AbstractEvaluator.java @@ -302,7 +302,7 @@ public abstract class AbstractEvaluator { throw new IllegalArgumentException("Parentheses mismatched"); } if (!stack.isEmpty() && stack.peek().isFunction()) { - rpnPush("function", stack.peek().getLiteral()); + rpnPush("function", stack.peek().getFunction().getName()); // If the token at the top of the stack is a function token, pop it // onto the output queue. int argCount = values.size()-previousValuesSize.pop(); diff --git a/java_console/models/src/com/rusefi/test/ParserTest.java b/java_console/models/src/com/rusefi/test/ParserTest.java index 31f2f47002..da2eca07f4 100644 --- a/java_console/models/src/com/rusefi/test/ParserTest.java +++ b/java_console/models/src/com/rusefi/test/ParserTest.java @@ -9,9 +9,13 @@ import java.util.Stack; import static org.junit.Assert.assertEquals; +/** + * @see DoubleEvaluator + */ public class ParserTest { @Test public void testFunctionParameters() { + assertParse("3 log", "log(3)"); // todo: parameter order needs to be in postfix form // assertParseB("fsio_setting 0", "fsio_setting 0"); }