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

Bump copyright year and remove needless parentheses in file markdown-unicode-data.lua #540

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docstrip.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE^^J%
-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.^^J%
--^^J%
-- Copyright (C) 2016-2024 Vít Starý Novotný, Andrej Genčur^^J%
-- Copyright (C) 2016-2025 Vít Starý Novotný, Andrej Genčur^^J%
--^^J%
-- This work may be distributed and/or modified under the^^J%
-- conditions of the LaTeX Project Public License, either version 1.3^^J%
Expand Down Expand Up @@ -62,7 +62,7 @@
\let\luapostamble\empty
\declarepreamble\texpreamble

Copyright (C) 2016-2024 Vít Starý Novotný, Andrej Genčur
Copyright (C) 2016-2025 Vít Starý Novotný, Andrej Genčur

This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3c
Expand Down
37 changes: 20 additions & 17 deletions markdown.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -27528,17 +27528,17 @@ parsers.ascii_punctuation = S("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~")
end

print("M.punctuation = {}")
print("local S = lpeg.S")
print("local P = lpeg.P")
print("-- luacheck: push no max line length")
for length, prefix_tree in pairs(prefix_trees) do
local subparsers = {}
depth_first_search(prefix_tree, "", function(node, path)
if type(node) == "string" then
local suffix
if node == "]" then
suffix = "S('" .. node .. "')"
suffix = "P('" .. node .. "')"
else
suffix = "S([[" .. node .. "]])"
suffix = "P([[" .. node .. "]])"
end
if subparsers[path] ~= nil then
subparsers[path] = subparsers[path] .. " + " .. suffix
Expand All @@ -27550,20 +27550,23 @@ parsers.ascii_punctuation = S("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~")
if #path > 0 then
local byte = path:sub(#path, #path)
local parent_path = path:sub(1, #path-1)
if subparsers[path] ~= nil then
local suffix
if byte == "]" then
suffix = "S('" .. byte .. "')"
else
suffix = "S([[" .. byte .. "]])"
end
suffix = suffix .. " * (" .. subparsers[path] .. ")"
if subparsers[parent_path] ~= nil then
subparsers[parent_path] = subparsers[parent_path]
.. " + " .. suffix
else
subparsers[parent_path] = suffix
end
local prefix
if byte == "]" then
prefix = "P('" .. byte .. "')"
else
prefix = "P([[" .. byte .. "]])"
end
local suffix
if subparsers[path]:find(" %+ ") then
suffix = prefix .. " * (" .. subparsers[path] .. ")"
else
suffix = prefix .. " * " .. subparsers[path]
end
if subparsers[parent_path] ~= nil then
subparsers[parent_path] = subparsers[parent_path]
.. " + " .. suffix
else
subparsers[parent_path] = suffix
end
else
print("M.punctuation[" .. length .. "] = " .. subparsers[path])
Expand Down
Loading