--- Extracts summary information from a description. The first sentence of each
--- doc comment should be a summary sentence, containing a concise but complete
--- description of the item. It is important to write crisp and informative
+-- Checks if the line contains a constant definition
+-- @param line string with line text
+-- @return constant information or nil if no constant definition found
+
+local function check_constant (line)
+ line = util.trim(line)
+
+ local info = table.foreachi(constant_patterns, function (_, pattern)
+ local r, _, l, id = string.find(line, pattern)
+ if r ~= nil then
+ return {
+ name = id,
+ private = (l == "local"),
+ }
+ end
+ end)
+
+ -- TODO: remove these assert's?
+ if info ~= nil then
+ assert(info.name, "constant name undefined")
+ end
+
+ return info
+end
+
+-------------------------------------------------------------------------------
+-- Extracts summary information from a description. The first sentence of each
+-- doc comment should be a summary sentence, containing a concise but complete
+-- description of the item. It is important to write crisp and informative