Skip to content

Commit

Permalink
chore(core): Fix spelling mistakes throughout code base
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Oct 9, 2023
1 parent e9cfc49 commit ab665cc
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion classes/docbook.lua
Expand Up @@ -21,7 +21,7 @@ function class:_init (options)
self:loadPackage("footnotes")
-- SILE sensibly does not define a pixels unit because it has no meaning in its frame of reference. However the
-- Docbook standard requires them and even defaults to them for bare numbers, even while warning against their use.
-- Here we define a px arbitrarily to be the equivilent point unit if output was 300 DPI.
-- Here we define a px arbitrarily to be the equivalent point unit if output was 300 DPI.
SILE.units.px = {
definition = "0.24pt"
}
Expand Down
2 changes: 1 addition & 1 deletion classes/plain.lua
Expand Up @@ -76,7 +76,7 @@ function class:registerCommands ()

self:registerCommand("noindent", function (_, content)
if #SILE.typesetter.state.nodes ~= 0 then
SU.warn("\\noindent called after nodes already recieved in a paragraph, the setting will have no effect because the parindent (if any) has already been output")
SU.warn("\\noindent called after nodes already received in a paragraph, the setting will have no effect because the parindent (if any) has already been output")
end
SILE.settings:set("current.parindent", SILE.nodefactory.glue())
SILE.process(content)
Expand Down
2 changes: 1 addition & 1 deletion classes/tplain.lua
Expand Up @@ -14,7 +14,7 @@ class.defaultFrameset.content = {
}

-- The classes tplain and tbook inherit from plain and book respectively but also
-- have this bit in common; this makes it accessable
-- have this bit in common; this makes it accessible
function class:_t_common ()
self:loadPackage("font-fallback")
self:loadPackage("hanmenkyoshi")
Expand Down
4 changes: 2 additions & 2 deletions core/break.lua
Expand Up @@ -91,7 +91,7 @@ end
-- up to the that total. Returning values that don't add up may produce
-- unexpected results.
--
-- TeX wizards shall also note that this is slighty different from
-- TeX wizards shall also note that this is slightly different from
-- Knuth's definition "nline l1 i1 l2 i2 ... lN iN".
function lineBreak:parShape(_)
return 0, self.hsize, 0
Expand Down Expand Up @@ -176,7 +176,7 @@ function lineBreak:tryBreak() -- 855
end
-- 861
if self.r.lineNumber > self.old_l then
if debugging then SU.debug("break", "Mimimum demerits = " .. self.minimumDemerits) end
if debugging then SU.debug("break", "Minimum demerits = " .. self.minimumDemerits) end
if self.minimumDemerits < awful_bad and (self.old_l ~= self.easy_line or self.r == self.activeListHead) then
self:createNewActiveNodes(breakType)
end
Expand Down
2 changes: 1 addition & 1 deletion core/nodefactory.lua
Expand Up @@ -255,7 +255,7 @@ end
getmetatable(nodefactory.unshaped).__index = function (_, _)
-- if k == "width" then SU.error("Can't get width of unshaped node", true) end
-- TODO: No idea why porting to proper Penlight classes this ^^^^^^ started
-- killing everything. Perhaps becaus this function started working and would
-- killing everything. Perhaps because this function started working and would
-- actually need to return rawget(self, k) or something?
end

Expand Down
6 changes: 3 additions & 3 deletions core/sile.lua
Expand Up @@ -59,8 +59,8 @@ SILE.documentState = {}
SILE.rawHandlers = {}

-- User input values, currently from CLI options, potentially all the inuts
-- needed for a user to use a SILE-as-a-library verion to produce documents
-- programatically.
-- needed for a user to use a SILE-as-a-library version to produce documents
-- programmatically.
SILE.input = {
filenames = {},
evaluates = {},
Expand Down Expand Up @@ -97,7 +97,7 @@ SILE.nodefactory = require("core.nodefactory")

-- NOTE:
-- See remainaing internal libraries loaded at the end of this file because
-- they run core SILE functions on load istead of waiting to be called (or
-- they run core SILE functions on load instead of waiting to be called (or
-- depend on others that do).

local function runEvals (evals, arg)
Expand Down
2 changes: 1 addition & 1 deletion core/utilities-numbers.lua
Expand Up @@ -60,7 +60,7 @@ local icuFormat = function (num, lang, options)
-- ICU locale: see https://unicode-org.github.io/icu/userguide/locale/
-- Ex. "en", "en-US", "sr-Latn"...
local iculocale = lang or ""
-- ICU keywork for a numbering system specifier: @numbers=xxxx
-- ICU keyword for a numbering system specifier: @numbers=xxxx
-- The specifiers are defined here:
-- https://github.com/unicode-org/cldr/blob/main/common/bcp47/number.xml
if options.system then
Expand Down
2 changes: 1 addition & 1 deletion core/utilities.lua
Expand Up @@ -101,7 +101,7 @@ utilities.deprecated = function (old, new, warnat, errorat, extra)
-- runtime but not useful if we encounter deprecated code in core code. Users
-- will never encounter this failure, but as a developer it’s hard to test a
-- deprecation when core code refactoring is an all-or-nothing proposition.
-- Hence we fake it ‘till we make it, all deprecations internally are warings.
-- Hence we fake it ‘till we make it, all deprecations internally are warnings.
local brackets = old:sub(1,1) == '\\' and "" or "()"
local _new = new and "Please use " .. (new .. brackets) .. " instead." or "Plase don't use it."
local msg = (old .. brackets) .. " was deprecated in SILE v" .. tostring(warnat) .. ". " .. _new .. (extra and "\n" .. extra .. "\n\n" or "")
Expand Down
2 changes: 1 addition & 1 deletion inputters/base.lua
Expand Up @@ -23,7 +23,7 @@ function inputter:classInit (options)
class = constructor._name
end
class = SILE.input.class or class or options.class or "plain"
options.class = nil -- don't pass already consumed class option to contstructor
options.class = nil -- don't pass already consumed class option to constructor
constructor = self._docclass or constructor or SILE.require(class, "classes", true)
if constructor.id then
SU.deprecated("std.object", "pl.class", "0.13.0", "0.14.0", string.format(_deprecated, constructor.id))
Expand Down
2 changes: 1 addition & 1 deletion outputters/debug.lua
Expand Up @@ -15,7 +15,7 @@ local function _round (input)
-- just enough to fix the bias so our test suite works across interpreters.
-- Note that even a true rounding function here will fail because the bias is
-- inherent to the floating point type. Also note we are erroring in favor of
-- the *less* common option beacuse the LuaJIT VMS are hopelessly broken
-- the *less* common option because the LuaJIT VMS are hopelessly broken
-- whereas normal LUA VMs can be cooerced.
if input > 0 then input = input + .00000000000001 end
if input < 0 then input = input - .00000000000001 end
Expand Down
2 changes: 1 addition & 1 deletion outputters/libtexpdf.lua
Expand Up @@ -42,7 +42,7 @@ function outputter:newPage ()
pdf.beginpage()
end

-- pdf stucture package needs a tie in here
-- pdf structure package needs a tie in here
function outputter._endHook (_)
end

Expand Down
2 changes: 1 addition & 1 deletion packages/autodoc/init.lua
Expand Up @@ -356,7 +356,7 @@ function package:registerCommands ()
SILE.call("novbreak")
SILE.call("fullrule", { thickness = "0.5pt" })
SILE.call("novbreak")
end, "Ouputs a line used for surrounding code blocks (somewhat internal)")
end, "Outputs a line used for surrounding code blocks (somewhat internal)")

self:registerCommand("autodoc:example", function(_, content)
-- Loosely derived from the \examplefont command from the original SILE manual...
Expand Down
2 changes: 1 addition & 1 deletion packages/leaders/init.lua
Expand Up @@ -75,7 +75,7 @@ function leader:outputYourself (typesetter, line)
end
end
-- Return to our start (saved) position and move to the full leaders width.
-- (So we are sure to safely get the correct width, whathever we did above
-- (So we are sure to safely get the correct width, whatever we did above
-- with the remainder space and the leader repetitions).
typesetter.frame.state.cursorX = ox
typesetter.frame.state.cursorY = oy
Expand Down
2 changes: 1 addition & 1 deletion packages/lists/init.lua
Expand Up @@ -102,7 +102,7 @@ function package:doItem (options, content)

local stepback
if enumStyle.display then
-- The positionning is quite tentative... LaTeX would right justify the
-- The positioning is quite tentative... LaTeX would right justify the
-- number (at least for roman numerals), i.e.
-- i. Text
-- ii. Text
Expand Down
14 changes: 7 additions & 7 deletions packages/math/base-elements.lua
Expand Up @@ -225,7 +225,7 @@ end
-- Typesetting of mbox evolves four steps:
-- 1. Determine the mode for each mbox according to their parent.
-- 2. Shape the mbox hierarchy from leaf to top. Get the shape and relative position.
-- 3. Convert mbox into _nnode's to put in SILE's typesetting framwork
-- 3. Convert mbox into _nnode's to put in SILE's typesetting framework
elements.mbox = pl.class(nodefactory.hbox)
elements.mbox._type = "Mbox"

Expand Down Expand Up @@ -254,15 +254,15 @@ function elements.mbox:_init ()
end

function elements.mbox.styleChildren (_)
SU.error("styleChildren is a virtual function that need to be overriden by its child classes")
SU.error("styleChildren is a virtual function that need to be overridden by its child classes")
end

function elements.mbox.shape (_, _, _)
SU.error("shape is a virtual function that need to be overriden by its child classes")
SU.error("shape is a virtual function that need to be overridden by its child classes")
end

function elements.mbox.output (_, _, _, _)
SU.error("output is a virtual function that need to be overriden by its child classes")
SU.error("output is a virtual function that need to be overridden by its child classes")
end

function elements.mbox:getMathMetrics ()
Expand Down Expand Up @@ -860,7 +860,7 @@ function elements.text:shape ()
.vertGlyphConstructions[glyphs[1].gid]
if constructions then
local displayVariants = constructions.mathGlyphVariantRecord
-- We select the biggest variant. TODO: we shoud probably select the
-- We select the biggest variant. TODO: we should probably select the
-- first variant that is higher than displayOperatorMinHeight.
local biggest
local m = 0
Expand Down Expand Up @@ -945,7 +945,7 @@ function elements.text:stretchyReshape (depth, height)
local closest
local closestI
local m = requiredAdvance - (self.depth+self.height):tonumber() * upem/sz
SU.debug("math", "strech: m =", m)
SU.debug("math", "stretch: m =", m)
for i,v in ipairs(variants) do
local diff = math.abs(v.advanceMeasurement - requiredAdvance)
SU.debug("math", "stretch: diff =", diff)
Expand Down Expand Up @@ -1105,7 +1105,7 @@ function elements.mtr.shape (_) end -- done by parent table
function elements.mtr.output (_) end
elements.table = pl.class(elements.mbox)
elements.table._type = "table" -- TODO why case diference?
elements.table._type = "table" -- TODO why case difference?
function elements.table:_init (children, options)
elements.mbox._init(self)
Expand Down
2 changes: 1 addition & 1 deletion packages/ruby/init.lua
Expand Up @@ -29,7 +29,7 @@ end

function package:_init ()
base._init(self)
-- Japaneese language support defines units which are useful here
-- Japanese language support defines units which are useful here
self:loadPackage("font-fallback")
SILE.call("font:add-fallback", { family = "Noto Sans CJK JP" })
SILE.languageSupport.loadLanguage("ja")
Expand Down
2 changes: 1 addition & 1 deletion packages/simpletable/init.lua
Expand Up @@ -24,7 +24,7 @@ function package:_init (options)
trTag = SU.required(options, "trTag", "setting up table class")
tdTag = SU.required(options, "tdTag", "setting up table class")

-- This is a post init calback instead of the usual early command registration
-- This is a post init callback instead of the usual early command registration
-- method using our package loader because we don't know what commands to register
-- until we've been instantiated.
self.class:registerPostinit(function (_)
Expand Down
2 changes: 1 addition & 1 deletion src/justenoughicu.c
Expand Up @@ -311,7 +311,7 @@ int icu_collation_create(lua_State *L) {
int numericOrdering = UCOL_ON; // N.B. default is UCOL_OFF
int backwards = UCOL_OFF; // So-called 'french collation', default is UCOL_OFF
// NOT IMPLEMENTED: maxVariable punct / maxVariable space
// This affects 'alternate handling' with espect to spaces and/or punctuations
// This affects 'alternate handling' with expect to spaces and/or punctuations
// I never used it and I'm lazy - assume default is ok...
int caseFirst = UCOL_OFF; // n.B. default is UCOL_OFF
int caseLevel = UCOL_OFF; // n.B. default is UCOL_OFF
Expand Down
2 changes: 1 addition & 1 deletion tests/vertical.sil
@@ -1,7 +1,7 @@
\begin[class=jplain,layout=tate]{document}
\nofolios
% Note: differences between Noto font versions make adding more characters to
% this test brittle. For examle 日本は昔からruns into trouble when the height
% this test brittle. For example 日本は昔からruns into trouble when the height
% of 昔 is different. If the tate layout mechanism is working, it’s going
% to work at two characters, if a longer string fails, it’s likely some other
% mechanism or value that actually changed.
Expand Down
4 changes: 2 additions & 2 deletions typesetters/base.lua
Expand Up @@ -754,7 +754,7 @@ function typesetter:breakpointsToLines (breakpoints)
end
if linestart < #nodes then
-- Abnormal, but warn so that one has a chance to check which bits
-- are misssing at output.
-- are missing at output.
SU.warn("Internal typesetter error " .. (#nodes - linestart) .. " skipped nodes")
end
return lines
Expand All @@ -779,7 +779,7 @@ function typesetter.computeLineRatio (_, breakwidth, slice)
-- zero boxes, so as to reach actual content...
if slice[n].value ~= "margin" then
-- ... but any other glue than a margin, at the end of a line, is actually
-- extraneous. It will however also be accounted for below, so substract
-- extraneous. It will however also be accounted for below, so subtract
-- them to cancel their width. Typically, if a line break occurred at
-- a space, the latter is then at the end of the line now, and must be
-- ignored.
Expand Down

0 comments on commit ab665cc

Please sign in to comment.