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

ネストした名前空間下の変数を参照できない #629

Closed
takejohn opened this issue Apr 20, 2024 · 2 comments · Fixed by #630
Closed

ネストした名前空間下の変数を参照できない #629

takejohn opened this issue Apr 20, 2024 · 2 comments · Fixed by #630
Assignees

Comments

@takejohn
Copy link
Contributor

名前空間をネストしてもエラーになりませんが、その配下の変数を参照しようとするとエラーが発生します。

再現方法

次のような AiScript コードを実行すると

:: Ns1 {
  :: Ns2 {
    let a = 42
  }
}

<: Ns1:Ns2:a

次のエラーが発生します。

Runtime: No such variable 'Ns1:Ns2:a' in scope '<root>'
@FineArchs
Copy link
Member

FineArchs commented Apr 20, 2024

case 'ns': {
break; // TODO
}

これ確か未実装でTODOになってるやつですね
そんなに難しい仕組みではなかったはずなので早めに実装したいという気持ちはあります

@takejohn
Copy link
Contributor Author

case 'ns': {
break; // TODO
}

これ確か未実装でTODOになってるやつですね
そんなに難しい仕組みではなかったはずなので早めに実装したいという気持ちはあります

ありがとうございます。
手を加えてみようと思います。

FineArchs pushed a commit that referenced this issue Apr 22, 2024
* 接頭辞付き変数を追加する機能をScopeクラスに移動

* ネストされた名前空間下の変数を参照できるように
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants