Skip to content

Commit 178da2d

Browse files
committed
Remove useless package.path wrapping in the API
1 parent 8086589 commit 178da2d

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/MathParser.lua

+2-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
--[[
22
Name: MathParser.lua
33
Author: ByteXenon [Luna Gilbert]
4-
Date: 2024-06-21
4+
Date: 2024-06-22
55
--]]
66

7-
local scriptPath, requirePath, localPath, oldPath
8-
if not LUAXEN_PACKER then
9-
-- Localize the path, so this file can be run from anywhere
10-
scriptPath = (debug.getinfo(1).source:match("@?(.*/)") or "")
11-
requirePath = scriptPath .. "./?.lua"
12-
localPath = scriptPath .. "./"
13-
oldPath = package.path
14-
package.path = package.path .. ";" .. requirePath
15-
end
16-
177
--* Dependencies *--
188
local Helpers = require("Helpers/Helpers")
199
local Evaluator = require("Evaluator/Evaluator")
@@ -210,9 +200,4 @@ function MathParser:new(operatorPrecedenceLevels, variables, operatorFunctions,
210200
return MathParserInstance
211201
end
212202

213-
if not LUAXEN_PACKER then
214-
-- Reset package.path
215-
package.path = oldPath
216-
end
217-
218-
return MathParser
203+
return MathParser

0 commit comments

Comments
 (0)