-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
代码注释编译异常 #311
Comments
版本是什么?能给出复现代码吗? 我自测没发现这个问题 @Test
public void commentTest() throws Exception {
String express = "/** 2 倍 **/ return 10";
ExpressRunner runner = new ExpressRunner(false, true);
DefaultContext<String, Object> context = new DefaultContext<>();
Object res = runner.execute(express, context, null, true, true);
System.out.println(res);
} |
我看到你的代码片段里面,2后面是打了空格的,如果去掉空格呢? |
版本:3.3.2 @Test
public void zsTest() throws Exception {
ExpressRunner runner = new ExpressRunner(true, false);
DefaultContext<String, Object> context = new DefaultContext<String, Object>();
// 定义表达式
String express = "/** 2倍 **/ 1+1";
System.out.println("表达式结果:" + runner.execute(express, context, null, true, true));
} |
@MoonNigth @cying314 确实有问题,我拉个分支修一下. 我之前用例里多了个空格, 导致当成数字解析通过了 |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
用/** **/注释代码,注释中出现“2倍”字样时,报错编译异常:NumberFormatException: For input string: "2倍"。
复现表达式:
/** 2倍 **/
The text was updated successfully, but these errors were encountered: