From ae4670bd8e0e45985e43402f246e4219cd29fcaa Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 21 Jul 2018 14:43:49 -0700 Subject: Improvements working towards better inline tests. Improved handling of file spoofing and adding -e command line flag for executing a string. --- core/operators.nom | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/operators.nom') diff --git a/core/operators.nom b/core/operators.nom index d0e3915..9a836bf 100644 --- a/core/operators.nom +++ b/core/operators.nom @@ -209,7 +209,8 @@ compile [not %] to (Lua value "(not \(% as lua expr))") test: assume ((length of [1, 2, 3]) == 3) -compile [length of %list, || %list ||] to (Lua value "(#\(%list as lua expr))") +compile [length of %list, len %list, || %list ||] to (Lua value "(#\(%list as lua expr))") +compile [%list is empty] to (Lua value "(#\(%list as lua expr) == 0)") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -221,4 +222,4 @@ parse [%var /= %] as (%var = (%var / %)) parse [%var ^= %] as (%var = (%var ^ %)) parse [%var and= %] as (%var = (%var and %)) parse [%var or= %] as (%var = (%var or %)) -parse [wrap %var around %] as (%var = (%var wrapped around %)) \ No newline at end of file +parse [wrap %var around %] as (%var = (%var wrapped around %)) -- cgit v1.2.3