Skip to content

Commit

Permalink
fix build-error for no-inline
Browse files Browse the repository at this point in the history
  • Loading branch information
maitag committed Sep 20, 2023
1 parent f782a8a commit 1a380a4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
}
10 changes: 6 additions & 4 deletions src/TermNode.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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:Map<String, TermNode->Float> = [
Expand Down Expand Up @@ -492,7 +492,8 @@ class TermNode {
static function parseString(s:String, errPos:Int, ?params:Map<String, TermNode>):TermNode {
var t:TermNode = null;
var operations:Array<OperationNode> = new Array();
var e, f:String;
var e:String = "";
var f:String;
var negate:Bool;
var spaces:Int = 0;

Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -636,6 +637,7 @@ class TermNode {
}
if (s.indexOf(")") == 0) ErrorMsg.noOpeningBracket(errPos);
else ErrorMsg.wrongChar(errPos);
return "";
}


Expand Down
1 change: 1 addition & 0 deletions test.hx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class Test extends hxp.Script {
#end
main: "Test",
dce: FULL,
//noInline: true,
debug: false
});

Expand Down

0 comments on commit 1a380a4

Please sign in to comment.