Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG - Variable initializer expression (using with brackets) #6

Closed
r-koubou opened this issue Mar 21, 2018 · 2 comments
Closed

BUG - Variable initializer expression (using with brackets) #6

r-koubou opened this issue Mar 21, 2018 · 2 comments
Labels
bug (Difficult to Solve) Bug will be fixed. However very take a time to solve. (a few weeks~months or more)
Milestone

Comments

@r-koubou
Copy link
Owner

r-koubou commented Mar 21, 2018

Sorry, written in Japanese and this bug is very difficult to solve..

本来KSPの言語仕様上問題がないが、以下の場合、初期化処理で誤検出をする

EXPECT/期待する動作

declare $num := ( 2 * 3 ) + 1  {OK}

NOW/現状

declare $num := (2 * 3 ) + 1  {NG:Syntax Error}

Workaround/回避方法

代入式の最初で括弧を使わない方法を検討してください。

declare $num := 7
or
declare $num := 2 * 3 + 1

Cause/原因

最初の式の括弧が【配列初期化子】なのか、【数学的な意味での括弧】なのかの判別が出来ない

declare $num := (2 * 3 ) + 1
{ この場合、(2*3)が配列初期化として誤検出されてしまう }

eBNFで初期化式を厳密に定義出来ていないため、構文解析フェーズでエラーになる。

強引にASTで表現すると、以下のようになる。KSPの仕様から逸脱した、支離滅裂な状況である。

                           < := >
                             +
                             |
                           < + >
                             |
                +------------+-----------+
                |                        |
       <Array Initializer>               1
                |
                + 
              < * > index[ 0 ]
                +
                |
            +--------+
            |        |
            2        3

Why difficult to solve / 修正困難な理由

最初の式の括弧が配列初期化子なのか、数学的な意味での括弧なのかの判別が出来ない。
解決するには、eBNFを書き直し、各種フェーズの処理を根本的に見直さなければならない

修正に伴う影響範囲を考えると、長時間の時間確保が必要であると考えている。

@r-koubou r-koubou added the bug (Difficult to Solve) Bug will be fixed. However very take a time to solve. (a few weeks~months or more) label Mar 21, 2018
@r-koubou r-koubou changed the title Bug - Variable initializer expression (using with brackets) BUG - Variable initializer expression (using with brackets) Mar 22, 2018
r-koubou added a commit that referenced this issue Mar 23, 2018
@r-koubou
Copy link
Owner Author

r-koubou commented Mar 23, 2018

WIP: temporary fixes / 仮対応版

-> stable version (*NO SUPPORT)

@r-koubou r-koubou added this to the vsce-0.4.0 milestone Mar 26, 2018
@r-koubou
Copy link
Owner Author

Done. Apply to vsce 0.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug (Difficult to Solve) Bug will be fixed. However very take a time to solve. (a few weeks~months or more)
Projects
None yet
Development

No branches or pull requests

1 participant