TaglessFinal.Constant
This module provides a type that represents Python constant value.
type 'a t = private {
none : 'a; | (* Represents the value |
false_ : 'a; | (* Represents the value |
true_ : 'a; | (* Represents the value |
ellipsis : 'a; | (* Represents the value |
integer : int -> 'a; | (* Represents integer literals whose value can be represented by OCaml |
big_integer : string -> 'a; | (* Represents integer literals whose value cannot be represented by OCaml |
float_ : float -> 'a; | (* Represents Python float literals (e.g. |
complex : float -> 'a; | (* Represents Python complex literals (e.g. The reason why we do not need to keep track of the real part is that in Python, complex numbers with non-zero real part are represented as compound expressions (e.g. |
string_ : string -> 'a; | (* Represents Python string literals (e.g. At OCaml level, the value of the string literal is a UTF-8 decoded byte array of the original string literal in Python. If the original literal cannot be UTF-8 decoded, the Note that due to technical limitations, \N escape sequence translation is not supported: String literal "\N{FOO}" will be treated as an ascii string of length 7 as opposed to a Unicode string of length 1. *) |
byte_string : string -> 'a; | (* Represents Python string literals (e.g. Unlike non-ascii identifiers, non-ascii bytestring literals can be parsed properly by this library. That also means it has no trouble handling strings with embedded null bytes. *) |
}