Order of operations in integer arithmetic is wrong
まだ誰も着手していません。
評価
調査の方向性
まず Ink で3つの算術例を再現し、演算子の優先順位を担う parser または evaluator のエントリーポイントを追跡してください。issue にはファイルもテストも指定されていません。乗算と除算が期待される左から右への動作に従い、既存の Ink スクリプトへの互換性の影響が考慮され、報告された式が検証されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Reproduce
{ 10 * 8 / 10 }
Expected Output
8
Observed Output
0
Workaround
{ (10 * 8) / 10 }
I'd expect the order of operations to go left to right, as is generally the case with other environments/programming languages. Unfortunately, fixing this might break existing Ink scripts that rely on this behavior. Also unfortunately, there's probably a lot of scripts out in the while that have bugs in them because of this bug.
Addendum
Looking at the following examples, it seems that the problem is that division has a higher priority than multiplication, which it shouldn't:
- Forcing right-to-left evaluation: { 10 / (2 * 2) } -> 2
- Forcing left-to-right evaluation: { (10 / 2) * 2 } -> 10
- Without brackets: { 10 / 2 * 2 } -> 10
- 主要言語
- C#
- スター
- 5k
- フォーク
- 550
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
inkle/ink のほかの issue
-
inklecate stack overflow - Knot and variable with same name対応中かも @voidsipp が 18 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
Tunnelsオープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
Fallback choices become visible after reloading the story state対応中かも @tvararu が 382 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
似ている issue
-
type:task ux
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
elsa-workflows/elsa-foundation#5253 ·
メンテナーはふだん 1 日以内に返信