MagicStack / MagicStack/MagicPython

Atom Hydrogen error "unexpected EOF while parsing" for python `if` statement!?

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

还没有人认领这个 Issue。

主要语言
JavaScript
星标
1.4k
派生
98
PR 合并指标
30 天内没有已合并 PR

描述

Seems to be a problem w/ how Atom interprets the code. `For` loops it will give me the option to "fold" or "collapse" by clicking the carrot in the line number. Yet, `if` loops have no such luck.

* **Editor name and version**: Atom 1.35.1
* **Platform**: Mac OS Sierra 10.12.6
* **Color scheme**: One Dark/Solarized Dark
* **MagicPython version**: 0.4.15
* **A sreenshot**:
![image](https://user-images.githubusercontent.com/2372346/55832867-7bf1d380-5ae4-11e9-94b9-83f23e6258de.png)

* **5-10 lines of surrounding code**:

```
## this works:
for i in range(10):
print( i)

## this doesn't:
if not False:
print("test worked")

```

贡献指南

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

从这里开始

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

调研方向

在报告的平台上,使用提供的 `for` 和 `if` 代码片段在 Atom 1.35.1 中重现该问题。首先跟踪用于处理这些语句的 Python folding 或 parsing 路径;报告中没有指明源文件或测试。完成的标准是 `if` 块能够像 `for` 块一样折叠,并且不会报告意外的 EOF 错误。

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

评估

技术栈
python
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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