Program_root block

Given the code:

mobBlockNode = cast( ipobNode, BlockNode ).
mobBlock = mobBlockNode:getBlock().
mlgIsMethod = mobBlock:isMethodBlock().
mlgIsProgram = mobBlock:isProgramBlock().

for a node which is a block node, I would expect the Program_root node to give IsProgramBlock, but instead it gives IsMethodBlock. Why?

Curious too why the CLASS node is not considered a BLOCK.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tamhas's picture

I do see that CLASS has a

I do see that CLASS has a child Code_block which functions as the container for the things scoped to the class, but class level variables and methods show a scope of Program_root rather than CLASS or Code_block. This seems odd to me.

tamhas's picture

Popping this back to the

Popping this back to the top. I've just run again into the CLASS not being a block, which seems curious.