Idris2Doc : Text.Lex.Manual

Text.Lex.Manual

(source)

Reexports

importpublic Text.Bounds
importpublic Text.ParseError
importpublic Data.List.Suffix
importpublic Data.List.Suffix.Result

Definitions

0LexRes : Bool->ListChar->Type->Type->Type
  Result of running a (strict) tokenizer.

Totality: total
Visibility: public export
move : Position->Suffixbxsys->Position
  Shift the position by a number of columns represented by
a `Suffix` value. This assumes, that no line break was "shifted".

Totality: total
Visibility: public export
endPos : Position->Suffixbyscs->Position
  Calculates the new position from a `Suffix` by reinspecting
the original list of characters.

Use this, if the consumed prefix might have contained line breaks.
Otherwise, consider using `move`, which runs in O(1) instead of O(n).

Totality: total
Visibility: export
boundedErr : Position->SuffixFalseerrStartts-> (0errEnd : ListChar) ->SuffixFalseerrEnderrStart=>e->Boundede
Totality: total
Visibility: export
(<|>) : Resultbttsra-> Lazy (Resultbttsra) ->Resultbttsra
Totality: total
Visibility: public export
Fixity Declaration: infixr operator, level 2
isSpaceChar : Char->Bool
  Returns true if the character is a space (`' '`) character.

Totality: total
Visibility: public export
isLineFeed : Char->Bool
  Returns true if the character is a line feed (`'\n'`) character.

Totality: total
Visibility: public export
octDigit : Char->Nat
  Converts a character to an octal digit. This works under the
assumption that the character has already been verified to be
an octal digit.

Totality: total
Visibility: public export
digit : Char->Nat
  Converts a character to a decimal digit. This works under the
assumption that the character has already been verified to be
a decimal digit.

Totality: total
Visibility: public export
hexDigit : Char->Nat
  Converts a character to a hexadecimal digit. This works under the
assumption that the character has already been verified to be
a hexadecimal digit.

Totality: total
Visibility: public export
isBinDigit : Char->Bool
  True if the given character is a binary digit.

Totality: total
Visibility: public export
binDigit : Char->Nat
  Converts a character to a binary digit. This works under the
assumption that the character has already been verified to be
a binary digit.

Totality: total
Visibility: public export
0Tok : Bool->Type->Type->Type
  A tokenizing function, which will consume a strict
prefix of the input list or fail with a stop reason.

Totality: total
Visibility: public export
0AutoTok : Type->Type->Type
  A tokenizing function, which will consume additional characters
from the input string. This can only be used if already some
have been consumed.

Totality: total
Visibility: public export
0SafeTok : Type->Type
  A tokenizing function that cannot fail.

Totality: total
Visibility: public export
0StrictTok : Type->Type->Type
  A tokenizing function, which will consume additional characters
from the input string.

Totality: total
Visibility: public export
tok : StrictTokea->TokTrueea
Totality: total
Visibility: public export
autoTok : StrictTokea->AutoTokea
Totality: total
Visibility: public export
safeTok : SafeToka->AutoTokea
Totality: total
Visibility: public export
range : InnerErrore->SuffixberrBeginorig-> (0errEnd : ListChar) ->SuffixFalseerrEnderrBegin=>LexResbresorigea
Totality: total
Visibility: public export
invalidEscape : SuffixberrBeginorig-> (0errEnd : ListChar) ->SuffixFalseerrEnderrBegin=>LexResbresorigea
Totality: total
Visibility: public export
unknownRange : SuffixberrBeginorig-> (0errEnd : ListChar) ->SuffixFalseerrEnderrBegin=>LexResbresorigea
Totality: total
Visibility: public export
single : InnerErrore->Suffixb (c::errEnd) orig->LexResbresorigea
Totality: total
Visibility: public export
unknown : Suffixb (c::errEnd) orig->LexResbresorigea
Totality: total
Visibility: public export
eoiAt : Suffixb [] orig->LexResbresorigea
Totality: total
Visibility: public export
failCharClass : CharClass->Suffixb (c::errEnd) orig->LexResbresorigea
Totality: total
Visibility: public export
failDigit : DigitType->Suffixb (c::errEnd) orig->LexResbresorigea
Totality: total
Visibility: public export
fail : SuffixberrBeginorig->LexResbresorigea
Totality: total
Visibility: public export
dec1 : Nat->SafeTokNat
  Tries to read additional decimal digits onto a growing natural number.

