Differences From
Artifact [3e270c2a7b]:
1 1 -- [ʞ] cortav.lua
2 2 -- ~ lexi hale <lexi@hale.su>
3 3 -- © EUPL v1.2
4 4 -- ? reference implementation of the cortav document language
5 +-- \ from Ranuir "written document"
5 6 --
6 7 -- ! TODO refactor encoding logic. it's a complete
7 8 -- mess and i seem to have repeatedly gotten
8 9 -- confused about how it's supposed to work.
9 10 -- the whole shitshow needs to be replaced
10 11 -- with a clean, simple paradigm: documents
11 12 -- are translated to UTF8 on the way in, and
................................................................................
116 117 new.generation = old.generation + 1
117 118 else
118 119 new.generation = 1
119 120 end
120 121 end;
121 122 fns = {
122 123 fail = function(self, msg, ...)
123 - --error(string.format(msg,...))
124 + -- error(string.format(msg,...))
124 125 ct.exns.tx(msg, self.src.file, self.line or 0, ...):throw()
125 126 end;
126 127 insert = function(self, block)
127 128 block.origin = self:clone()
128 129 table.insert(self.sec.blocks,block)
129 130 return block
130 131 end;
................................................................................
358 359 end;
359 360 job = function(self, name, pred, ...) -- convenience func
360 361 return self.docjob:fork(name, pred, ...)
361 362 end;
362 363 sub = function(self, ctx)
363 364 -- convenience function for single-inheritance structure
364 365 -- sets up a doc/ctx pair for a subdocument embedded in the source
365 - -- of a gretaer document, pointing subdoc props to global tables/values
366 + -- of a greater document, pointing subdoc props to global tables/values
366 367 local newdoc = ct.doc.mk(self)
367 368 newdoc.meta = self.meta
368 369 newdoc.ext = self.ext
369 370 newdoc.enc = self.enc
370 371 newdoc.stage = self.stage
371 372 newdoc.defined_in_parent_section = ctx.sec
372 373 -- vars are handled through proper recursion across all parents and