From e4297cd043eff83941673f8b414a2020872e53f3 Mon Sep 17 00:00:00 2001 From: Hanson Char Date: Wed, 19 Jun 2024 22:39:00 -0700 Subject: [PATCH] ditto - fix get_content in singleexamplesfinder --- doc/generic/pgf/extract.lua | 6 ++++++ doc/generic/pgf/lib/singleexamplesfinder.lua | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/generic/pgf/extract.lua b/doc/generic/pgf/extract.lua index 1775a678c..7464955bf 100644 --- a/doc/generic/pgf/extract.lua +++ b/doc/generic/pgf/extract.lua @@ -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 @@ -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) diff --git a/doc/generic/pgf/lib/singleexamplesfinder.lua b/doc/generic/pgf/lib/singleexamplesfinder.lua index cd2505cc9..9f82cbcff 100644 --- a/doc/generic/pgf/lib/singleexamplesfinder.lua +++ b/doc/generic/pgf/lib/singleexamplesfinder.lua @@ -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 = {} @@ -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()