From 1a380a4a280d0525dbd8dca706979877252f7719 Mon Sep 17 00:00:00 2001 From: Sylvio Sell Date: Wed, 20 Sep 2023 13:18:10 +0200 Subject: [PATCH] fix build-error for no-inline --- haxelib.json | 4 ++-- src/TermNode.hx | 10 ++++++---- test.hx | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/haxelib.json b/haxelib.json index 632af65..6f2fcd1 100644 --- a/haxelib.json +++ b/haxelib.json @@ -4,9 +4,9 @@ "license": "MIT", "tags": ["math", "expression", "parser", "derivate"], "description": "math expression parser, evaluator and more", - "version": "0.4.2", + "version": "0.4.3", "classPath": "src/", - "releasenote": "better errorhandling", + "releasenote": "fix problem for building with no-inline", "contributors": ["maitag"], "dependencies": {} } \ No newline at end of file diff --git a/src/TermNode.hx b/src/TermNode.hx index 2047eb0..6a3adba 100644 --- a/src/TermNode.hx +++ b/src/TermNode.hx @@ -392,8 +392,8 @@ class TermNode { * static Function Pointers (to stored in this.operation) * */ - static function opName(t:TermNode) :Float if (t.left!=null) return t.left.result else ErrorMsg.emptyFunction(t.symbol); - static function opParam(t:TermNode):Float if (t.left!=null) return t.left.result else ErrorMsg.missingParameter(t.symbol); + static function opName(t:TermNode) :Float if (t.left != null) return t.left.result else { ErrorMsg.emptyFunction(t.symbol); return 0; } + static function opParam(t:TermNode):Float if (t.left!=null) return t.left.result else { ErrorMsg.missingParameter(t.symbol); return 0; } static function opValue(t:TermNode):Float return t.value; static var MathOp:MapFloat> = [ @@ -492,7 +492,8 @@ class TermNode { static function parseString(s:String, errPos:Int, ?params:Map):TermNode { var t:TermNode = null; var operations:Array = new Array(); - var e, f:String; + var e:String = ""; + var f:String; var negate:Bool; var spaces:Int = 0; @@ -579,7 +580,7 @@ class TermNode { } if ( operations.length > 0 ) { - if ( operations[operations.length-1].right == null ) ErrorMsg.missingRightOperand(errPos-spaces); + if ( operations[operations.length - 1].right == null ) { ErrorMsg.missingRightOperand(errPos - spaces); return t;} else { operations.sort(function(a:OperationNode, b:OperationNode):Int { @@ -636,6 +637,7 @@ class TermNode { } if (s.indexOf(")") == 0) ErrorMsg.noOpeningBracket(errPos); else ErrorMsg.wrongChar(errPos); + return ""; } diff --git a/test.hx b/test.hx index 00f8459..2066f24 100644 --- a/test.hx +++ b/test.hx @@ -80,6 +80,7 @@ class Test extends hxp.Script { #end main: "Test", dce: FULL, + //noInline: true, debug: false });