Leopold Toetsch <[EMAIL PROTECTED]> wrote:
> 3) Proposal: PIR syntax enhancement
> .pragma n_operators
> ...
> Px = Py + 1
> ...
> [EOF]
> Within this pragma (valid inside and until end of file) the shortcuts
> '+', '-', ... should translate to "n_add", "n_sub", ...
> This simplifies the adaption of already existing compiler code and is a
> bit more readable.
Done now.
.pragma n_operators 0 # off
.pragma n_operators 1 # turn it on
WRT include files: the intended behavior is that the state of the
n_operators setting reverts to the state before the file inclusion:
.pragma n_operators 1
...
.include "foo.imc"
# n_operators is 1 again
*But* inside the include file the last pragma setting is used. This can
be changed easily by not copying the setting in imcc.l:new_frame().
OTOH we could just demand that include files with code have to set /
reset that pragma to the desired value. It's kind of a documentation how
the semantics of
a = b + c # new a PMC or not
actually are inside that file.
After we have found a consensus I'd be glad with some tests additionally
to the one in t/pmc/n_arithmetics.t
Thanks,
leo