From 9aa0063e30aec51f73876732104494a3ab8bd291 Mon Sep 17 00:00:00 2001 From: TopchetoEU <36534413+TopchetoEU@users.noreply.github.com> Date: Wed, 19 Oct 2022 16:17:56 +0300 Subject: [PATCH] fix: some != -1 comparasion fixes --- src/compiler/treeifier/ast/conv.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/treeifier/ast/conv.cc b/src/compiler/treeifier/ast/conv.cc index 23019b4..6bacd72 100644 --- a/src/compiler/treeifier/ast/conv.cc +++ b/src/compiler/treeifier/ast/conv.cc @@ -18,10 +18,10 @@ namespace ppc::comp::tree::ast::conv { }; res["filename"] = loc.filename; - if (loc.start != -1u) res["start"] = (float)loc.start; - if (loc.start != -1u) res["line"] = (float)loc.line; - if (loc.code_start != -1u) res["code_start"] = (float)loc.code_start; - if (loc.length != -1u) res["length"] = (float)loc.length; + if (loc.start + 1) res["start"] = (float)loc.start; + if (loc.start + 1) res["line"] = (float)loc.line; + if (loc.code_start + 1) res["code_start"] = (float)loc.code_start; + if (loc.length + 1) res["length"] = (float)loc.length; return res; }