2021-02-05

(sph lang scm-format format)

formatters for individual expressions

part of sph-lib

module name

(sph lang scm-format format)

exported bindings

procedure: format-application a config current-indent ->
list hashtable integer -> string
format the standard list application form. example (append a b)
procedure: format-docstring a offset-doublequote indent-string current-indent ->
string hashtable integer -> string
parses a string and removes outside string indent from using newlines in a continuous string that is indented.
adds current indent to all lines except the first.
since old-indent is not available here, old-indent is guessed from the second line.
if the second line is indented relative to the first line, this indent will unfortunately be removed for all lines
procedure: format-hash-bang a recurse config current-indent ->
procedure: format-lambda a recurse config current-indent ->
procedure: format-let a recurse config current-indent ->
procedure: format-library a recurse config current-indent ->
list procedure hashtable integer -> string
procedure: format-list a config current-indent start middle end ->
helper that customises config start/middle/end
procedure: format-list-assoc a recurse config current-indent ->
procedure: format-list-f start mid end ->
integer integer integer -> procedure:{any:expression recurse config indent -> (result false)}
return a function for descend-prefix ->
format-f that formats a list with the given start/mid/end expression distribution
procedure: format-quasiquote a ... ->
procedure: format-quasisyntax a ... ->
procedure: format-quote a ... ->
procedure: format-range-comment a recurse config current-indent ->
procedure: format-scsh-block-comment a recurse config current-indent ->
procedure: format-semicolon-comment a recurse config current-indent ->
procedure: format-string a rest ... ->
procedure: format-syntax a ... ->
procedure: format-test-module a recurse config current-indent ->
list procedure hashtable integer -> string
procedure: format-unquote a ... ->
procedure: format-unsyntax a ... ->
procedure: string-join-with-vertical-spacing a indent vertical-spacing vertical-spacing-oneline ->
(string ...) string string string -> string
join expressions eventually with empty lines inbetween them