Skip to content

Commit

Permalink
Merge pull request #37 from sile-typesetter/fix-stdlib-leftovers
Browse files Browse the repository at this point in the history
Fix a few bits leftover from stdlib monkey patching
  • Loading branch information
alerque committed Apr 22, 2022
2 parents 81a5a59 + ef0d059 commit a4e8d78
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/busted.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: false
matrix:
luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty" ]
penlightVersion: [ "1.12.0", "1.9.2", "1.8.0", "1.6.0", "1.5.4" ]
penlightVersion: [ "1.12.0", "1.9.2", "1.5.4" ]
runs-on: ubuntu-20.04
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion cassowary-scm-0.rockspec
Expand Up @@ -20,7 +20,7 @@ description = {

dependencies = {
"lua >= 5.1",
"penlight"
"penlight >= 1.5.4"
}

build = {
Expand Down
10 changes: 6 additions & 4 deletions cassowary/init.lua
Expand Up @@ -485,7 +485,7 @@ cassowary.Expression = class({
local sort_hashcodes = function (a, b) return a.hashcode < b.hashcode end
for clv, coeff in tablex.sort(self.terms, sort_hashcodes) do
if needsplus then rv = rv .. " + " end
rv = rv .. coeff .. "*" .. clv.value
rv = rv .. coeff .. "*" .. tostring(clv.value)
needsplus = true
end
return rv
Expand All @@ -508,7 +508,9 @@ cassowary.Expression = class({
end
})

local _constraintStringify = function (self) return tostring(self.strength) .. " {" .. tostring(self.weight) .. "} (" .. tostring(self.expression) .. ")" end
local _constraintStringify = function (self)
return tostring(self.strength) .. " {" .. tostring(self.weight) .. "} (" .. tostring(self.expression) .. ")"
end

cassowary.AbstractConstraint = class({
isEditConstraint = false,
Expand Down Expand Up @@ -896,7 +898,7 @@ cassowary.SimplexSolver = subclass(cassowary.Tableau, {
end,

resolveArray = function (self, newEditConstants)
cassowary:traceFnEnterPrint("resolveArray: "..newEditConstants)
cassowary:traceFnEnterPrint("resolveArray: "..tostring(newEditConstants))
local l = #newEditConstants
for v, cei in pairs(self.editVarMap) do
local i = cei.index
Expand Down Expand Up @@ -1139,7 +1141,7 @@ cassowary.SimplexSolver = subclass(cassowary.Tableau, {
cassowary:tracePrint(zRow)
local swCoeff = cn.strength.symbolicWeight.value * cn.weight
if swCoeff == 0 then
cassowary:tracePrint("cn === "..cn.. " swCoeff = 0")
cassowary:tracePrint("cn === " .. tostring(cn).. " swCoeff = 0")
end
zRow:setVariable(eplus, swCoeff)
self:noteAddedVariable(eplus, self.objective)
Expand Down

0 comments on commit a4e8d78

Please sign in to comment.