slang-users mailing list

[2014 Date Index] [2014 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] parser confuses floating point literals and RPN_TOKENs


Manfred Hanke <Manfred.Hanke@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> If RPN is to stay, one might consider improving

It has to be supported because jed makes use of this in a number of
places.  See e.g., dcl.sl and the setkey statements in wordstar.sl.
This mode stems from a time when both syntaxes had to be supported as
slang was transitioning to the current syntax.

Since I cannot 100% remove the ambiguity now, the most pragmatic
approach would be, as you suggest, to change
slsh_interactive_massage_hook, and then document that in scripts
floating point literals occuring at the beginning of a line must not
start with a leading ".".

For slsh, I just pushed a change (based upon your patch) that causes
a line to be interpreted using RPN syntax only when it begins with a
period followed by a space (". ").  Then,

  slsh> .5    ==> .5
  slsh> . 5   ==> 5 in RPN mode

Thanks Manfred,
--John
_______________________________________________
For list information, visit <http://jedsoft.org/slang/mailinglists.html>.


[2014 date index] [2014 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]