@@ -65,7 +65,20 @@ struct whitespace {
65
65
lexy::dsl::inline_<line_comment> | lexy::dsl::inline_<block_comment>;
66
66
};
67
67
68
+ /* *
69
+ * Lookupable type name
70
+ */
68
71
struct type_name {
72
+ static constexpr auto rule = lexy::dsl::
73
+ identifier (lexy::dsl::ascii::alpha, lexy::dsl::ascii::alnum / lexy::dsl::lit_c<' .' >);
74
+
75
+ static constexpr auto value = lexy::as_string<std::string_view>;
76
+ };
77
+
78
+ /* *
79
+ * Type name used for declaration
80
+ */
81
+ struct type_name_decl {
69
82
static constexpr auto rule =
70
83
lexy::dsl::identifier (lexy::dsl::ascii::alpha, lexy::dsl::ascii::alnum);
71
84
@@ -179,7 +192,7 @@ struct component_statement {
179
192
};
180
193
181
194
static constexpr auto rule = lexy::dsl::p<component_keyword> >>
182
- lexy::dsl::p<type_name >;
195
+ lexy::dsl::p<type_name_decl >;
183
196
184
197
static constexpr auto value =
185
198
lexy::callback<ecsact_statement>([](std::string_view component_name) {
@@ -206,7 +219,7 @@ struct transient_statement {
206
219
};
207
220
208
221
static constexpr auto rule = lexy::dsl::p<transient_keyword> >>
209
- lexy::dsl::p<type_name >;
222
+ lexy::dsl::p<type_name_decl >;
210
223
211
224
static constexpr auto value =
212
225
lexy::callback<ecsact_statement>([](std::string_view transient_name) {
@@ -229,7 +242,7 @@ struct system_statement {
229
242
};
230
243
231
244
static constexpr auto rule = lexy::dsl::p<system_keyword> >>
232
- lexy::dsl::opt (lexy::dsl::p<type_name >);
245
+ lexy::dsl::opt (lexy::dsl::p<type_name_decl >);
233
246
234
247
static constexpr auto value = lexy::callback<ecsact_statement>(
235
248
[](std::optional<std::string_view> system_name) {
@@ -257,7 +270,7 @@ struct action_statement {
257
270
};
258
271
259
272
static constexpr auto rule = lexy::dsl::p<action_keyword> >>
260
- lexy::dsl::p<type_name >;
273
+ lexy::dsl::p<type_name_decl >;
261
274
262
275
static constexpr auto value =
263
276
lexy::callback<ecsact_statement>([](std::string_view action_name) {
@@ -284,7 +297,7 @@ struct enum_statement {
284
297
};
285
298
286
299
static constexpr auto rule = lexy::dsl::p<enum_keyword> >>
287
- lexy::dsl::p<type_name >;
300
+ lexy::dsl::p<type_name_decl >;
288
301
289
302
static constexpr auto value =
290
303
lexy::callback<ecsact_statement>([](std::string_view enum_name) {
0 commit comments