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

Prevent minify from generating reserved prefixes in Rust 2021 edition #7

Merged
merged 3 commits into from
Aug 5, 2023

Conversation

mizar
Copy link
Contributor

@mizar mizar commented May 29, 2023

minify によって Rust 2021 edition の Reserved Prefixes に該当するような出力を生成してしまわないようにするための変更の提案です。

  • { RAW_IDENTIFIER (例えば r# もしくは br# から始まるidentifier) もしくは RESERVED_TOKEN_POUND (それ以外の # 文字を含む IDENTIFIER) } ( AlnumUnderscoreQuote とは別扱いで、 PoundIdent という分類を作成 ) に対して Punct # 文字が後続した場合、空白文字は挿入しません。それ以外の IDENTIFIER (AlnumUnderscoreQuote) に Punct # 文字が後続した場合は、空白文字を挿入します。
  • 上記ケースを除き、 AlnumUnderscoreQuote に Punct # " ' の何れかが後続した場合、空白文字を挿入します。
  • minifyによって Reserved Prefixes を生成してしまう恐れのあったテストケースを幾つか追加。

@qryxip
Copy link
Owner

qryxip commented Aug 5, 2023

ありがとうございます。マージします。

@qryxip qryxip merged commit 09a62b8 into qryxip:master Aug 5, 2023
@qryxip qryxip linked an issue Aug 5, 2023 that may be closed by this pull request
@mizar mizar deleted the rust2021 branch August 6, 2023 07:42
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

Successfully merging this pull request may close these issues.

Incompatible minify results with Rust 2021
2 participants