Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Unsafe operations on Angstrom's internal buffer
Each t
value has its own internal bigstring
buffer. These functions allow direct access to this buffer without an explicit copy.
These functions are considered unsafe as they expose the buffer directly. The buffer could be modified by Angstrom by future parsing operations. Any modifications by a caller could affect future parsing operations.
take n f
accepts exactly n
characters of input into the parser's internal buffer then calls f buffer ~off ~len
. buffer
is the parser's internal buffer. off
is the offset from the start of buffer
containing the requested content. len
is the length of the requested content. len
is guaranteed to be equal to n
.
take_while check f
accepts input into the parser's interal buffer as long as check
returns true
then calls f buffer ~off ~len
. buffer
is the parser's internal buffer. off
is the offset from the start of buffer
containing the requested content. len
is the length of the content matched by check
.
This parser does not fail. If check
returns false
on the first character, len
will be 0
.
take_while1 check f
accepts input into the parser's interal buffer as long as check
returns true
then calls f buffer ~off ~len
. buffer
is the parser's internal buffer. off
is the offset from the start of buffer
containing the requested content. len
is the length of the content matched by check
.
This parser requires that f
return true
for at least one character of input, and will fail otherwise.
take_till check f
accepts input into the parser's interal buffer as long as check
returns false
then calls f buffer ~off ~len
. buffer
is the parser's internal buffer. off
is the offset from the start of buffer
containing the requested content. len
is the length of the content matched by check
.
This parser does not fail. If check
returns true
on the first character, len
will be 0
.