Expected

is the set of labels carried by a ParseErr. The common case (a single failing primitive) uses One to skip a 1-element Array allocation; merged failures collected by choice use Many.

Many

instantiate

(Fn [(Array String)] Expected)

creates a Many.

One

instantiate

(Fn [String] Expected)

creates a One.

append-into

defn

(Fn [(Array String), (Ref Expected a)] (Array String))

                        (append-into acc e)
                    

drains the labels in e onto the end of acc, returning the new array. Used by Parser.choice to accumulate labels across failed alternatives without going through to-array's allocation in the One case.

copy

instantiate

(Fn [(Ref Expected a)] Expected)

copies a Expected.

delete

instantiate

(Fn [Expected] ())

deletes a Expected. This should usually not be called manually.

empty

defn

(Fn [] Expected)

                        (empty)
                    

is the empty expected-set.

get-tag

instantiate

(Fn [(Ref Expected a)] Int)

Gets the tag from a Expected.

length

defn

(Fn [(Ref Expected a)] Int)

                        (length e)
                    

number of labels in the set.

prn

instantiate

(Fn [(Ref Expected a)] String)

converts a Expected to a string.

str

instantiate

(Fn [(Ref Expected a)] String)

converts a Expected to a string.

to-array

defn

(Fn [(Ref Expected a)] (Array String))

                        (to-array e)
                    

materializes an Expected as an Array String. Allocates a 1-element array for the One case.