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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Char Parsing #940

Closed
8 tasks done
gluax opened this issue May 11, 2021 · 0 comments 路 Fixed by #957
Closed
8 tasks done

[Feature] Char Parsing #940

gluax opened this issue May 11, 2021 · 0 comments 路 Fixed by #957
Assignees
Labels
documentation Improvements or additions to documentation feature A new feature.

Comments

@gluax
Copy link
Contributor

gluax commented May 11, 2021

馃殌 Feature

The goal is to add char as a Token and for it to be parsable to AST nodes.
Depends on #939.

Motivation

This helps the implementation goal of #929.

Implementation

Tokenizer Side

  • A new Char Token Enum should be created leo/parser/src/tokenizer/token.rs. This should go under the commented Types section.
  • A new CharLit Token Enum should be created leo/parser/src/tokenizer/token.rs. This should go under the commented Types section.

Parser Side

  • In parse_primary_expression should match on Token::CharLit and then parse the character to a AST Node ValueExpression leo/parser/src/parser/expression.rs.

Tests

  • Parser Tests:
    • Escaped Characters.
    • Hex Characters(although I suppose these could be grouped with the prior).
    • Valid Regular Characters.
    • Invalid Character Syntax.
@gluax gluax added feature A new feature. Implementation documentation Improvements or additions to documentation labels May 11, 2021
@gluax gluax self-assigned this May 12, 2021
@gluax gluax added this to the Leo Developer Preview III milestone May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature A new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant