Verified Commit 92aa3a03 authored by Camil Staps's avatar Camil Staps 🚀

Index module documentation

parent 7e33153f
......@@ -35,14 +35,15 @@ from syntax import :: ClassDef{class_args,class_context,class_ident,class_pos},
:: GenericDef{gen_ident,gen_pos,gen_type,gen_vars},
:: Ident{id_name,id_info}, :: LineNr, :: Module{mod_defs,mod_ident},
:: Optional(Yes,No), :: SymbolPtr, :: Ptr, :: SymbolTableEntry{ste_doc},
:: ParsedDefinition(PD_Class,PD_Derive,PD_Function,PD_Generic,PD_Instance,PD_Instances,PD_Type,PD_TypeSpec),
:: ParsedDefinition(PD_Class,PD_Derive,PD_Function,PD_Generic,PD_Instance,
PD_Instances,PD_Type,PD_TypeSpec,PD_Documentation),
:: ParsedExpr, :: ParsedInstance{pi_ident,pi_pos,pi_types},
:: ParsedInstanceAndMembers{pim_pi}, :: ParsedModule, :: ParsedTypeDef,
:: Position(FunPos,LinePos,NoPos), :: Priority, :: Rhs, :: ATypeVar,
:: RhsDefsOfType(ConsList,ExtensibleConses,SelectorList,TypeSpec,EmptyRhs),
:: SymbolTable, :: SymbolTableEntry, :: SymbolType, :: Type, :: BITVECT,
:: TypeContext, :: TypeDef{td_ident,td_pos,td_rhs}, :: TypeVar,
:: ParsedConstructor{pc_doc}, :: ParsedSelector{ps_doc},
:: ParsedConstructor{pc_doc}, :: ParsedSelector{ps_doc}, :: DocType,
:: OptionalDoc
import CoclUtils
......@@ -51,7 +52,8 @@ from Type import instance == Type,
class print(print), instance print Type, instance print Priority
import qualified TypeDB as DB
from TypeDB import :: Macro{macro_as_string,macro_extras},
:: Location(Location), filterLocations, :: ModuleInfo{is_core},
:: Location(Location), filterLocations,
:: ModuleInfo{is_core,mod_documentation},
:: TypeExtras{te_generic_vars,te_isconstructor,te_isrecordfield,te_priority,te_representation,te_documentation},
instance zero TypeExtras, instance zero ModuleInfo
from Doc import :: Documentation(FunctionDoc), :: ResultDoc, :: VarDoc,
......@@ -59,7 +61,7 @@ from Doc import :: Documentation(FunctionDoc), :: ResultDoc, :: VarDoc,
:: ParseWarning(UsedReturn), :: ParseError(IllegalState),
parseFunctionDoc, parseConstructorDoc, parseADTypeDoc, parseRecordTypeDoc,
parseSynonymTypeDoc, parseAbstractTypeDoc, parseFieldDoc, parseClassDoc,
traceParseError, traceParseWarnings, getTypeRhsDoc
parseModuleDoc, traceParseError, traceParseWarnings, getTypeRhsDoc
// Exclude Root Library Check for core Base module
findModules :: ![String] !String !'DB'.Library ('DB'.Module -> Bool) !String !*World
......@@ -105,7 +107,7 @@ getModuleTypes root mod lib iscore db w
# db = 'DB'.putFunctions (pd_generics lib modname dcl.mod_defs icl symbols) db
# db = 'DB'.putDerivationss (pd_derivations lib modname dcl.mod_defs) db
# db = 'DB'.putMacros (pd_macros lib modname dcl.mod_defs symbols) db
# db = 'DB'.putModule lib modname {zero & is_core=iscore} db
# db = 'DB'.putModule lib modname (pd_module iscore dcl.mod_defs) db
= (db,w)
where
filterFun :: 'DB'.Module 'DB'.Library Location -> Bool
......@@ -115,6 +117,14 @@ where
mkdir :: String -> String
mkdir s = { if (c == '.') '/' c \\ c <-: s }
pd_module :: Bool [ParsedDefinition] -> ModuleInfo
pd_module iscore [PD_Documentation _ doc:_]
= { pd_module iscore []
& mod_documentation = docParseResultToMaybe $ parseModuleDoc doc
}
pd_module iscore _
= { zero & is_core = iscore }
pd_macros :: String String [ParsedDefinition] SymbolTable
-> [('DB'.Location, 'DB'.Macro)]
pd_macros lib mod dcl st
......
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