Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

`3 i` parses as `3 ^ i`: an imaginary literal after a factor is read as its exponent

未关闭
#1,503 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

Start with Syntax.md and SyntaxDocumentedTest, which document and pin the current juxtaposition rule. Trace the parser entry point used by ToEntity() and inspect how imaginary literals are classified after a factor. Done means the proposed imaginary-literal cases parse as multiplication, existing power cases remain unchanged, and the documentation test reflects the new rule.

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

描述

3 i parses as 3 ^ i, not 3 * i, so sin(3 i) is evaluated at 3^i (about 0.455 + 0.891i):

"sin(3 i)".ToEntity()   ->  sin(3 ^ i)
"x i".ToEntity()        ->  x ^ i
"(1 + 2) i".ToEntity()  ->  (1 + 2) ^ i
"2 i x".ToEntity()      ->  2 ^ i * x

2.5.0 does the same. The juxtaposition rule inserts ^ before a number written after a number, a name or ), so that x2 is x ^ 2. The lexer reads i as a number, so the rule applies to it as well. Syntax.md records this as a consequence of the rule since #1041, and SyntaxDocumentedTest pins "x i" as "x ^ i".

Proposal: an imaginary literal written after a factor is a factor too. 3 i would be 3 * i and x 2i would be x * 2i, while x2, 3 2 and (x + 1)2 stay powers. 3i, written as one literal, is already 3i. I'd change the rule and the documented row together. Is that the reading you want?

主要语言
C#
星标
831
派生
79
平均合并
2 小时 22 分钟
30 天内合并 PR
507

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

ASC-Community/AngouriMath 的其他 Issue

查看 ASC-Community/AngouriMath 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

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