data/pandoc.lua: rename Element to AstElement
This avoids confusion with the Element type from Text.Pandoc.Shared. Change: minor
This commit is contained in:
parent
5942da4ff7
commit
a2e327f0db
1 changed files with 9 additions and 9 deletions
|
@ -30,14 +30,14 @@ local List = require 'pandoc.List'
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
-- The base class for pandoc's AST elements.
|
-- The base class for pandoc's AST elements.
|
||||||
-- @type Element
|
-- @type AstElement
|
||||||
-- @local
|
-- @local
|
||||||
local Element = {}
|
local AstElement = {}
|
||||||
Element.__index = Element
|
AstElement.__index = AstElement
|
||||||
|
|
||||||
--- Create a new element subtype
|
--- Create a new element subtype
|
||||||
-- @local
|
-- @local
|
||||||
function Element:make_subtype(o)
|
function AstElement:make_subtype(o)
|
||||||
o = o or {}
|
o = o or {}
|
||||||
setmetatable(o, self)
|
setmetatable(o, self)
|
||||||
-- Make subtype usable as a metatable
|
-- Make subtype usable as a metatable
|
||||||
|
@ -47,7 +47,7 @@ end
|
||||||
|
|
||||||
--- Create a new element given its tag and arguments
|
--- Create a new element given its tag and arguments
|
||||||
-- @local
|
-- @local
|
||||||
function Element:new(tag, ...)
|
function AstElement:new(tag, ...)
|
||||||
local element = { t = tag }
|
local element = { t = tag }
|
||||||
local content = {...}
|
local content = {...}
|
||||||
-- special case for unary constructors
|
-- special case for unary constructors
|
||||||
|
@ -68,7 +68,7 @@ end
|
||||||
-- @param fn Function to be called when constructing a new element
|
-- @param fn Function to be called when constructing a new element
|
||||||
-- @param accessors names to use as accessors for numerical fields
|
-- @param accessors names to use as accessors for numerical fields
|
||||||
-- @return function that constructs a new element
|
-- @return function that constructs a new element
|
||||||
function Element:create_constructor(tag, fn, accessors)
|
function AstElement:create_constructor(tag, fn, accessors)
|
||||||
local constr = self:make_subtype({tag = tag, getters = {}, setters = {}})
|
local constr = self:make_subtype({tag = tag, getters = {}, setters = {}})
|
||||||
|
|
||||||
-- Add accessors to the metatable
|
-- Add accessors to the metatable
|
||||||
|
@ -165,7 +165,7 @@ setmetatable(M.Meta, M.Meta)
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
-- MetaValue
|
-- MetaValue
|
||||||
-- @section MetaValue
|
-- @section MetaValue
|
||||||
M.MetaValue = Element:make_subtype{}
|
M.MetaValue = AstElement:make_subtype{}
|
||||||
M.MetaValue.__call = function(t, ...)
|
M.MetaValue.__call = function(t, ...)
|
||||||
return t:new(...)
|
return t:new(...)
|
||||||
end
|
end
|
||||||
|
@ -224,7 +224,7 @@ end
|
||||||
|
|
||||||
--- Block elements
|
--- Block elements
|
||||||
-- @type Block
|
-- @type Block
|
||||||
M.Block = Element:make_subtype{}
|
M.Block = AstElement:make_subtype{}
|
||||||
M.Block.__call = function (t, ...)
|
M.Block.__call = function (t, ...)
|
||||||
return t:new(...)
|
return t:new(...)
|
||||||
end
|
end
|
||||||
|
@ -399,7 +399,7 @@ M.Table = M.Block:create_constructor(
|
||||||
|
|
||||||
--- Inline element class
|
--- Inline element class
|
||||||
-- @type Inline
|
-- @type Inline
|
||||||
M.Inline = Element:make_subtype{}
|
M.Inline = AstElement:make_subtype{}
|
||||||
M.Inline.__call = function (t, ...)
|
M.Inline.__call = function (t, ...)
|
||||||
return t:new(...)
|
return t:new(...)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue