Ilya Zakharevich on Mon, 22 Nov 1999 13:43:23 -0500 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Turning a sequence of expr into expr |
On Mon, Nov 22, 1999 at 03:47:51PM +0100, Karim BELABAS wrote: > [Ilya:] > > Then this should be marked in the "prototype", and the parser should > > emit a syntax error in such a situation. The simplest way to do it is > > to make lisexpr() to die if it finds ';' at the end, and make lisseq() > > use a clone lisexpr_seqok() instead. > > I introduced a new parser code for the function "prototypes" (from GP point > of view). Namely 'E' for an argument which is a single expression (read by > lisexpr()). 'I' remains the same and accepts a sequence of statements. > All genuine control statements + the constructors (vector/matrix) accept a > seq. All others expect an expr. [ I believe I have correctly updated the > numeric code for Math::Pari ] Oups, Karim, this means that string-code parsing logic of Math::Pari should be changed. Why not add a code 'M' for "many statements" instead (and use it with those rare [control-flow] opcodes which take a seq? Ilya