2017-08-27

(sph lang indent-syntax)

part of sph-lib

see also indent-based syntax

import name

(sph lang indent-syntax)

exports

denoted-tree->indent-tree

procedure

signature

a [base-depth indent-string] ->

((integer:indent . string:line-content) ...) [integer string] -> string

denoted-tree->indent-tree-lines

procedure

signature

a [base-depth indent-string] ->

indent-tree->denoted-tree

procedure

signature

a [indent-width] ->

indent-tree->prefix-tree

procedure

signature

a [indent-width] ->

indent-tree->range-delimited-tree

procedure

signature

a indent-char indent-width start-delimiter end-delimiter ->

string char/char-set/procedure integer string string -> string

description

convert from indent syntax to one where nesting is specified by a pair of strings

for start and end of a range

line->indent-and-content

procedure

signature

a indent-width ->

string integer -> (integer string)

prefix-tree->indent-tree

procedure

signature

a [base-depth indent-string] ->

list:(string/list ...) -> string

description

converts a list to a string of indented lines with indent corresponding to nesting depth

prefix-tree-text

procedure

signature

source ->

(string/list ...) -> string

description

convert a list with strings and eventually sub-lists with strings to an indented document structure.

normalise indent from multiline string literals

read-indent-tree->denoted-tree

procedure

signature

port [indent-width] ->

port [integer] -> list:((integer:indent . string:line-content) ...)

description

approximates indent-width to the next higher indent depth if it is not a multiple of indent-width.

empty lines are parsed as an empty string with the indent-depth of the following expression,

or zero if there are no following expressions

read-indent-tree->prefix-tree

procedure

signature

a ... ->

same arguments as read-indent-tree ->

description

denoted-tree

read-indent-tree-element->denoted-tree

procedure

signature

port [indent-width] ->

port [integer] -> list

description

assumes that unread-string works on the port

string->indent-depth

procedure

signature

a indent-width ->

string integer -> integer


tags: programming guile documentation library scheme sph-lib lang-indent-syntax sph-lang-indent-syntax