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】不以分号结尾的let 语句执行报错 #551

Open
hug3id opened this issue Jun 21, 2023 · 0 comments
Open

【BUG】不以分号结尾的let 语句执行报错 #551

hug3id opened this issue Jun 21, 2023 · 0 comments

Comments

@hug3id
Copy link

hug3id commented Jun 21, 2023

AviatorEvaluator.execute("let a = 3", env); // 本意是想通过脚本往env里put一个变量

执行报错,aviator版本5.3.3
Exception in thread "main" com.googlecode.aviator.exception.ExpressionSyntaxErrorException: Syntax error: missing ';' for let statement at 9, lineNumber: 1, token : null,
while parsing expression: let a = 3^^^at com.googlecode.aviator.AviatorEvaluatorInstance.innerCompile(AviatorEvaluatorInstance.java:1545)

另外能否提供一个全局选项控制变量必须经过let显式声明后才能使用?类似visual basic里的Option Explicit,无需声明很容易误用:
let date = now();
data = data + 1 // 拼写错误,执行报错语句不够清晰易懂,如果能提示data未声明会好很多

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

1 participant