1use sealed::sealed;
7
8#[sealed]
14pub trait LuaVersion: 'static {
15 const NAME: &'static str;
17 const HAS_FLOOR_DIV: bool;
19 const HAS_COMPOUND_ASSIGN: bool;
21 const HAS_CONTINUE: bool;
23 const HAS_IF_EXPR: bool;
25 const HAS_STRING_INTERP: bool;
27 const HAS_TYPE_ANNOTATIONS: bool;
29 const HAS_ATTRIBUTES: bool;
31 const HAS_GENERICS: bool;
33 const HAS_EXPORT: bool;
35 const HAS_GOTO: bool;
37 const HAS_BITWISE_OPS: bool;
39 const HAS_VARIABLE_ATTRIBUTES: bool;
41 const HAS_CONST: bool;
43}
44
45#[derive(Debug, Clone, Copy)]
51pub struct Luau;
52
53#[sealed]
55impl LuaVersion for Luau {
56 const NAME: &'static str = "Luau";
57 const HAS_FLOOR_DIV: bool = true;
58 const HAS_COMPOUND_ASSIGN: bool = true;
59 const HAS_CONTINUE: bool = true;
60 const HAS_IF_EXPR: bool = true;
61 const HAS_STRING_INTERP: bool = true;
62 const HAS_TYPE_ANNOTATIONS: bool = true;
63 const HAS_ATTRIBUTES: bool = true;
64 const HAS_GENERICS: bool = true;
65 const HAS_EXPORT: bool = true;
66 const HAS_GOTO: bool = false;
67 const HAS_BITWISE_OPS: bool = false;
68 const HAS_VARIABLE_ATTRIBUTES: bool = false;
69 const HAS_CONST: bool = true;
70}
71
72#[derive(Debug, Clone, Copy)]
77pub struct Lua51;
78
79#[sealed]
81impl LuaVersion for Lua51 {
82 const NAME: &'static str = "Lua 5.1";
83 const HAS_FLOOR_DIV: bool = false;
84 const HAS_COMPOUND_ASSIGN: bool = false;
85 const HAS_CONTINUE: bool = false;
86 const HAS_IF_EXPR: bool = false;
87 const HAS_STRING_INTERP: bool = false;
88 const HAS_TYPE_ANNOTATIONS: bool = false;
89 const HAS_ATTRIBUTES: bool = false;
90 const HAS_GENERICS: bool = false;
91 const HAS_EXPORT: bool = false;
92 const HAS_GOTO: bool = false;
93 const HAS_BITWISE_OPS: bool = false;
94 const HAS_VARIABLE_ATTRIBUTES: bool = false;
95 const HAS_CONST: bool = false;
96}
97
98#[derive(Debug, Clone, Copy)]
103pub struct Lua52;
104
105#[sealed]
107impl LuaVersion for Lua52 {
108 const NAME: &'static str = "Lua 5.2";
109 const HAS_FLOOR_DIV: bool = false;
110 const HAS_COMPOUND_ASSIGN: bool = false;
111 const HAS_CONTINUE: bool = false;
112 const HAS_IF_EXPR: bool = false;
113 const HAS_STRING_INTERP: bool = false;
114 const HAS_TYPE_ANNOTATIONS: bool = false;
115 const HAS_ATTRIBUTES: bool = false;
116 const HAS_GENERICS: bool = false;
117 const HAS_EXPORT: bool = false;
118 const HAS_GOTO: bool = true;
119 const HAS_BITWISE_OPS: bool = false;
120 const HAS_VARIABLE_ATTRIBUTES: bool = false;
121 const HAS_CONST: bool = false;
122}
123
124#[derive(Debug, Clone, Copy)]
129pub struct Lua53;
130
131#[sealed]
133impl LuaVersion for Lua53 {
134 const NAME: &'static str = "Lua 5.3"; const HAS_FLOOR_DIV: bool = true;
136 const HAS_COMPOUND_ASSIGN: bool = false;
137 const HAS_CONTINUE: bool = false;
138 const HAS_IF_EXPR: bool = false;
139 const HAS_STRING_INTERP: bool = false;
140 const HAS_TYPE_ANNOTATIONS: bool = false;
141 const HAS_ATTRIBUTES: bool = false;
142 const HAS_GENERICS: bool = false;
143 const HAS_EXPORT: bool = false;
144 const HAS_GOTO: bool = true;
145 const HAS_BITWISE_OPS: bool = true;
146 const HAS_VARIABLE_ATTRIBUTES: bool = false;
147 const HAS_CONST: bool = false;
148}
149
150#[derive(Debug, Clone, Copy)]
155pub struct Lua54;
156
157#[sealed]
158impl LuaVersion for Lua54 {
159 const NAME: &'static str = "Lua 5.4";
160 const HAS_FLOOR_DIV: bool = true;
161 const HAS_COMPOUND_ASSIGN: bool = false;
162 const HAS_CONTINUE: bool = false;
163 const HAS_IF_EXPR: bool = false;
164 const HAS_STRING_INTERP: bool = false;
165 const HAS_TYPE_ANNOTATIONS: bool = false;
166 const HAS_ATTRIBUTES: bool = true;
167 const HAS_GENERICS: bool = false;
168 const HAS_EXPORT: bool = false;
169 const HAS_GOTO: bool = true;
170 const HAS_BITWISE_OPS: bool = true;
171 const HAS_VARIABLE_ATTRIBUTES: bool = true;
172 const HAS_CONST: bool = false;
173}