From 46ce36b175962ce89e06af4863d2c9dc50f2a02f Mon Sep 17 00:00:00 2001 From: luke Date: Wed, 26 Apr 2006 05:39:58 +0000 Subject: Creating a simplistic, generic function framework in the parser, so it is now very easy to add new functions. There is a pretty crappy, hardwired distinction between functions that return values and those that do not, but I do not see a good way around it right now. Functions are also currently responsible for handling their own arity, although I have plans for fixing that. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1134 980ebf18-57e1-0310-9a29-db15c13687c0 --- examples/code/snippets/tagged.pp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 examples/code/snippets/tagged.pp (limited to 'examples/code/snippets') diff --git a/examples/code/snippets/tagged.pp b/examples/code/snippets/tagged.pp new file mode 100644 index 000000000..f4d6ff7ca --- /dev/null +++ b/examples/code/snippets/tagged.pp @@ -0,0 +1,25 @@ +# $Id$ + +tag testing +tag(funtest) + +$yayness = tagged(yayness) ? { + true => "true", false => "false" +} + +$testing = tagged(testing) ? { + true => "true", false => "false" +} + +$both = tagged(testing, yayness) ? { + true => "true", false => "false" +} + +$bothtrue = tagged(testing, testing) ? { + true => "true", false => "false" +} + +file { "/tmp/taggedyayness$yayness": ensure => file } +file { "/tmp/taggedtesting$testing": ensure => file } +file { "/tmp/taggedboth$both": ensure => file } +file { "/tmp/taggedbothtrue$bothtrue": ensure => file } -- cgit