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

Rust: update lexer for the latest version of Rust #1649

Merged
merged 2 commits into from
Jan 18, 2022

Conversation

nsfisis
Copy link
Contributor

@nsfisis nsfisis commented Dec 10, 2020

Language

Rust (version 1.48, the latest stable as of 10th December 2020)

Description

Update the lexer to fit the latest version of Rust language.

Remove constant nil

The word nil has no special meaning in the latest version of Rust.

Update keyword list

The old keyword list seems to refer to pre-1.0 Rust, I don't know well about that though.

They are keywords in the latest version of Rust.

  • abstract
  • become
  • final
  • in
  • override
  • typeof
  • unsized
  • virtual

Removed:

They are not keywords in the latest version of Rust.

  • assert
  • copy
  • drop
  • fail
  • pure

cf. https://doc.rust-lang.org/reference/keywords.html

@lunabunn
Copy link

lunabunn commented Feb 5, 2021

@nsfisis you mentioned that you modified the integer suffixes, but I'm assuming #1664 is still reproducible with your patch? (assuming that's being caused by integer suffixes in the first place)

@nsfisis
Copy link
Contributor Author

nsfisis commented Feb 13, 2021

@nsfisis you mentioned that you modified the integer suffixes, but I'm assuming #1664 is still reproducible with your patch? (assuming that's being caused by integer suffixes in the first place)

I fixed it. commit: bf677d5
Now, tokens starting with an underscore are parsed as variables.

@tancnle
Copy link
Collaborator

tancnle commented Sep 22, 2021

Related to #1711

The word "nil" has no special meaning in the latest version of Rust.
Added:

They are keywords in the latest version of Rust.

* `abstract`
* `become`
* `final`
* `in`
* `override`
* `typeof`
* `unsized`
* `virtual`

Removed:

They are *not* keywords in the latest version of Rust.

* `assert`
* `copy`
* `drop`
* `fail`
* `pure`
@nsfisis nsfisis force-pushed the rust/improve-lexer branch from bf677d5 to fb3151e Compare November 7, 2021 03:23
@nsfisis
Copy link
Contributor Author

nsfisis commented Nov 7, 2021

Update commits and PR description as #1711 conflicted with it.

@tancnle tancnle added the needs-review The PR needs to be reviewed label Jan 18, 2022
@tancnle
Copy link
Collaborator

tancnle commented Jan 18, 2022

Thank you for your contribution @nsfisis ❤️ The changes look good to me 👍🏼

@tancnle tancnle merged commit 5d45948 into rouge-ruby:master Jan 18, 2022
@nsfisis nsfisis deleted the rust/improve-lexer branch January 18, 2022 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review The PR needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants