Go over grammar for why there are duplicate (more) reductions.
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
Start with ./bin/uncompyle6 -g test/bytecode_2.5/10_if_else_ternary.pyc and compare the reductions with the older Python 2.7 grammar from git history or uncompyle2. Use git bisect to identify when duplicate rules appeared, then inspect the optional and recursive grammar changes and the more specific grammar selection. Done means the duplicate reductions are explained and the affected deparse no longer emits them.
索引モデルが issue の本文から書いたものです。
説明
Consider this deparse:
$ ./bin/uncompyle6 -g test/bytecode_2.5/10_if_else_ternary.pyc
# Python bytecode 2.5 (decompiled from Python 2.6)
# Embedded file name: simple_source/branching/10_if_else_ternary.py
...
exprlist ::= expr
compare ::= expr expr COMPARE_OP
compare ::= expr expr COMPARE_OP
cmp ::= compare
cmp ::= compare
expr ::= cmp
expr ::= cmp
...
In the good old days for Python 2.7 this used to be:
compare ::= expr expr COMPARE_OP
cmp ::= compare
expr ::= cmp
I suspect adding various optional nonterminals, e.g. come_from_opt for Python 3.5 is what caused this. And even here, the optional nonterminals were a result of fixing problems before I realized that python 2.7. structure analysis was needed in Python 3.
It is also possible that the duplication comes from changes to use left-recursive grammars. I read in wikipedia that left-recursive grammars for Early parsers generally gives linear parse time, but perhaps I shouldn't believe wikipedia? Or it could be the other way around, maybe I added a right-recursive rule instead of a left-recursive one. (If that's the case we should fix up spark to warn about right, or is it left, recursive rules.)
Tracking this down can be as simple as a git bisect, or reinstating the old 2.7 grammar say from uncompyle2 which should be in git history.
By the way, we now have ways to better select more specific grammars for sets of Python versions, so that could and should be used.
@moagstar is this something that interests you?
- 主要言語
- Python
- スター
- 4.3k
- フォーク
- 464
- 平均マージ
- 10時間 7分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rocky/python-uncompyle6 のほかの issue
-
Works on decompyle3
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rocky/python-uncompyle6#506 · コメント 1 件 ·
-
Python 3.8 Volunteer wanted Works on decompyle3
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rocky/python-uncompyle6#492 · コメント 4 件 ·
-
Redundant "else:"オープンControl Flow Python 3.8 Volunteer wanted Works on decompyle3
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
rocky/python-uncompyle6#486 ·
-
Missing "While True"オープンControl Flow Python 3.8 Volunteer wanted Works on decompyle3
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
rocky/python-uncompyle6#485 · コメント 4 件 ·
-
Duplicate Python 3.9+
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
rocky/python-uncompyle6#484 · リアクション 9 件 ·
rocky/python-uncompyle6 の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
gradio-app/gradio#13964 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 93/100
BSData/horus-heresy-3rd-edition#3232 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jbacalso24/mimry#123 ·
メンテナーはふだん 1 日以内に返信
-
p:3-mid pydanty:bug pydanty:is-working
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
pydantic/pydantic-ai#10153 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
good first issue priority: medium size: S testing
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
cubrid-lab/cubrid-cookbook-python#316 ·
メンテナーはふだん 1 日以内に返信