vidarh / writing-a-compiler-in-ruby

Code from my series on writing a Ruby compiler in Ruby
http://www.hokstad.com/compiler
274 stars 22 forks source link

Need to handle constants in module scope etc. #8

Open vidarh opened 15 years ago

vidarh commented 15 years ago

ClassScope should inherity from ModuleScope. ModuleScope needs to hold constants.

"Global" constants should be held in a module scope - either make GlobalScope inherit from ModuleScope too, or introduce a ModuleScope in between GlobalScope and the next step down.

Need provisional support for "include" as well as dereferencing ("::"). Note that currently "::" is treated as :callm. Probably need to reverse that change and rewrite to :callm or keep as :deref depending on the right hand side.