module BatUCharParser:Parsing unicode textsig
..end
This module defines common functions for parsing Unicode
texts. These functions are meant to be used in conjunction with
the ParserCo
module.
Note As ParserCo, this module is still very rough and needs testing.
Author(s): David Teller
typeposition =
BatCharParser.position
= {
|
offset : |
(* | Offset on the line (starting at 0) | *) |
|
line : |
(* | Line number (starting at 0) | *) |
val advance : CamomileLibrary.UChar.t -> position -> position
advance c p
returns a new position advanced by one char. If c
is '\r' or '\n',
the result is {offset = 0; line = p.line + 1}
. Other wise, the result is
{offset = p.offset + 1; line = p.line}
.
val source_of_rope : BatRope.t ->
(CamomileLibrary.UChar.t, position) BatParserCo.Source.t
val source_of_enum : CamomileLibrary.UChar.t BatEnum.t ->
(CamomileLibrary.UChar.t, position) BatParserCo.Source.t
val parse : (CamomileLibrary.UChar.t, 'a, position) BatParserCo.t ->
BatRope.t -> ('a, position BatParserCo.report) BatStd.result
val char : CamomileLibrary.UChar.t ->
(CamomileLibrary.UChar.t, CamomileLibrary.UChar.t, position)
BatParserCo.t
val none_of : CamomileLibrary.UChar.t list ->
(CamomileLibrary.UChar.t, CamomileLibrary.UChar.t, position)
BatParserCo.t
ParserCo.none_of
, just with improved error message.val not_char : CamomileLibrary.UChar.t ->
(CamomileLibrary.UChar.t, CamomileLibrary.UChar.t, position)
BatParserCo.t
none_of
.val string : string ->
(CamomileLibrary.UChar.t, string, position) BatParserCo.t
val rope : BatRope.t ->
(CamomileLibrary.UChar.t, BatRope.t, position) BatParserCo.t
val ustring : BatUTF8.t ->
(CamomileLibrary.UChar.t, BatUTF8.t, position) BatParserCo.t
val case_char : CamomileLibrary.UChar.t ->
(CamomileLibrary.UChar.t, BatUTF8.t, position) BatParserCo.t
char
, but case-insensitiveval case_string : string ->
(CamomileLibrary.UChar.t, string, position) BatParserCo.t
string
, but case-insensitiveval case_ustring : BatUTF8.t ->
(CamomileLibrary.UChar.t, BatUTF8.t, position) BatParserCo.t
ustring
, but case-insensitiveval case_rope : BatRope.t ->
(CamomileLibrary.UChar.t, BatRope.t, position) BatParserCo.t
rope
, but case-insensitiveval newline : (CamomileLibrary.UChar.t, CamomileLibrary.UChar.t, position)
BatParserCo.t
val whitespace : (CamomileLibrary.UChar.t, CamomileLibrary.UChar.t, position)
BatParserCo.t
val uppercase : (CamomileLibrary.UChar.t, CamomileLibrary.UChar.t, position)
BatParserCo.t
val lowercase : (CamomileLibrary.UChar.t, CamomileLibrary.UChar.t, position)
BatParserCo.t
val letter : (CamomileLibrary.UChar.t, CamomileLibrary.UChar.t, position)
BatParserCo.t
val digit : (CamomileLibrary.UChar.t, CamomileLibrary.UChar.t, position)
BatParserCo.t
val hex : (CamomileLibrary.UChar.t, CamomileLibrary.UChar.t, position)
BatParserCo.t