(#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.
(#18764) Add methods for enumerable functions.

This adds support for the functions/methods collect, reject, select, and
reduce. This implementation depends on support for lambdas being added
in puppet as described in issue #11331). Which probably will be released
in puppet 3.2.
Merge branch '11331-add-foreach' into 18764-enumerable-methods

Conflicts:
	lib/puppet/parser/lexer.rb
Merge branch '11331-add-foreach' into 18764-enumerable-methods
Merge branch '18764-enumerable-methods' into pops-enumerables