Totality: total
Visibility: public export
dec : StrictTokeNat
  Tries to read a natural number. Fails, if this does not contain at least
one digit.

Totality: total
Visibility: public export
dec_1 : Nat->AutoTokeNat
  Tries to read more decimal digits onto a growing natural number.
Supports underscores as separators for better readability.

Totality: total
Visibility: public export
decSep : StrictTokeNat
  Tries to read a natural number.
Supports underscores as separators for better readability.

Totality: total
Visibility: public export
bin1 : Nat->SafeTokNat
  Tries to read more binary digits onto a growing natural number.

Totality: total
Visibility: public export
bin : StrictTokeNat
  Tries to read a binary natural number.
Fails, if this does not contain at least one digit.

Totality: total
Visibility: public export
bin_1 : Nat->AutoTokeNat
  Tries to read more binary digits onto a growing natural number.
Supports underscores as separators for better readability.

Totality: total
Visibility: public export
binSep : StrictTokeNat
  Tries to read a binary natural number.
Fails, if this does not contain at least one digit.
Supports underscores as separators for better readability.

Totality: total
Visibility: public export
oct1 : Nat->SafeTokNat
  Tries to read more octal digits onto a growing natural number.

Totality: total
Visibility: public export
oct : StrictTokeNat
  Tries to read a octal natural number.
Fails, if this does not contain at least one digit.

Totality: total
Visibility: public export
oct_1 : Nat->AutoTokeNat
  Tries to read more octal digits onto a growing natural number.
Supports underscores as separators for better readability.

Totality: total
Visibility: public export
octSep : StrictTokeNat
  Tries to read a octal natural number.
Fails, if this does not contain at least one digit.
Supports underscores as separators for better readability.

Totality: total
Visibility: public export
hex1 : Nat->SafeTokNat
  Tries to read more hexadecimal digits onto a growing natural number.

Totality: total
Visibility: public export
hex : StrictTokeNat
  Tries to read a hexadecimal natural number.
Fails, if this does not contain at least one digit.

Totality: total
Visibility: public export
hex_1 : Nat->AutoTokeNat
  Tries to read more hexadecimal digits onto a growing natural number.
Supports underscores as separators for better readability.

Totality: total
Visibility: public export
hexSep : StrictTokeNat
  Tries to read a hexadecimal natural number.
Fails, if this does not contain at least one digit.
Supports underscores as separators for better readability.

Totality: total
Visibility: public export
int : StrictTokeInteger
  A shifter that takes moves an integer prefix

Totality: total
Visibility: public export
intPlus : StrictTokeInteger
  Like `int` but also allows an optional leading `'+'` character.

Totality: total
Visibility: public export
takeJustOnto : SnocListy-> (Char->Maybey) ->SafeTok (SnocListy)
Totality: total
Visibility: public export
takeJust : (Char->Maybey) ->SafeTok (SnocListy)
  Consumes and converts a list prefix until the given
function returns `Nothing`.

Totality: total
Visibility: public export
takeJust1 : (Char->Maybey) ->StrictToke (SnocListy)
  Consumes and converts a strict list prefix until the given
function returns `Nothing`.

Totality: total
Visibility: public export
singleLineDropSpaces : TokTrueea->String->Either (Bounded (InnerErrore)) (List (Boundeda))
  Repeatedly consumes a strict prefix of a list of characters
until the whole list is consumed. Drops all white space
it encounters (unsing `Prelude.isSpace` to determine, what is
a whitespace character).

This assumes that every token is on a single line. Therefore, it is
more efficient than `multilineDropSpaces`, because it does not have
to traverse the consumed characters to find line breaks.

This is provably total, due to the strictness of the consuming
function.

Totality: total
Visibility: public export
multiLineDropSpaces : TokTrueea->String->Either (Bounded (InnerErrore)) (List (Boundeda))
  Like `singleLineDropSpaces`, but consumed tokens might be
spread across several lines.

This is provably total, due to the strictness of the consuming
function.

Totality: total
Visibility: public export
lexManual : TokTrueea->String->Either (Bounded (InnerErrore)) (List (Boundeda))
  Repeatedly consumes a strict prefix of a list of characters
until the whole list is consumed. It uses the amount of characters
consumed to determine the bounds of the consumed lexemes.

This is provably total, due to the strictness of the consuming
function.

Totality: total
Visibility: public export