Hundread of files that are properly parsed(or not) in opposite to Python 3.11.2

Offen
#66 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
python, rust

Rechercherichtung

Beginne mit OUTPUT_FILES.zip und vergleiche python -m py_compile PY_FILE_TEST_427160.py mit RustPythons parse(content.as_str(), Mode::Module, "").is_ok() für die aufgeführten Beispiele. Reproduziere und minimiere die Abweichungen und ermittle dann, ob sich das Parserverhalten von Python 3.11.2 unterscheidet; abgeschlossen ist die Aufgabe, wenn die gemeldeten Abweichungen behoben oder mit Regressionstests eindeutig klassifiziert sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

d23611db65dca2a71eb58fdcdce9d637f8fef8c2

When parsing with this repo multiple files, I found that sometimes python cannot parse file but this library can and vice versa.

Command to check if python can parse file

python -m py_compile PY_FILE_TEST_427160.py

Code to check if parser can parse file

let rust_valid = parse(content.as_str(), Mode::Module,"").is_ok();

Only ~3% files from pack, can be parsed by python, but not rustpython parser

Pack 644 files - OUTPUT_FILES.zip

Example files and errors

return imprt

SyntaxError: 'return' outside function
\
 import _pl

Sorry: IndentationError: unexpected indent (79285088PY_FILE_TEST_5137609254.py, line 2)
# encoding: ut

SyntaxError: unknown encoding: ut
__p|ersion__ = '2.9.0'

SyntaxError: cannot assign to expression here. Maybe you meant '==' instead of '='?
from __future__ import un

SyntaxError: future feature un is not defined
Vorherrschende Sprache
Rust
Sterne
117
Forks
38
Ø Merge
4 T. 7 Std.
Gemergte PRs (30 T.)
1

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus RustPython/Parser

Alle Issues in RustPython/Parser

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.