Skip to content

Instantly share code, notes, and snippets.

@rsmmr
Created March 16, 2023 09:21
Show Gist options
  • Save rsmmr/38aa07d5adc50381513f4fbccf08f2ce to your computer and use it in GitHub Desktop.
Save rsmmr/38aa07d5adc50381513f4fbccf08f2ce to your computer and use it in GitHub Desktop.
diff --git a/3rdparty/fiber b/3rdparty/fiber
--- a/3rdparty/fiber
+++ b/3rdparty/fiber
@@ -1 +1 @@
-Subproject commit f75b2f93aa312b9922f9c977021e5470ff7715fa
+Subproject commit f75b2f93aa312b9922f9c977021e5470ff7715fa-dirty
diff --git a/spicy/toolchain/src/compiler/codegen/parser-builder.cc b/spicy/toolchain/src/compiler/codegen/parser-builder.cc
index 1bd3bc69..7fc2aa83 100644
--- a/spicy/toolchain/src/compiler/codegen/parser-builder.cc
+++ b/spicy/toolchain/src/compiler/codegen/parser-builder.cc
@@ -275,33 +275,34 @@ struct ProductionVisitor
builder()->addLocal("filtered", hilti::builder::strong_reference(type::Stream()));
if ( unit ) {
- pb->guardFeatureCode(*unit, {"supports_filters"}, [&]() {
- // If we have a filter attached, we initialize it and change to parse from its output.
- auto filtered = builder::assign(builder::id("filtered"),
- builder::call("spicy_rt::filter_init",
- {state().self, state().data, state().cur}));
-
- auto have_filter = builder()->addIf(filtered);
- pushBuilder(have_filter);
-
- auto args2 = args;
- builder()->addLocal("filtered_data", type::ValueReference(type::Stream()),
- builder::id("filtered"));
- args2[0] = builder::id("filtered_data");
- args2[1] = builder::deref(args2[0]);
- builder()->addExpression(builder::memberCall(state().self, id_stage2, args2));
-
- // Assume the filter consumed the full input.
- pb->advanceInput(builder::size(state().cur));
-
- auto result =
- builder::tuple({state().cur, state().lahead, state().lahead_end, state().error});
-
- builder()->addAssign(store_result, result);
- popBuilder();
- });
+ /*
+ * pb->guardFeatureCode(*unit, {"supports_filters"}, [&]() {
+ * // If we have a filter attached, we initialize it and change to parse from its output.
+ * auto filtered = builder::assign(builder::id("filtered"),
+ * builder::call("spicy_rt::filter_init",
+ * {state().self, state().data, state().cur}));
+ *
+ * auto have_filter = builder()->addIf(filtered);
+ * pushBuilder(have_filter);
+ *
+ * auto args2 = args;
+ * builder()->addLocal("filtered_data", type::ValueReference(type::Stream()),
+ * builder::id("filtered"));
+ * args2[0] = builder::id("filtered_data");
+ * args2[1] = builder::deref(args2[0]);
+ * builder()->addExpression(builder::memberCall(state().self, id_stage2, args2));
+ *
+ * // Assume the filter consumed the full input.
+ * pb->advanceInput(builder::size(state().cur));
+ *
+ * auto result =
+ * builder::tuple({state().cur, state().lahead, state().lahead_end, state().error});
+ *
+ * builder()->addAssign(store_result, result);
+ * popBuilder();
+ * });
+ */
}
-
auto not_have_filter = builder()->addIf(builder::not_(builder::id("filtered")));
pushBuilder(not_have_filter);
builder()->addAssign(store_result, builder::memberCall(state().self, id_stage2, args));
@@ -2135,8 +2136,10 @@ void ParserBuilder::finalizeUnit(bool success, const Location& l) {
builder()->addMemberCall(state().self, "__on_0x25_error", {what}, l);
}
- guardFeatureCode(unit, {"supports_filters"},
- [&]() { builder()->addCall("spicy_rt::filter_disconnect", {state().self}); });
+ /*
+ * guardFeatureCode(unit, {"supports_filters"},
+ * [&]() { builder()->addCall("spicy_rt::filter_disconnect", {state().self}); });
+ */
if ( unit.isFilter() )
guardFeatureCode(unit, {"is_filter"},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment