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

Add warning about lexer keywords and their order #26

Closed
MuresanVladMihail opened this issue Mar 5, 2019 · 2 comments
Closed

Add warning about lexer keywords and their order #26

MuresanVladMihail opened this issue Mar 5, 2019 · 2 comments

Comments

@MuresanVladMihail
Copy link
Contributor

MuresanVladMihail commented Mar 5, 2019

/* IMPORTANT: This must follow the enum found in be_lexer.h !!! */
static const char* const kwords_tab[] = {
        "NONE", "EOS", "ID", "INT", "REAL", "STR",
        "=", "+", "-", "*", "/", "%", "<", "<=",
        "==", "!=", ">", ">=", "..", "<<", ">>", "^", "|", "&", "&&",
        "||", "!",  "~",
        "(", ")", "[", "]", "{", "}", ".", ",", ";",
        ":", "if", "elif", "else", "while", "for",
        "def", "end", "class", "break", "continue",
        "return", "true", "false", "nil", "var", "do",
        "import", "as", "require",
};

At first I didn't realize I must follow the pattern but then my tests started to fail and after an investigation I figured it out.

Edit 1: Once again, I cannot stress this enough but berry needs more tests (for each kind of operation) and documentation :D
Edit 2: Basically it needs a file which you can run before commiting new changes and if that test(which is composed of several tests) passes then you are sure you didn't break the language.

@skiars
Copy link
Member

skiars commented Mar 5, 2019

Nice, welcome to PR.

@MuresanVladMihail
Copy link
Contributor Author

#27

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