Age | Commit message (Collapse) | Author | Files | Lines |
|
Previously the future parser supported += and -=. += was very similar to
the same operator that is in the current parser, but with a few
differences to make it consistent with the rest of the
language. The += operator no longer performed string concatenation and
instead acted like $a = $a + $b. The -= operator was added to complete
the set of operators available.
However, many people have been confused by these operators (even as they
exist in the current parser):
* It looks like mutation, but the language does not have mutation
* It looks like += from other languages, but doesn't behave like them
* Shadowing a variable is something that needs to be explicit,
otherwise it becomes confusing.
This removes += and -= from the future parser. They are still parsed,
but the validation step will issue errors if they are encountered.
|
|
|
|
A test expected that $a -= x would return the result of the delete.
That is wrong, the expectation is that the RHS should be returned
to allow chaining of assignments. The test should have also
evaluated $a at the end to get the assigned value.
|
|
The evaluator made call to a fail function that just printed the
message without any details. This changes the behavior to use
the Pops::Issues system.
Many issues have been added. Some error messages were changed.
|
|
This adds more examples for -= and += for the parser and fixes issues
in the evaluator when evaluating -=.
|
|
There were examples missing that tests evaluation of match operator.
(shadow / no shadow, and if failed match alters match data or not).
|
|
This adds testing of variables, assignment and += assignment in various
forms. The + operator has been broken out to a separate method to be
used by both + and +=.
Corrects calls in runtime support (3x must have string variables names).
Corrects problems in the rspec helper w.r.t top/local scope and making
sure there is a topscope (to lookup ::x namespaced variables).
|
|
This commit contains the initial work on a new evaluator. It operates
on the output of the future parser.
|