cortav  Check-in [c50482b020]

Overview
Comment:beginning to hack in fixes to the hideously broken refid resolver
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c50482b020228959e5c60d1dc5421242dce90d71d3190931fdbf8755538ce4ec
User & Date: lexi on 2022-09-30 21:15:02
Other Links: manifest | tags
Context
2022-12-14
08:43
add workaround for broken luac check-in: f673b2abfe user: lexi tags: trunk
2022-09-30
21:15
beginning to hack in fixes to the hideously broken refid resolver check-in: c50482b020 user: lexi tags: trunk
20:15
let the flayings commence check-in: 89a6dd28ef user: lexi tags: trunk
Changes

Modified cortav.lua from [ea1fbe20dd] to [49893a127f].

   177    177   					end
   178    178   				end
   179    179   			end
   180    180   
   181    181   			local function scanParents(doc)
   182    182   				for i, p in ipairs(doc.parents) do
   183    183   					-- TODO figure out a way to ref the embedding section
   184         -					local o,i,s = checkFromSec(nil, p)
          184  +					local o,i,s = checkFromSec(doc.defined_in_parent_section, p)
   185    185   					if o or s then return o,i,s end
   186    186   				end
   187    187   				-- breadth-first search
   188    188   				for i, p in ipairs(doc.parents) do
   189    189   					local o,i,s = scanParents(p)
   190    190   					if o or s then return o,i,s end
   191    191   				end
................................................................................
   211    211   					end
   212    212   				end
   213    213   			end
   214    214   
   215    215   			o,i,s = scanParents(self.doc)
   216    216   			if o or s then return o,i,s end
   217    217   
   218         -			self:fail("ID ā€œ%sā€ does not name an object or section", id)
          218  +			self:fail("ID ā€œ%sā€ does not name an object or section %s", id, self.invocation or "NIL")
   219    219   		end
   220    220   	};
   221    221   }
   222    222   
   223    223   ct.sec = declare {
   224    224   	ident = 'section';
   225    225   	mk = function() return {
................................................................................
   342    342   			-- sets up a doc/ctx pair for a subdocument embedded in the source
   343    343   			-- of a gretaer document, pointing subdoc props to global tables/values
   344    344   			local newdoc = ct.doc.mk(self)
   345    345   			newdoc.meta = self.meta
   346    346   			newdoc.ext = self.ext
   347    347   			newdoc.enc = self.enc
   348    348   			newdoc.stage = self.stage
          349  +			newdoc.defined_in_parent_section = ctx.sec
   349    350   			-- vars are handled through proper recursion across all parents and
   350    351   			-- are intentionally excluded here; subdocs can have their own vars
   351    352   			-- without losing access to parent vars
   352    353   			local nctx = ctx:clone()
   353    354   			nctx:init(newdoc, ctx.src)
   354    355   			nctx.line = ctx.line
   355    356   			nctx.docDepth = (ctx.docDepth or 0) + ctx.sec.depth - 1

Modified render/html.lua from [cebff10c4b] to [e9754e6e72].

   770    770   		end
   771    771   
   772    772   		span_renderers['line-break'] = function(sp,b,s)
   773    773   			return elt('br')
   774    774   		end
   775    775   
   776    776   		function span_renderers.macro(m,b,s)
   777         -			local macroname = plainrdr.htmlSpan(
   778         -				ct.parse_span(m.macro, b.origin), b,s)
   779         -			local r = b.origin:ref(macroname)
          777  +-- 			local macroname = plainrdr.htmlSpan(
          778  +-- 				ct.parse_span(m.macro, b.origin), b,s)
          779  +			local r = b.origin:ref(m.macro)
   780    780   			if type(r) ~= 'string' then
   781    781   				b.origin:fail('%s is an object, not a reference', r.id)
   782    782   			end
   783    783   			local mctx = b.origin:clone()
   784    784   			mctx.invocation = m
   785    785   			local ir = ct.parse_span(r, mctx)
   786    786   			-- even though this happens at render time, it really shouldn't;