Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't remove excess parentheses which are highlighting precedence #610

Merged
merged 6 commits into from Oct 27, 2022

Conversation

JohnnyMorganz
Copy link
Owner

Fixes #609

@codecov
Copy link

codecov bot commented Oct 27, 2022

Codecov Report

Base: 97.65% // Head: 97.65% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (634ff6e) compared to base (bee202b).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #610   +/-   ##
=======================================
  Coverage   97.65%   97.65%           
=======================================
  Files          14       14           
  Lines        5577     5585    +8     
=======================================
+ Hits         5446     5454    +8     
  Misses        131      131           
Impacted Files Coverage Δ
src/formatters/expression.rs 96.59% <100.00%> (+0.03%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link
Contributor

Repo Comparison Test

diff --git ORI/zombie-strike/src/hub/StarterGui/MainGui/App/GoldShop/Pages/Weapons.lua ALT/zombie-strike/src/hub/StarterGui/MainGui/App/GoldShop/Pages/Weapons.lua
index 40c9d39..9bb931f 100644
--- ORI/zombie-strike/src/hub/StarterGui/MainGui/App/GoldShop/Pages/Weapons.lua
+++ ALT/zombie-strike/src/hub/StarterGui/MainGui/App/GoldShop/Pages/Weapons.lua
@@ -107,7 +107,7 @@ local function WeaponCard(props)
 
 							Label = element,
 
-							GoldIcon = not props.AlreadyBought and e("ImageLabel", {
+							GoldIcon = (not props.AlreadyBought) and e("ImageLabel", {
 								AnchorPoint = Vector2.new(1, 1),
 								BackgroundTransparency = 1,
 								Image = ImageCap,
diff --git ORI/zombie-strike/src/shared/ReplicatedStorage/ItemModules/Gun.lua ALT/zombie-strike/src/shared/ReplicatedStorage/ItemModules/Gun.lua
index 74ed4be..8b1a36c 100644
--- ORI/zombie-strike/src/shared/ReplicatedStorage/ItemModules/Gun.lua
+++ ALT/zombie-strike/src/shared/ReplicatedStorage/ItemModules/Gun.lua
@@ -240,7 +240,7 @@ function module.Create(_, item)
 			reloadTime = perk:ModifyReloadTime(reloadTime)
 		end
 
-		if not reloading and itemModule.Equipped and ammo < config.Magazine then
+		if (not reloading) and itemModule.Equipped and ammo < config.Magazine then
 			reloading = true
 			rCancelled = false
 
diff --git ORI/luvit/deps/repl.lua ALT/luvit/deps/repl.lua
index 6a69144..d67eb34 100644
--- ORI/luvit/deps/repl.lua
+++ ALT/luvit/deps/repl.lua
@@ -176,7 +176,7 @@ return function(stdin, stdout, greeting)
 		local prop = sep ~= ":"
 		while type(scope) == "table" do
 			for key, value in pairs(scope) do
-				if (prop or (type(value) == "function")) and (not prefix or (string.match(key, "^" .. prefix))) then
+				if (prop or (type(value) == "function")) and ((not prefix) or (string.match(key, "^" .. prefix))) then
 					matches[key] = true
 				end
 			end
diff --git ORI/lit/deps/semver.lua ALT/lit/deps/semver.lua
index 91c9e66..718c542 100644
--- ORI/lit/deps/semver.lua
+++ ALT/lit/deps/semver.lua
@@ -90,7 +90,7 @@ function match(version, iterator)
 		-- With an empty match, simply grab the newest version
 		for possible in iterator do
 			local d, e, f, y = parse(possible)
-			if not a or (d > a) or (d == a and (e > b or (e == b and (f > c or (f == c and y > x))))) then
+			if (not a) or (d > a) or (d == a and (e > b or (e == b and (f > c or (f == c and y > x))))) then
 				a, b, c, x = d, e, f, y
 			end
 		end
@@ -107,7 +107,7 @@ function match(version, iterator)
 				if
 					d == g
 					and (e > h or (e == h and (f > i or (f == i and y >= z))))
-					and (not a or e > b or (e == b and (f > c or (f == c and y > x))))
+					and ((not a) or e > b or (e == b and (f > c or (f == c and y > x))))
 				then
 					a, b, c, x = d, e, f, y
 				end
@@ -118,7 +118,12 @@ function match(version, iterator)
 			for possible in iterator do
 				local d, e, f, y = parse(possible)
 				-- Must be gte the minumum, but match major and minor versions.
-				if d == g and e == h and (f > i or (f == i and y >= z)) and (not a or f > c or (f == c and y > x)) then
+				if
+					d == g
+					and e == h
+					and (f > i or (f == i and y >= z))
+					and ((not a) or f > c or (f == c and y > x))
+				then
 					a, b, c, x = d, e, f, y
 				end
 			end
@@ -127,7 +132,7 @@ function match(version, iterator)
 			for possible in iterator do
 				local d, e, f, y = parse(possible)
 				-- Must match major, minor, and patch, only allow build updates
-				if d == g and e == h and f == i and y >= z and (not a or y > x) then
+				if d == g and e == h and f == i and y >= z and ((not a) or y > x) then
 					a, b, c, x = d, e, f, y
 				end
 			end

@JohnnyMorganz JohnnyMorganz merged commit d681afb into main Oct 27, 2022
@JohnnyMorganz JohnnyMorganz deleted the excess-parentheses-dont-remove branch October 27, 2022 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve removal of parentheses around expressions
1 participant