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

针对数字开头的上下文key支持有问题 #6

Closed
truechuan opened this issue Oct 17, 2017 · 2 comments
Closed

针对数字开头的上下文key支持有问题 #6

truechuan opened this issue Oct 17, 2017 · 2 comments

Comments

@truechuan
Copy link

下面的测试用例执行会解析不了上下文的值
@test
public void testArithmetic_map() throws Exception {
ExpressRunner runner = new ExpressRunner(true, true);
runner.addMacro("计算平均成绩","(90天浏览时长 + 数学 + 英语)/3");
IExpressContext<String, Object> context =new DefaultContext<String, Object>();
context.put("90天浏览时长", 88);
context.put("数学", 99);
context.put("英语", 95);
System.out.println(runner.execute("计算平均成绩", context, null, true, false));
}

[90天浏览时长]这样的key读取会有问题,具体的错误逻辑应该在ExpressParse.class中的transferWord2ExpressNode,针对数字开头的key没有考虑上述的特殊情况。
不知道还能不能更新啦改项目,我这边自己打个分支先改造了把

@baoxingjie
Copy link
Contributor

你的分支给我看下呢,可以通过微信和email深入交流下,因为数字开头的变量也是java语法不识别的。

@zhengm-hub
Copy link

zhengm-hub commented May 13, 2019

@baoxingjie 现在支持了吗?

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

3 participants