RustPython / RustPython/Parser

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

未关闭
#66 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Rust
星标
117
派生
38
平均合并
4 天 7 小时
30 天内合并 PR
1

描述

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

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 OUTPUT_FILES.zip 开始,针对列出的示例,将 python -m py_compile PY_FILE_TEST_427160.py 与 RustPython 的 parse(content.as_str(), Mode::Module, "").is_ok() 进行比较。重现并最小化不匹配,然后确定 parser 的行为是否与 Python 3.11.2 不同;当报告的差异已修复,或通过回归覆盖得到明确分类时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python, rust
领域
compilers, testing-qa
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。