entities.bend checks
raw source on the hub · import element-html@0.1.0.0/entities.bend as Entities
2 imports
import Base import ./entity_table.bend as Tab
Types
type Step source · line 83 · raw
Data
What a reference turned into (reversed, to prepend to the output) and the text after it.
Step@out:List<&2, Char> -> @rest:String -> Step
type Named source · line 102 · raw
Data
Named@name:String -> @cps:List<&2, U32> -> Named
type Rec source · line 129 · raw
Data
One packed record at the head of ws: its name, code points, and the rest.
Rec@name:String -> @cps:List<&2, U32> -> @rest:List<&2, U32> -> Rec
type RS source · line 168 · raw
Data
RHitRS
RNextRS
REndRS
type RK source · line 253 · raw
Data
RNumRK
RNameRK
RNoneRK
Definitions
def rev_str source · line 15 · raw
@cs:List<&2, Char> -> String
def is_alnum source · line 18 · raw
@+c:Char -> Bool
def hex_digit source · line 21 · raw
@+c:Char -> Bool
def hex_val source · line 25 · raw
@+c:U32 -> U32
def digits_go source · line 30 · raw
@n:Nat -> @s:String -> @+hex:Bool -> String
The leading run of s whose characters satisfy the test (hex or decimal
digits, or letters and digits), at most n long.
def alnum_go source · line 41 · raw
@n:Nat -> @s:String -> String
def value_go source · line 53 · raw
@s:String -> @+base:U32 -> @+acc:U32 -> U32
Digits to a value, saturating just past U+10FFFF (no U32 overflow).
def nth_or source · line 61 · raw
@xs:List<&2, U32> -> @n:Nat -> @+d:U32 -> U32
windows-1252 for 0x80-0x9F (the spec's numeric reference table); others as is.
def c1_map source · line 72 · raw
@+v:U32 -> U32
def code_point source · line 78 · raw
@+v:U32 -> U32
def literal source · line 86 · raw
@+rest:String -> Step
def numeric source · line 90 · raw
@+t:String -> Step
t is the text after "&#".
def letter_index source · line 99 · raw
@+c:U32 -> Nat
def nth0 source · line 105 · raw
@xs:List<&2, U32> -> @n:Nat -> U32
def sym source · line 109 · raw
@+v:U32 -> Char
6-bit code (entity_table.bend) to a character.
def unpack source · line 113 · raw
@k:Nat -> @+w:U32 -> List<&2, Char>
def more_chars source · line 121 · raw
@ws:List<&2, U32> -> @+left:U32 -> List<&2, Char>
The characters in a name's words after the first; left still to read.
def rec_of source · line 132 · raw
@+ws:List<&2, U32> -> Rec
def code6 source · line 146 · raw
@+c:U32 -> U32
The 6-bit code of a character (0 if it cannot be in a name).
def pack4 source · line 151 · raw
@k:Nat -> @s:String -> U32
def rec_words source · line 163 · raw
@+ws:List<&2, U32> -> Nat
Words a record takes: its first, the rest of its name, its code points.
def rec_name source · line 173 · raw
@r:Rec -> String
def rs_long source · line 179 · raw
@pre:Bool -> @+ws:List<&2, U32> -> @+run:String -> RS
The full name is read only when the first four characters already match.
def rs_of source · line 186 · raw
@+ws:List<&2, U32> -> @+run:String -> @+runpack:U32 -> RS
def rec_named source · line 194 · raw
@r:Rec -> Named
def find source · line 202 · raw
@fuel:Nat -> @+run:String -> @+runpack:U32 -> @+ws:List<&2, U32> -> @k:RS -> Maybe<&2, Named>
Walk the bucket's records: the first name run starts with is the longest
(records are longest first). k classifies the record at the head of ws,
computed by the caller.
def longest_in source · line 216 · raw
@+ws:List<&2, U32> -> @+run:String -> Maybe<&2, Named>
def cps_chars source · line 220 · raw
@cps:List<&2, U32> -> List<&2, Char>
def first_char source · line 227 · raw
@s:String -> Char
def named_hit source · line 234 · raw
@m:Maybe<&2, Named> -> @+t:String -> @+attr:Bool -> Step
def named source · line 247 · raw
@+t:String -> @+attr:Bool -> Step
t is the text after '&', starting with a letter.
def kind_of source · line 258 · raw
@+t:String -> RK
def reference source · line 262 · raw
@k:RK -> @+t:String -> @+attr:Bool -> Step
def step source · line 271 · raw
@amp:Bool -> @+c:Char -> @+t:String -> @+attr:Bool -> Step
def step_out source · line 278 · raw
@s:Step -> List<&2, Char>
def step_rest source · line 283 · raw
@s:Step -> String
def dec source · line 289 · raw
@fuel:Nat -> @s:String -> @+attr:Bool -> @+out:List<&2, Char> -> List<&2, Char>
One pass; fuel bounds it (every step consumes at least one character).
def has_amp source · line 301 · raw
@s:String -> Bool
def decode_if source · line 308 · raw
@amp:Bool -> @+s:String -> @+attr:Bool -> String
def decode_in source · line 316 · raw
@+s:String -> @+attr:Bool -> String
Most text has no '&': one scan, and it comes back unchanged.
def decode source · line 320 · raw
@+s:String -> String
Character references in text.
def decode_attr source · line 324 · raw
@+s:String -> String
Character references in an attribute value.