Files
Basalt2/tools/BasaltDoc/parsers/classParser.lua
Robert Jelic 6f14eadf0a - Updated DocsGenerator to support run code and item tables
- Updated Table to support new Collection System (could break things, sorry)
- Updated Tree to support new Collection System
- Added experimental ScrollFrame
- Updated Menu to support Collection System
2025-10-29 17:55:29 +01:00

35 lines
875 B
Lua

local helper = require("utils.helper")
local logger = require("utils.logger")
local classParser = {}
function classParser.parse(annotations, line)
local classLine = helper.findAnnotationLine(annotations, "class")
if not classLine then
return nil
end
local name, extends = classLine:match("^%-%-%-?%s*@class%s*([%w_%.]+)%s*:?%s*([%w_%.]*)")
local class = {
type = "class",
name = name,
extends = extends ~= "" and extends or nil,
description = nil,
properties = {},
events = {},
functions = {},
tableTypes = {},
skip = false
}
if classParser.handlers then
helper.applyAnnotations(annotations, class, classParser.handlers)
end
return class
end
function classParser.setHandlers(handlers)
classParser.handlers = handlers
end
return classParser