libdparse icon indicating copy to clipboard operation
libdparse copied to clipboard

PrimaryExpression and UnaryExpression are not decomposed

Open ghost opened this issue 5 years ago • 1 comments

PrimaryExpression and UnaryExpression are not decomposed and this has a negative impact on the amount of memory used.

UnaryExpression should be

class UnaryExpression : AstNode
{
    Expression exp;
}

and then

class PrefixExpression : UnaryExpression {}
class PreIncrementExpression : PrefixExpression {}
class PreDecrementExpression : PrefixExpression {}
class AtExpression : PrefixExpression {}
class DereferenceExpression : PrefixExpression {}
class PostfixExpression :  UnaryExpression {}
class IndexExpression : PostfixExpression {}
class DotExpression : PostfixExpression {}
/**\ ETC \**/

For example a.b.c takes almost 3 kB of memory.

ghost avatar May 20 '20 07:05 ghost

this is one of my primary things that concern me about the current API layout, let's try to get this in before a 1.0.0 release!

WebFreak001 avatar Mar 20 '23 03:03 WebFreak001