Consts
defaultParamSeparator = ","
- Source Edit
typeToStr: array[TTypeKind, string] = ["None", "bool", "char", "empty", "Alias", "typeof(nil)", "untyped", "typed", "typeDesc", "GenericInvocation", "GenericBody", "GenericInst", "GenericParam", "distinct $1", "enum", "ordinal[$1]", "array[$1, $2]", "object", "tuple", "set[$1]", "range[$1]", "ptr ", "ref ", "var ", "seq[$1]", "proc", "pointer", "OpenArray[$1]", "string", "cstring", "Forward", "int", "int8", "int16", "int32", "int64", "float", "float32", "float64", "uint", "uint8", "uint16", "uint32", "uint64", "sink", "lent ", "varargs[$1]", "UncheckedArray[$1]", "Error Type", "BuiltInTypeClass", "UserTypeClass", "UserTypeClassInst", "CompositeTypeClass", "inferred", "and", "or", "not", "any", "static", "TypeFromExpr", "void"]
- Source Edit
Procs
proc addTypeHeader(result: var string; conf: ConfigRef; typ: PType; prefer: TPreferedDesc = preferMixed; getDeclarationPath = true) {. ...raises: [Exception, ValueError, KeyError], tags: [RootEffect, ReadDirEffect].}
- Calls typeToString on given typ. If getDeclarationPath is true, it will add the declared location. Source Edit
proc renderParamTypes(n: PNode; sep = defaultParamSeparator): string {. ...raises: [Exception, KeyError], tags: [RootEffect].}
-
Returns the types contained in n joined by sep.
This proc expects to be passed as n the parameters of any callable. The string output is meant for the HTML renderer. If there are no parameters, the empty string is returned. The parameters will be joined by sep but other characters may appear too, like [] or |.
Source Edit proc renderPlainSymbolName(n: PNode): string {....raises: [], tags: [].}
-
Returns the first non '*' nkIdent node from the tree.
Use this on documentation name nodes to extract the raw symbol name, without decorations, parameters, or anything. That can be used as the base for the HTML hyperlinks.
Source Edit proc typeToString(typ: PType; prefer: TPreferedDesc = preferName): string {. ...raises: [Exception, KeyError, ValueError], tags: [RootEffect].}
- Formats types to strings Source Edit