Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PrimaryExpression and UnaryExpression are not decomposed #409

Open
ghost opened this issue May 20, 2020 · 1 comment
Open

PrimaryExpression and UnaryExpression are not decomposed #409

ghost opened this issue May 20, 2020 · 1 comment
Milestone

Comments

@ghost
Copy link

ghost commented May 20, 2020

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.

@WebFreak001
Copy link
Member

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 WebFreak001 added this to the v1.0.0 milestone Mar 20, 2023
WebFreak001 added a commit to WebFreak001/libdparse that referenced this issue Mar 23, 2023
abstract classes should not have visitor functions, but rather only do
dynamic dispatch. This becomes more important later with dlang-community#409
WebFreak001 added a commit to WebFreak001/libdparse that referenced this issue Mar 23, 2023
abstract classes should not have visitor functions, but rather only do
dynamic dispatch. This becomes more important later with dlang-community#409
WebFreak001 added a commit to WebFreak001/libdparse that referenced this issue Mar 23, 2023
WebFreak001 added a commit to WebFreak001/libdparse that referenced this issue Mar 24, 2023
abstract classes should not have visitor functions, but rather only do
dynamic dispatch. This becomes more important later with dlang-community#409
WebFreak001 added a commit that referenced this issue Mar 24, 2023
abstract classes should not have visitor functions, but rather only do
dynamic dispatch. This becomes more important later with #409
WebFreak001 added a commit to WebFreak001/libdparse that referenced this issue Mar 24, 2023
WebFreak001 added a commit to WebFreak001/libdparse that referenced this issue Apr 5, 2023
WebFreak001 added a commit to WebFreak001/libdparse that referenced this issue May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant