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

含中文标识符时报错信息有误 #33

Open
nobodxbodon opened this issue Jul 21, 2021 · 6 comments
Open

含中文标识符时报错信息有误 #33

nobodxbodon opened this issue Jul 21, 2021 · 6 comments

Comments

@nobodxbodon
Copy link
Contributor

#32 时注意到的:

畀我睇下 某 点样先?
=> 濑嘢!请先定义‘endprint’再使用
畀我睇下 x某 点样先?
=> 濑嘢!请先定义‘x’再使用
@StepfenShawn
Copy link
Owner

这个是语法的规定,定义有中文的变量名要使用"|"
畀我睇下 |某| 点样先?
畀我睇下 |某x| 点样先?

@nobodxbodon
Copy link
Contributor Author

啊英文变量就可以不用 ||?之前还以为 || 是无论中英都是可加可不加的。
这个设计不知是出于何考虑呢?感觉用中文变量的时候应该更多吧。

@StepfenShawn
Copy link
Owner

当满屏都是中文代码时加上"||"就可以清楚地区分出变量和关键字

@nobodxbodon
Copy link
Contributor Author

可否做成不强制呢?尤其有了 IDE 的高亮,各语法元素的区分度应该就足够了?比如第一行里去掉 ||:
Screen Shot 2021-07-21 at 7 27 11 PM
而且上面代码中 返转头 |fib(项数 - 1) + fib(项数 - 2)| 又不需 || 包围引用的 ”项数“,这样似乎风格不一致?

@StepfenShawn
Copy link
Owner

@nobodxbodon 已更新, 中文变量声明可以不加"|"了

@nobodxbodon
Copy link
Contributor Author

赞!刚测过了。
没看出是哪个commit搞定的,建议将 #33 加在commit 信息,关联上issue和commit方便追溯。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants