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

不支持使用负号“-” #345

Open
starShinning opened this issue Aug 19, 2024 · 0 comments
Open

不支持使用负号“-” #345

starShinning opened this issue Aug 19, 2024 · 0 comments

Comments

@starShinning
Copy link

@Test
public void qlBigDecimalTest() throws Exception {

    ExpressRunner runner = new ExpressRunner(true, false);
    runner.setShortCircuit(true);
    DefaultContext context = new DefaultContext();
    BigDecimal value = new BigDecimal("12.22");
    context.put("b", value);
    Object execute = runner.execute("-b", context, null, false, false);
    System.out.println(execute);
}

com.ql.util.express.exception.QLCompileException: 程序错误,不满足语法规范,没有匹配到合适的语法,最大匹配致[0:-1]

at com.ql.util.express.match.QLPattern.findMatchStatement(QLPattern.java:30)
at com.ql.util.express.parse.ExpressParse.parse(ExpressParse.java:404)
at com.ql.util.express.parse.ExpressParse.parse(ExpressParse.java:362)
at com.ql.util.express.parse.ExpressParse.parse(ExpressParse.java:335)
at com.ql.util.express.ExpressRunner.parseInstructionSet(ExpressRunner.java:678)
at com.ql.util.express.ExpressRunner.executeInner(ExpressRunner.java:638)
at com.ql.util.express.ExpressRunner.execute(ExpressRunner.java:629)
at com.example.demo.ExpressTest.qlBigDecimalTest(ExpressTest.java:74)

使用过程中想直接转为负数,但是报错。
这个有什么方法能处理吗,还是只能写成 "0-b"

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