From 87b2cce8e5b327d65b473a234efefaaf61436b46 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 1 Nov 2017 19:59:44 -0700 Subject: [PATCH] Added remove rule rule. --- lib/metaprogramming.nom | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/metaprogramming.nom b/lib/metaprogramming.nom index ac45574..fe1d50a 100644 --- a/lib/metaprogramming.nom +++ b/lib/metaprogramming.nom @@ -53,6 +53,13 @@ rule [escaped compile %macro_def to code %body] =: parse [compile %macro_def to %body] as: escaped compile \%macro_def to \%body parse [compile %macro_def to code %body] as: escaped compile \%macro_def to code \%body +rule [remove rule %stub] =: + lua> ".." + |local def = nomsu.defs[stub]; + |for _, alias in ipairs(def.aliases) do + | nomsu.defs[alias] = nil; + |end + rule [do %] =: =lua "\(%)(nomsu, vars)"