git.iko.soy/typeable/pandoc
on master help sign in
data/pandoc.lua: rename Element to AstElement

This avoids confusion with the Element type from Text.Pandoc.Shared. Change: minor

commita2e327f0db6be6999d575a3562007202b72153cf authorAlbert Krewinkel <albert@zeitkraut.de> dateSat 6 Jan 2018, 23:25 (9 years ago) parent5942da4
1 file changed+9−9
data/pandoc.lua+9−9
data/pandoc.lua+9−9
@@ -30,14 +30,14 @@ local List = require 'pandoc.List'
3030
3131------------------------------------------------------------------------
3232-- The base class for pandoc's AST elements.
33−-- @type Element
33+-- @type AstElement
3434-- @local
35−local Element = {}
36−Element.__index = Element
35+local AstElement = {}
36+AstElement.__index = AstElement
3737
3838--- Create a new element subtype
3939-- @local
40−function Element:make_subtype(o)
40+function AstElement:make_subtype(o)
4141 o = o or {}
4242 setmetatable(o, self)
4343 -- Make subtype usable as a metatable
@@ -47,7 +47,7 @@ end
4747
4848--- Create a new element given its tag and arguments
4949-- @local
50−function Element:new(tag, ...)
50+function AstElement:new(tag, ...)
5151 local element = { t = tag }
5252 local content = {...}
5353 -- special case for unary constructors
@@ -68,7 +68,7 @@ end
6868-- @param fn Function to be called when constructing a new element
6969-- @param accessors names to use as accessors for numerical fields
7070-- @return function that constructs a new element
71−function Element:create_constructor(tag, fn, accessors)
71+function AstElement:create_constructor(tag, fn, accessors)
7272 local constr = self:make_subtype({tag = tag, getters = {}, setters = {}})
7373
7474 -- Add accessors to the metatable
@@ -165,7 +165,7 @@ setmetatable(M.Meta, M.Meta)
165165------------------------------------------------------------------------
166166-- MetaValue
167167-- @section MetaValue
168−M.MetaValue = Element:make_subtype{}
168+M.MetaValue = AstElement:make_subtype{}
169169M.MetaValue.__call = function(t, ...)
170170 return t:new(...)
171171end
@@ -224,7 +224,7 @@ end
224224
225225--- Block elements
226226-- @type Block
227−M.Block = Element:make_subtype{}
227+M.Block = AstElement:make_subtype{}
228228M.Block.__call = function (t, ...)
229229 return t:new(...)
230230end
@@ -399,7 +399,7 @@ M.Table = M.Block:create_constructor(
399399
400400--- Inline element class
401401-- @type Inline
402−M.Inline = Element:make_subtype{}
402+M.Inline = AstElement:make_subtype{}
403403M.Inline.__call = function (t, ...)
404404 return t:new(...)
405405end