~/bend-docscommunity

src/split.bend checks

raw source on the hub · import bend-toon-codec@0.1.0.0/src/split.bend as Split

1 import
import Base

Definitions

def sel.u source · line 7 · raw

@+b:Bool -> @+x:U32 -> @+y:U32 -> U32

Scanner state: 0 outside quotes, 1 inside, 2 inside after a backslash.

def qnext.pick source · line 14 · raw

@+st:U32 -> @+quote:Bool -> @+bslash:Bool -> U32

def qnext source · line 18 · raw

@+st:U32 -> @+c:U32 -> U32

def none source · line 22 · raw

U32

Sentinel index for "not found".

def found source · line 25 · raw

@+hit:Bool -> @+i:U32 -> @+later:U32 -> U32

def find_unq source · line 29 · raw

@+s:String -> @+target:U32 -> @+st:U32 -> @+i:U32 -> U32

Index of the first target outside quotes, or none().

def split.put source · line 37 · raw

@+c:U32 -> @+sep:Bool -> @+r:List<&2, String> -> List<&2, String>

Put a character in front of the token being built, or start a new token.

def split.go source · line 48 · raw

@+s:String -> @+d:U32 -> @+st:U32 -> List<&2, String>

def split source · line 56 · raw

@+s:String -> @+d:U32 -> List<&2, String>

Cut on the delimiter d outside quotes. Always at least one token.

def find source · line 60 · raw

@+s:String -> @+target:U32 -> @+i:U32 -> U32

Index of the first target, ignoring quotes, or none().