aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core.nom11
1 files changed, 11 insertions, 0 deletions
diff --git a/core.nom b/core.nom
index 810859c..110fd18 100644
--- a/core.nom
+++ b/core.nom
@@ -279,4 +279,15 @@ macro block "test %code yields %expected":
error!
return ""
+rule "dict %items":
+ let "dict" = []
+ for "pair" in %items:
+ lua block "vars.dict[vars.pair[1]] = vars.pair[2]"
+ return %dict
+
+rule "%dict -> %key":
+ lua expr "vars.dict[vars.key]"
+
+rule "%dict -> %key = %value":
+ lua block "vars.dict[vars.key] = vars.value"