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

Eats up all my RAM during building then dies. #78

Closed
Amanita-muscaria opened this issue Jun 2, 2019 · 1 comment
Closed

Eats up all my RAM during building then dies. #78

Amanita-muscaria opened this issue Jun 2, 2019 · 1 comment

Comments

@Amanita-muscaria
Copy link

So I'm realizing that what I actually need is a parser/lexer. However, I don't know if that relates to chewing up all the memory or not so I figured I'd submit this anyway just in case it helps solve a problem.

This is the lexer I'm working with

#[derive(Logos, Debug, PartialEq)]
enum Token {
    #[end]
    End,
    #[error]
    Error,

    // #[regex = r"(?s)/\*.*\*/"]
    // BlockCommentStart,
    //
    // #[regex = r"//.*\n?"]
    // LineComment,

    #[regex = r"/\s*\{"]
    RootNode,

    #[regex = r"\s*([[:digit:][:alpha:]_]*:)?\s*[[:digit:][:alpha:],._+@-]*\s*\{"]
    Node,

    #[regex = r"\s*};"]
    NodeEnd,

    #[regex = r#"(?m)\s*[#[:digit:][:alpha:],._+-]*\s*=\s*(<|"|\[)[[:alpha:][:digit:],]*(>|"|\]);"#]
    Property,

    #[regex = r"\s/[[:alpha:]-]*/\s[[:alpha:][:digit:]_&@-]*;\n?"]
    Directive,

    #[regex = r#"\s*#include (<|")[[:alpha:][:digit:]_-]*\.(h|(dtsi))(>|")"#]
    Include,

    // #[regex = r"\s*[[:alpha:][:digit:],#]*\n"]
    // NonStdProperty,
}

The problem is that, in addition to taking forever to finish, it will use up all 16GB of RAM on my machine and then die when it tries to grab another ~41MB at some point.

If this is doing more than what Logos is supposed to, go ahead and close this out.

@maciejhirsz
Copy link
Owner

Going to aggregate this under #70.

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

2 participants