Skip to content

Commit

Permalink
ditto - fix get_content in singleexamplesfinder
Browse files Browse the repository at this point in the history
  • Loading branch information
hansonchar committed Jun 20, 2024
1 parent 2c8bccf commit e4297cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions doc/generic/pgf/extract.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ local examplefinder = require "examplefinder"
local exoptfinder = require "examplewithoptionfinder"
local examplesfinder = require "examplesfinder"
local examplescasfinder = require "examplescasfinder"
local singleexamplesfinder = require "singleexamplesfinder"

local DEBUG = false

Expand Down Expand Up @@ -64,5 +65,10 @@ for n = 1, #arg - 1 do
utils.walk(arg[n], arg[#arg], examplescasfinder)
end

-- Extract code exmples from examples being assigned as a single string
for n = 1, #arg - 1 do
utils.walk(arg[n], arg[#arg], singleexamplesfinder)
end

-- utils.walk("/Users/hchar/tmp/from", "/Users/hchar/tmp/mwe", exoptfinder)
os.exit(0)
4 changes: 2 additions & 2 deletions doc/generic/pgf/lib/singleexamplesfinder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ local loc = lpeg.locale()
local u = require("utils")
local SP = u.SP
local str = require("stringmatcher")
local C, Ct, P, V = lpeg.C, lpeg.Ct, lpeg.P, lpeg.V
local Ct, P, V = lpeg.Ct, lpeg.P, lpeg.V

local finder = {}

Expand All @@ -42,7 +42,7 @@ end

function finder.get_content(s)
assert(type(s) == "string")
return s
return u.get_string(s)
end

function finder.get_name()
Expand Down

0 comments on commit e4297cd

Please sign in to comment.