diff options
author | Dan Appel <Dan.appel00@gmail.com> | 2021-05-11 02:02:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-11 02:02:33 -0700 |
commit | bb63070e701e6e5ba9fa0b4adaa259a0ef8115be (patch) | |
tree | 939747e71d1292b191329dd4fa8b8201b03e4566 /specs/~lambdas.json | |
parent | 7b09c52a149563d53156e7abcff3dde02f7b5b9d (diff) | |
parent | 0f428a711e514e1b9df651c399397b38b6ee2f0a (diff) | |
download | mustache-spec-bb63070e701e6e5ba9fa0b4adaa259a0ef8115be.tar.gz |
Merge pull request #126 from splumhoff/master
Diffstat (limited to 'specs/~lambdas.json')
-rw-r--r-- | specs/~lambdas.json | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/specs/~lambdas.json b/specs/~lambdas.json index 7b6d59c..92c902a 100644 --- a/specs/~lambdas.json +++ b/specs/~lambdas.json @@ -15,7 +15,8 @@ "php": "return \"world\";", "python": "lambda: \"world\"", "clojure": "(fn [] \"world\")", - "lisp": "(lambda () \"world\")" + "lisp": "(lambda () \"world\")", + "pwsh": "\"world\"" } }, "template": "Hello, {{lambda}}!", @@ -35,7 +36,8 @@ "php": "return \"{{planet}}\";", "python": "lambda: \"{{planet}}\"", "clojure": "(fn [] \"{{planet}}\")", - "lisp": "(lambda () \"{{planet}}\")" + "lisp": "(lambda () \"{{planet}}\")", + "pwsh": "\"{{planet}}\"" } }, "template": "Hello, {{lambda}}!", @@ -55,7 +57,8 @@ "php": "return \"|planet| => {{planet}}\";", "python": "lambda: \"|planet| => {{planet}}\"", "clojure": "(fn [] \"|planet| => {{planet}}\")", - "lisp": "(lambda () \"|planet| => {{planet}}\")" + "lisp": "(lambda () \"|planet| => {{planet}}\")", + "pwsh": "\"|planet| => {{planet}}\"" } }, "template": "{{= | | =}}\nHello, (|&lambda|)!", @@ -74,7 +77,8 @@ "php": "global $calls; return ++$calls;", "python": "lambda: globals().update(calls=globals().get(\"calls\",0)+1) or calls", "clojure": "(def g (atom 0)) (fn [] (swap! g inc))", - "lisp": "(let ((g 0)) (lambda () (incf g)))" + "lisp": "(let ((g 0)) (lambda () (incf g)))", + "pwsh": "if (($null -eq $script:calls) -or ($script:calls -ge 3)){$script:calls=0}; ++$script:calls; $script:calls" } }, "template": "{{lambda}} == {{{lambda}}} == {{lambda}}", @@ -93,7 +97,8 @@ "php": "return \">\";", "python": "lambda: \">\"", "clojure": "(fn [] \">\")", - "lisp": "(lambda () \">\")" + "lisp": "(lambda () \">\")", + "pwsh": "\">\"" } }, "template": "<{{lambda}}{{{lambda}}}", @@ -113,7 +118,8 @@ "php": "return ($text == \"{{x}}\") ? \"yes\" : \"no\";", "python": "lambda text: text == \"{{x}}\" and \"yes\" or \"no\"", "clojure": "(fn [text] (if (= text \"{{x}}\") \"yes\" \"no\"))", - "lisp": "(lambda (text) (if (string= text \"{{x}}\") \"yes\" \"no\"))" + "lisp": "(lambda (text) (if (string= text \"{{x}}\") \"yes\" \"no\"))", + "pwsh": "if ($args[0] -eq \"{{x}}\") {\"yes\"} else {\"no\"}" } }, "template": "<{{#lambda}}{{x}}{{/lambda}}>", @@ -133,7 +139,8 @@ "php": "return $text . \"{{planet}}\" . $text;", "python": "lambda text: \"%s{{planet}}%s\" % (text, text)", "clojure": "(fn [text] (str text \"{{planet}}\" text))", - "lisp": "(lambda (text) (format nil \"~a{{planet}}~a\" text text))" + "lisp": "(lambda (text) (format nil \"~a{{planet}}~a\" text text))", + "pwsh": "\"$($args[0]){{planet}}$($args[0])\"" } }, "template": "<{{#lambda}}-{{/lambda}}>", @@ -153,7 +160,8 @@ "php": "return $text . \"{{planet}} => |planet|\" . $text;", "python": "lambda text: \"%s{{planet}} => |planet|%s\" % (text, text)", "clojure": "(fn [text] (str text \"{{planet}} => |planet|\" text))", - "lisp": "(lambda (text) (format nil \"~a{{planet}} => |planet|~a\" text text))" + "lisp": "(lambda (text) (format nil \"~a{{planet}} => |planet|~a\" text text))", + "pwsh": "\"$($args[0]){{planet}} => |planet|$($args[0])\"" } }, "template": "{{= | | =}}<|#lambda|-|/lambda|>", @@ -172,7 +180,8 @@ "php": "return \"__\" . $text . \"__\";", "python": "lambda text: \"__%s__\" % (text)", "clojure": "(fn [text] (str \"__\" text \"__\"))", - "lisp": "(lambda (text) (format nil \"__~a__\" text))" + "lisp": "(lambda (text) (format nil \"__~a__\" text))", + "pwsh": "\"__$($args[0])__\"" } }, "template": "{{#lambda}}FILE{{/lambda}} != {{#lambda}}LINE{{/lambda}}", @@ -192,7 +201,8 @@ "php": "return false;", "python": "lambda text: 0", "clojure": "(fn [text] false)", - "lisp": "(lambda (text) (declare (ignore text)) nil)" + "lisp": "(lambda (text) (declare (ignore text)) nil)", + "pwsh": "$false" } }, "template": "<{{^lambda}}{{static}}{{/lambda}}>", |