FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

August 5th

Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message

Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Sat Aug 05, 2006 10:04 pm    Post subject: August 5th Reply with quote

More codegen done. Got index/dot expressions working properly, and fixed some temp register allocation issues. The only expression I have left is array constructors, and then it's just foreach, switches, and exception stuff.

There have also been some changes to the table grammar. They are:

  • Tables may no longer have "list-style" fields; that is, you can't write:
    { 1, 2, 3 }
    This is because the list-like functionality used commonly in Lua is in arrays in MiniD instead. It also simplifies the codegen for tables Wink

  • Because of the above, table fields which have an arbitrary expression as the index are more like Lua, i.e.
    { [4] = "hello", [foo() + 3] = 6 }
    This is because there is no longer any ambiguity as to what a left bracket means at the beginning of a table field.

  • Commas after table fields are now required, except after function-style fields, where they are optional.

I'm thinking about how to implement array constructors. See, in Lua, when constructing an "array," it codes the elements to a bunch of consecutive registers, then every n elements (called "fields per flush"), it sets them all in a chunk to the table. I find this kind of inelegant, as it involves increasing the size of the function's local stack to somewhat ridiculous levels, and if there are too many local registers already used, it will fail. Hmm.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group