lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Sorry, Sven, it's Sunday morning and my internal C parser hasn't booted yet.  Executive summary, please!

Linking directly to the patch source was probably a mistake :)

But there's not a lot to summarize, honestly.  It's a compound assignment patch -- and it manages registers more correctly than the prior version, with the result that complex expressions on either side of the statement should no longer result in strange bugs.  It works with multiple assignments in the ways that you'd expect.  For example, this will work:

function a(t) return cos(t), sin(t), 1 end
vx,vy,vx+=a(t)

Obvious left hand/right hand miss matches are parse errors -- the compiler won't allow `px,py+=v`.

The patch is posted on the power patch page.  

I've also finally made good on my earlier threats of posting a combined "Sven's favorite parser hacks" patch, documentation and source for which can be found on my bio page.  Said combined patch also contains a long, rambling comment at the start of lparser.c.  It contains some of my notes on parser hacking in general, along with some comments on how the compound assignment patch is implemented.

-Sven