src/dline.bend checks
raw source on the hub · import bend-toon-codec@0.1.0.0/src/dline.bend as Dline
2 imports
import Base import ./head.bend as Hd
Types
type DL source · line 6 · raw
Data
DL@no:U32 -> @depth:U32 -> @text:String -> @blank:Bool -> DL
type Ld source · line 10 · raw
Data
Leading spaces and tabs counted, and what follows them.
Ld@sp:U32 -> @tabs:U32 -> @rest:String -> Ld
Definitions
def lead.pick source · line 13 · raw
@+go:Bool -> @+s:String -> @+sp:U32 -> @+tabs:U32 -> @+r:Ld -> Ld
def inc source · line 20 · raw
@+b:Bool -> U32
def lead source · line 30 · raw
@+s:String -> @+sp:U32 -> @+tabs:U32 -> @+live:Bool -> Ld
Count the leading spaces and tabs. live is true until the first other
character; the recursion runs to the end of the line but only counts
while live.
def at source · line 38 · raw
@+no:U32 -> @+m:String -> String
def blank source · line 41 · raw
@+no:U32 -> Result<&2, &2, String, DL>
def depth.pick source · line 47 · raw
@+bad_tab:Bool -> @+bad_mult:Bool -> @+no:U32 -> @+depth:U32 -> @+text:String -> Result<&2, &2, String, DL>
Depth is spaces divided by the indent size. Strict mode refuses tabs in the indentation and a count that is not a multiple. Lenient mode floors the count and reads each leading tab as one indent level.
def make.nonblank source · line 56 · raw
@+no:U32 -> @+l:Ld -> @+size:U32 -> @+strict:Bool -> Result<&2, &2, String, DL>
def make.pick source · line 62 · raw
@+isblank:Bool -> @+no:U32 -> @+l:Ld -> @+size:U32 -> @+strict:Bool -> Result<&2, &2, String, DL>
def make.of source · line 69 · raw
@+no:U32 -> @+l:Ld -> @+size:U32 -> @+strict:Bool -> Result<&2, &2, String, DL>
def make source · line 74 · raw
@+no:U32 -> @+line:String -> @+size:U32 -> @+strict:Bool -> Result<&2, &2, String, DL>
def prep.cons source · line 77 · raw
@+r:Result<&2, &2, String, DL> -> @+rest:Result<&2, &2, String, List<&2, DL>> -> Result<&2, &2, String, List<&2, DL>>
def prep.go source · line 86 · raw
@+lines:List<&2, String> -> @+no:U32 -> @+size:U32 -> @+strict:Bool -> Result<&2, &2, String, List<&2, DL>>
def size.of source · line 93 · raw
@+n:U32 -> U32
def prep source · line 97 · raw
@+src:String -> @+size:U32 -> @+strict:Bool -> Result<&2, &2, String, List<&2, DL>>
Split on LF and number the lines from 1.