Skip to content

Commit

Permalink
cosmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
hansonchar committed Jun 18, 2024
1 parent 636fb5e commit cce90de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions doc/generic/pgf/lib/examplefinder.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
local lpeg = require("lpeg")
local C, Ct, P, V = lpeg.C, lpeg.Ct, lpeg.P, lpeg.V

local t = {}
local finder = {}

-- Grammar to extract code from function call to "example" with a string parameter
t.grammar =
finder.grammar =
P {
"example",
begincodeexample = P "\n" ^ -1 * "example\n[[",
Expand All @@ -15,16 +15,16 @@ t.grammar =
example = V "anything" * Ct(V "codeexample" * (V "anything" * V "codeexample") ^ 0) * V "anything"
}

function t.get_options(_)
function finder.get_options(_)
return {}
end

function t.get_content(e)
function finder.get_content(e)
return e[1]
end

function t.get_name()
function finder.get_name()
return "example"
end

return t
return finder
6 changes: 3 additions & 3 deletions doc/generic/pgf/lib/stringmatcher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local SP = loc.space ^ 0 -- spaces

-- Used to match a string which can be single-quoted, double-quoted or multi-line
-- surrounded by inside double square brackets.
local string_matcher =
local matcher =
P {
"str",
single_quoted = SP * "'" * C(((1 - P "'") + "\\'") ^ 0) * "'",
Expand All @@ -17,7 +17,7 @@ local string_matcher =
}

if not UNIT_TESTING then
return string_matcher
return matcher
end

-- Unit tests and debugging
Expand Down Expand Up @@ -74,7 +74,7 @@ local test_strings = {
for _, s in ipairs(test_strings) do
-- local match = lpeg.match(general_str, s)
-- local match = general_str:match(s)
local match = string_matcher:match(s)
local match = matcher:match(s)
if match then
print("Match found: " .. match)
else
Expand Down

0 comments on commit cce90de

Please sign in to comment.