aboutsummaryrefslogtreecommitdiff
path: root/data/pandoc.lua
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2018-01-06 23:25:08 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2018-01-06 23:25:08 +0100
commita2e327f0db6be6999d575a3562007202b72153cf (patch)
tree9062d3d4e29b6e97a773bd1e49ca080b257b6685 /data/pandoc.lua
parent5942da4ff70ec47054032f334194c38e1c9e1c6d (diff)
downloadpandoc-a2e327f0db6be6999d575a3562007202b72153cf.tar.gz
data/pandoc.lua: rename Element to AstElement
This avoids confusion with the Element type from Text.Pandoc.Shared. Change: minor
Diffstat (limited to 'data/pandoc.lua')
-rw-r--r--data/pandoc.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/data/pandoc.lua b/data/pandoc.lua
index 68fd16fd4..f6484f05e 100644
--- a/data/pandoc.lua
+++ b/data/pandoc.lua
@@ -30,14 +30,14 @@ local List = require 'pandoc.List'
------------------------------------------------------------------------
-- The base class for pandoc's AST elements.
--- @type Element
+-- @type AstElement
-- @local
-local Element = {}
-Element.__index = Element
+local AstElement = {}
+AstElement.__index = AstElement
--- Create a new element subtype
-- @local
-function Element:make_subtype(o)
+function AstElement:make_subtype(o)
o = o or {}
setmetatable(o, self)
-- Make subtype usable as a metatable
@@ -47,7 +47,7 @@ end
--- Create a new element given its tag and arguments
-- @local
-function Element:new(tag, ...)
+function AstElement:new(tag, ...)
local element = { t = tag }
local content = {...}
-- special case for unary constructors
@@ -68,7 +68,7 @@ end
-- @param fn Function to be called when constructing a new element
-- @param accessors names to use as accessors for numerical fields
-- @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 = {}})
-- Add accessors to the metatable
@@ -165,7 +165,7 @@ setmetatable(M.Meta, M.Meta)
------------------------------------------------------------------------
-- MetaValue
-- @section MetaValue
-M.MetaValue = Element:make_subtype{}
+M.MetaValue = AstElement:make_subtype{}
M.MetaValue.__call = function(t, ...)
return t:new(...)
end
@@ -224,7 +224,7 @@ end
--- Block elements
-- @type Block
-M.Block = Element:make_subtype{}
+M.Block = AstElement:make_subtype{}
M.Block.__call = function (t, ...)
return t:new(...)
end
@@ -399,7 +399,7 @@ M.Table = M.Block:create_constructor(
--- Inline element class
-- @type Inline
-M.Inline = Element:make_subtype{}
+M.Inline = AstElement:make_subtype{}
M.Inline.__call = function (t, ...)
return t:new(...)
end