Implement function overriding syntax extension, fixing a bug on the way.

The funcoverride option allows defining multiple functions with the same name, each overriding the former. That's for compatibility with Firestorm, whose optimizer does that.

While on it, fix a bug where defining a function whose name matches a library function was not reporting an error, and rename self.functions to self.funclibrary for clarity. It also brings consistency with other parts of the code and with the code documentation.
This commit is contained in:
Sei Lisa 2015-03-27 00:26:56 +01:00
parent 3839863a21
commit 921955f321
2 changed files with 39 additions and 15 deletions

View file

@ -234,6 +234,9 @@ Optimizer options (+ means active by default, - means inactive by default):
Like lazylists, it's implemented for compatibility with
Firestorm, but not recommended. Note that the operand to
switch() may be evaluated more than once.
funcoverride - Allow duplicate function definitions to override the
previous definition. For compatibility with Firestorm's
optimizer.
Optimization options