(#11331) Add support for foreach.

This adds support for "foreach" for arrays and hashes.
The implementation adds support for MethodCall and Lambda expressions to
the lexer and parser. 

A method call is simply a variant of function call that supports an
optional parameterized block (i.e. a lambda). The foreach method is
simply implemented as a function that accepts a "receiver" and a lambda.
The foreach function operates on arrays and hashes.

The implementation does not alter any existing syntax and does not
introduce any additional keywords or constraints on any lexer literals.

Since racc only has one token lookahead it was necessary to add such
lookahead in the lexer for LBRACE, which now produces a LAMBDA token if
 LBRACE is followed by PIPE. DOT token was reintroduced, and a PIPE
token added.

To allow a lambda to return the result of a single expression, the
syntax: {|...| = expr } may be used. Unfortunately, a major rewrite of
the grammar is required to allow this without a syntactic marker. Also
unfortunate is the fact that all functions invokable as statements does
not produce an rvalue and an rvalue function may not be used as a
statement. (To change that would also be a major rewrite). Hence, a
syntactic marker (in a lambda only), that allows a single expression to
be turned into a "rvalue" statment seems to be the best approach). If
the grammar is improved in the future, the = could be made optional.
(#11331) Add support to end a lambda with = expression.

This relaxes the constraint that a = expr must be the only statement
in a lambda (or be a sequence of statements). Is is now instead possible
to place this statement last after a sequence of statements.

This commit also fixes an issue where the last value of the lambda and
foreach function did not produce a value.
#(18764) Remove debug cruft.

There was an inspect in a rescue that was only there for debugging.
Now removed.
#(11331) Make implementation of lambda call work under Ruby 1.8.7

Under some conditions, array zip in ruby 1.8.7 produces a single value
instead of an array. The result was that the integer value of the first
char was produced as the result instead of the expected string.

This fix checks if the name value is just a string name, or an array
with [name, value].
(#11331) Remove debug cruft.
(yardoc) Correct yardoc for code related to #11331 add foreach.
(#11331) Make lambdas optionally available on all function calls.

This makes it possible to invoke foreach as:
foreach($a) {|$x| ... }

The only caveat is that a parentheses-less call must have at least one
argument. This is not allowed:
foo {|$x| }

If someone implements a function that takes only a lambda that call
would need to be written as:
foo() {|$x| }

This since it is not allowed to pass a lambda as an argument (since this
would require implementing real closures).
Merge branch '11331-add-foreach' into pops-foreach

Conflicts:
	lib/puppet/parser/ast/block_expression.rb
	lib/puppet/parser/grammar.ra
	lib/puppet/parser/parser.rb
Add 'each' with the same functionality as 'foreach' for Ux testing.

This adds 'each' function (a copy of foreach). This is done to enable Ux
testing of both styles. (Only one of them should remain in a released
version).