From cbd78728c940bbea5ab576075865be076e867cd8 Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Wed, 18 Sep 2024 16:41:55 -0700 Subject: [PATCH 1/3] feat: stream toggle keyword --- ecsact/detail/grammar.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ecsact/detail/grammar.hh b/ecsact/detail/grammar.hh index c20df41..10d34fe 100644 --- a/ecsact/detail/grammar.hh +++ b/ecsact/detail/grammar.hh @@ -645,6 +645,11 @@ struct system_component_statement { static constexpr auto value = lexy::constant(ECSACT_SYS_CAP_REMOVES); }; + struct stream_toggle_keyword : lexy::token_production { + static constexpr auto rule = LEXY_LIT("stream_toggle"); + static constexpr auto value = lexy::constant(ECSACT_SYS_CAP_STREAM_TOGGLE); + }; + struct filter { static constexpr auto rule = lexy::dsl::p | lexy::dsl::p; From 29d1922175f60ee030fc1f1894dc54842edacfba Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Wed, 18 Sep 2024 16:50:21 -0700 Subject: [PATCH 2/3] feat: stream toggle keyword (with tests) --- MODULE.bazel | 5 +++++ ecsact/detail/grammar.hh | 3 ++- test/MODULE.bazel | 5 +++++ test/parse_test_system_component_statement.cc | 9 +++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index 78f6ea7..dac35b2 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -26,3 +26,8 @@ register_toolchains( "@llvm_toolchain//:all", dev_dependency = True, ) + +local_path_override( + module_name = "ecsact_runtime", + path = "../ecsact_runtime", +) diff --git a/ecsact/detail/grammar.hh b/ecsact/detail/grammar.hh index 10d34fe..f35085a 100644 --- a/ecsact/detail/grammar.hh +++ b/ecsact/detail/grammar.hh @@ -700,7 +700,8 @@ struct system_component_statement { }; static constexpr auto capability = lexy::dsl::p | - lexy::dsl::p | lexy::dsl::p; + lexy::dsl::p | lexy::dsl::p | + lexy::dsl::p; static constexpr auto rule = capability >> lexy::dsl::p >> lexy::dsl::opt(lexy::dsl::p >> lexy::dsl::p); diff --git a/test/MODULE.bazel b/test/MODULE.bazel index 225b4d7..bd2f9b7 100644 --- a/test/MODULE.bazel +++ b/test/MODULE.bazel @@ -26,3 +26,8 @@ register_toolchains( "@llvm_toolchain//:all", dev_dependency = True, ) + +local_path_override( + module_name = "ecsact_runtime", + path = "../../ecsact_runtime", +) diff --git a/test/parse_test_system_component_statement.cc b/test/parse_test_system_component_statement.cc index 8ecad58..8707b44 100644 --- a/test/parse_test_system_component_statement.cc +++ b/test/parse_test_system_component_statement.cc @@ -165,6 +165,15 @@ TEST(Parse, RemovesSystemComponent) { ); } +TEST(Parse, StreamToggleSystemComponent) { + TestValidSystemComponent( + "stream_toggle ExampleComponent;"s, + ECSACT_SYS_CAP_STREAM_TOGGLE, + "ExampleComponent", + empty_list + ); +} + /////////////////////////////////// // 'with' keyword // /////////////////////////////////// From a9c1332db8121bfbdaf49b72873237707c7242ac Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Mon, 14 Oct 2024 17:12:30 -0700 Subject: [PATCH 3/3] chore: update deps --- MODULE.bazel | 5 ----- 1 file changed, 5 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index dac35b2..78f6ea7 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -26,8 +26,3 @@ register_toolchains( "@llvm_toolchain//:all", dev_dependency = True, ) - -local_path_override( - module_name = "ecsact_runtime", - path = "../ecsact_runtime", -)