MagicStack / MagicStack/MagicPython

Grammar could support the walrus operator

オープン
#204 コメント 0 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
JavaScript
スター
1.4k
フォーク
98
PR マージ指標
30日以内にマージされた PR はありません

説明

From @BornForFever in https://github.com/microsoft/vscode/issues/94999

The walrus operator `:=`(an operator to allow you to make assignments in an expression, see [PEP 572](https://www.python.org/dev/peps/pep-0572)) is highlighted as 2 different colors. And I tried inspecting tokens and scopes, and found that `:` and `=` were treated as 2 tokens.

* **Editor name and version**: VS Code 1.44
* **Platform**: any
* **Color scheme**: Well illustrated with [Atom One Darker](https://github.com/christopherafbjur/vscode-theme-onedarker)
* **MagicPython version**: commit 0b09c1fca238d22e15ac5712d03f9bf6da626f9c
* **A sreenshot**: ![批注 2020-04-11 222317](https://user-images.githubusercontent.com/62426149/79046371-314cef00-7c43-11ea-89cd-8ec7dac5c2c7.png)
![批注 2020-04-11 222406](https://user-images.githubusercontent.com/62426149/79046374-33af4900-7c43-11ea-92bf-5da3e622da99.png)
* **5-10 lines of surrounding code**:
```python
if m := x
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

issue ではソースファイルもテストも指定されていません。まず `:=` を担当する Python の文法とトークンのスコープ規則を見つけ、次に `if m := x` に対して生成されるスコープを、意図された単一の walrus-operator トークンと比較してください。オペレーターが一貫してハイライトされ、コロンとイコールが別々のトークンではなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, python
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。