package pyre-ast
Module TaglessFinal.Constant
This module provides a type that represents Python constant value.
type 'a t = private {none : 'a;(*Represents the value
*)None.false_ : 'a;(*Represents the value
*)False.true_ : 'a;(*Represents the value
*)True.ellipsis : 'a;(*Represents the value
*)....integer : int -> 'a;(*Represents integer literals whose value can be represented by OCaml
*)inttype (e.g.42).big_integer : string -> 'a;(*Represents integer literals whose value cannot be represented by OCaml
*)inttype. The integer will be stored as a string instead.float_ : float -> 'a;(*Represents Python float literals (e.g.
*)4.2).complex : float -> 'a;(*Represents Python complex literals (e.g.
4.2j). The float argument is the imaginary part of the complex number.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.
*)1+2jwill be parsed as a binary expression that adds up constant1and2j) as opposed to literalsstring_ : string -> 'a;(*Represents Python string literals (e.g.
"derp").Unlike non-ascii identifiers, non-ascii string literals can be parsed properly by this library. That also means it has no trouble handling strings with embedded null bytes.
*)byte_string : string -> 'a;(*Represents Python string literals (e.g.
b"derp").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.
*)
}