(index ("svnwiki->sxml" 0) ("svnwiki-signature-parser" 173) ("svnwiki-signature-parser" 173) ("svnwiki-signature->identifier" 2530))
(def (sig (procedure "(svnwiki->sxml PORT)" (id svnwiki->sxml))) (p "Reads from " (tt "PORT") " until EOF and returns an SXML representation of the parsed wiki contents."))
(def (sig (parameter "svnwiki-signature-parser" (id svnwiki-signature-parser)) (procedure "((svnwiki-signature-parser) sig type)" (id svnwiki-signature-parser))) (p "Parameter which controls if and how definition signatures are parsed during svnwiki document parsing.  A definition SXML clause looks like:") (pre "(def (sig (,type ,signature . ,alist))\n     ,body)") (p "where TYPE is the definition tag name (e.g. " (tt "procedure") ") and SIGNATURE is the contents of the definition tag.  This parameter affects the contents of ALIST.") (p "A call to " (tt "(svnwiki-signature-parser)") " takes the arguments SIGNATURE and TYPE and returns an alist of parse results, which is inserted directly into the ALIST slot.  The alist associations must be proper lists, i.e. of the format " (tt "((key val) (key val))") ", not " (tt "((key . val) (key . val))") ".  Currently, the only defined alist key is " (tt "id") ", whose value is the identifier used to describe this signature. If a null alist is returned, it indicates the signature parser has punted on parsing and is leaving it up to the user.") (p "As a special case, if this procedure returns anything other than an alist -- such as a symbol or " (tt "#f") " -- it will be considered an identifier, and converted into the single-key alist " (tt "((id VAL))") ".") (p "Typically, you would use " (tt "svnwiki-signature->identifier") " as the value of this parameter.") (p "This parameter defaults to " (tt "(constantly '())") ", the null alist signalling to the SXML document user that no signature parsing was attempted during document parsing.") (p (b "Examples") ".  By default a null alist is returned, indicating no signature parsing was attempted:") (pre "(def (sig (procedure \"(foo bar)\"))\n     \"This foos bar.\")") (p "With the parameter set to " (tt "svnwiki-signature->identifier") " it will extract operators from procedures and so on;") (pre "(def (sig (procedure \"(foo bar)\" (id foo)))\n     \"This also foos bar.\")") (p "And since the signature below can't be parsed by " (tt "svnwiki-signature->identifier") ", an " (tt "#f") " value is left in the " (tt "id") " to indicate parsing was attempted but failed. The user can try to re-parse if desired.") (pre "(def (sig (procedure \"(foo | bar)\" (id #f)))\n     \"Tries to foo bar, but the embedded pipe confuses the reader.\")"))
(def (sig (procedure "(svnwiki-signature->identifier sig type)" (id svnwiki-signature->identifier))) (p "Conventional parser for definition signatures as written in Chicken svnwiki documents.  Converts a signature string (usually a list or bare identifier) into an identifier.  Returns a symbol, a string, or #f.") (p (b "Operation.") "  We read the string with the scheme reader.  If a list, take the car recursively.  If a symbol, return the symbol.  If any other scheme object, return the whole signature string.  If it cannot be read as a scheme expression, return #f.  As a special case, read syntax (type " (i "read") ") returns the entire signature without trying to read it first; note this may cause a problem with older Chicken versions due to read/write variance on symbols starting with #.  Also note that results of parsing a keyword identifier are, at this time, undefined."))
