1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#[cfg(feature = "write")]
use crate::constants::FormattedSize;
#[cfg(feature = "write")]
pub trait WriteOptions: Default {
fn is_valid(&self) -> bool;
fn buffer_size<T: FormattedSize, const FORMAT: u128>(&self) -> usize;
}
#[cfg(feature = "parse")]
pub trait ParseOptions: Default {
fn is_valid(&self) -> bool;
}
macro_rules! literal {
($name:ident, $value:ident) => {
pub const $name: Option<&[u8]> = $value;
};
($name:ident, $value:literal) => {
pub const $name: Option<&[u8]> = Some($value);
};
}
literal!(RUST_LITERAL, None);
literal!(PYTHON_LITERAL, None);
literal!(CXX_LITERAL_NAN, b"NAN");
literal!(CXX_LITERAL_INF, b"INFINITY");
literal!(CXX_LITERAL_INFINITY, b"INFINITY");
literal!(C_LITERAL_NAN, b"NAN");
literal!(C_LITERAL_INF, b"INFINITY");
literal!(C_LITERAL_INFINITY, b"INFINITY");
literal!(RUBY, None);
literal!(SWIFT_LITERAL, None);
literal!(GO_LITERAL, None);
literal!(HASKELL_LITERAL, None);
literal!(HASKELL_STRING_INF, b"Infinity");
literal!(HASKELL_STRING_INFINITY, b"Infinity");
literal!(JAVASCRIPT_INF, b"Infinity");
literal!(JAVASCRIPT_INFINITY, b"Infinity");
literal!(PERL_LITERAL, None);
literal!(PHP_LITERAL_NAN, b"NAN");
literal!(PHP_LITERAL_INF, b"INF");
literal!(PHP_LITERAL_INFINITY, b"INF");
literal!(JAVA_LITERAL, None);
literal!(JAVA_STRING_INF, b"Infinity");
literal!(JAVA_STRING_INFINITY, b"Infinity");
literal!(R_LITERAL_INF, b"Inf");
literal!(R_LITERAL_INFINITY, b"Inf");
literal!(KOTLIN_LITERAL, None);
literal!(KOTLIN_STRING_INF, b"Infinity");
literal!(KOTLIN_STRING_INFINITY, b"Infinity");
literal!(JULIA_LITERAL_INF, b"Inf");
literal!(JULIA_LITERAL_INFINITY, b"Inf");
literal!(CSHARP_LITERAL, None);
literal!(CSHARP_STRING_INF, b"Infinity");
literal!(CSHARP_STRING_INFINITY, b"Infinity");
literal!(KAWA, None);
literal!(GAMBITC, None);
literal!(GUILE, None);
literal!(CLOJURE_LITERAL, None);
literal!(CLOJURE_STRING_INF, b"Infinity");
literal!(CLOJURE_STRING_INFINITY, b"Infinity");
literal!(ERLANG_LITERAL_NAN, b"nan");
literal!(ERLANG_STRING, None);
literal!(ELM_LITERAL, None);
literal!(ELM_STRING_NAN, None);
literal!(ELM_STRING_INF, b"Infinity");
literal!(ELM_STRING_INFINITY, b"Infinity");
literal!(SCALA_LITERAL, None);
literal!(SCALA_STRING_INF, b"Infinity");
literal!(SCALA_STRING_INFINITY, b"Infinity");
literal!(ELIXIR, None);
literal!(FORTRAN_LITERAL, None);
literal!(D_LITERAL, None);
literal!(COFFEESCRIPT_INF, b"Infinity");
literal!(COFFEESCRIPT_INFINITY, b"Infinity");
literal!(COBOL, None);
literal!(FSHARP_LITERAL_NAN, b"nan");
literal!(FSHARP_LITERAL_INF, b"infinity");
literal!(FSHARP_LITERAL_INFINITY, b"infinity");
literal!(VB_LITERAL, None);
literal!(VB_STRING_INF, None);
literal!(VB_STRING_INFINITY, None);
literal!(OCAML_LITERAL_NAN, b"nan");
literal!(OCAML_LITERAL_INF, b"infinity");
literal!(OCAML_LITERAL_INFINITY, b"infinity");
literal!(OBJECTIVEC, None);
literal!(REASONML_LITERAL_NAN, b"nan");
literal!(REASONML_LITERAL_INF, b"infinity");
literal!(REASONML_LITERAL_INFINITY, b"infinity");
literal!(MATLAB_LITERAL_INF, b"inf");
literal!(MATLAB_LITERAL_INFINITY, b"Inf");
literal!(ZIG_LITERAL, None);
literal!(SAGE_LITERAL_INF, b"infinity");
literal!(SAGE_LITERAL_INFINITY, b"Infinity");
literal!(JSON, None);
literal!(TOML, None);
literal!(YAML, None);
literal!(XML_INF, None);
literal!(XML_INFINITY, None);
literal!(SQLITE, None);
literal!(POSTGRESQL, None);
literal!(MYSQL, None);
literal!(MONGODB_INF, b"Infinity");
literal!(MONGODB_INFINITY, b"Infinity");