Commit 4ae138cb authored by Mart Lubbers's avatar Mart Lubbers

Add support for the throw documentation

parent 2b6da6e6
......@@ -17,6 +17,7 @@ class docParams d :: !d -> [Description]
class docVars d :: !d -> [Description]
class docResults d :: !d -> [Description]
class docType d :: !d -> Maybe Type
class docThrows d :: !d -> [Description]
class docMembers d :: !d -> [Maybe ClassMemberDoc]
class docFields d :: !d -> Maybe [Maybe Description]
class docConstructors d :: !d -> Maybe [Maybe ConstructorDoc]
......@@ -41,6 +42,7 @@ derive gDefault ModuleDoc
, vars :: [Description] //* Descriptions of the type variables (for generics)
, results :: [Description] //* Descriptions of the result(s, for tuples)
, type :: Maybe Type //* The type (for macros)
, throws :: [Description] //* The exceptions it may throw (iTasks)
}
instance docDescription FunctionDoc
......@@ -48,6 +50,7 @@ instance docParams FunctionDoc
instance docVars FunctionDoc
instance docResults FunctionDoc
instance docType FunctionDoc
instance docThrows FunctionDoc
derive gDefault FunctionDoc
/**
......@@ -59,12 +62,14 @@ derive gDefault FunctionDoc
, params :: [Description]
, results :: [Description]
, type :: Maybe Type
, throws :: [Description]
}
instance docDescription ClassMemberDoc
instance docParams ClassMemberDoc
instance docResults ClassMemberDoc
instance docType ClassMemberDoc
instance docThrows ClassMemberDoc
derive gDefault ClassMemberDoc
/**
......
......@@ -32,11 +32,13 @@ instance docParams FunctionDoc where docParams d = d.FunctionDoc.param
instance docVars FunctionDoc where docVars d = d.FunctionDoc.vars
instance docResults FunctionDoc where docResults d = d.FunctionDoc.results
instance docType FunctionDoc where docType d = d.FunctionDoc.type
instance docThrows FunctionDoc where docThrows d = d.FunctionDoc.throws
instance docDescription ClassMemberDoc where docDescription d = d.ClassMemberDoc.description
instance docParams ClassMemberDoc where docParams d = d.ClassMemberDoc.params
instance docResults ClassMemberDoc where docResults d = d.ClassMemberDoc.results
instance docType ClassMemberDoc where docType d = d.ClassMemberDoc.type
instance docThrows ClassMemberDoc where docThrows d = d.ClassMemberDoc.throws
instance docDescription ConstructorDoc where docDescription d = d.ConstructorDoc.description
instance docParams ConstructorDoc where docParams d = d.ConstructorDoc.params
......@@ -69,6 +71,7 @@ functionToClassMemberDoc d =
, params = d.FunctionDoc.params
, results = d.FunctionDoc.results
, type = d.FunctionDoc.type
, throws = d.FunctionDoc.throws
}
addClassMemberDoc :: !ClassDoc !(Maybe ClassMemberDoc) -> ClassDoc
......
......@@ -133,6 +133,7 @@ makeResult orgsearchtype allsyns usedsyns (entry, annots) db
, generic_var_doc = docVars <$> fe.fe_documentation
, result_doc = docResults <$> fe.fe_documentation
, type_doc = concat <$> print False <$> (docType =<< fe.fe_documentation)
, throws_doc = docThrows <$> fe.fe_documentation
}), db)
with
toStrUnifier :: Unifier -> StrUnifier
......
Subproject commit ffd6cfa0a8d6913c30b3fee9fe70ebaa596940b5
Subproject commit cc4936239bdad7788a6bee1beeb6638f2b1e34a7
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment