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

[Feature] String Parsing #944

Closed
8 tasks done
gluax opened this issue May 11, 2021 · 1 comment · Fixed by #974
Closed
8 tasks done

[Feature] String Parsing #944

gluax opened this issue May 11, 2021 · 1 comment · Fixed by #974
Assignees
Labels
feature A new feature.

Comments

@gluax
Copy link
Contributor

gluax commented May 11, 2021

🚀 Feature

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

Motivation

This helps the implementation goal of #929.

Implementation

Tokenizer Side

  • A new String Token Enum should be created leo/parser/src/tokenizer/token.rs. This should go under the commented Types section.
  • A new StringLit 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::StringLit and then parse the string to a AST Node ValueExpression leo/parser/src/parser/expression.rs.

Tests

  • Parser Tests:
    • Escaped Characters inside the String.
    • Hex Characters(although I suppose these could be grouped with the prior) inside the String.
    • Valid String Syntax.
    • Invalid String Syntax.
@damirka
Copy link
Contributor

damirka commented May 26, 2021

Closed by #957.

@damirka damirka closed this as completed May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants