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

表达式语法检查错误,"OR(1<2, 2>3)" 语法检查正确,"or(1<2, 2>3)" 语法检查错误。 #323

Open
jc0803kevin opened this issue Apr 23, 2024 · 3 comments

Comments

@jc0803kevin
Copy link

表达式语法检查错误,"OR(1<2, 2>3)" 语法检查正确,"or(1<2, 2>3)" 语法检查错误。

private boolean syntaxCheck(String express){
        try {
            ExpressRunner runner = new ExpressRunner(false, true);
            DefaultContext<String, Object> context = new DefaultContext<>();
            InstructionSet set = runner.parseInstructionSet(express);
        } catch (Exception e) {
            return false;
        }
        return true;
    }
[{
    "value_of_expectation": true,
    "formula":"OR(1<2, 2>3)"
  },
  {
    "value_of_expectation": true,
    "formula":"or(1<2, 2>3)",
    "remark": "小写的or会存在误判"
  }]
@jackie-coming
Copy link
Contributor

[

v3.3.3 没有复现
image

@jc0803kevin
Copy link
Author

or(1<2, 2>3)

<QLExpress.version>3.2.2</QLExpress.version>

image

@jc0803kevin
Copy link
Author

or(1<2, 2>3)

<QLExpress.version>3.2.2</QLExpress.version>

image

`@Test
public void syntaxCheck(){

	syntaxCheck("or(1<2, 2>3)");

}
private boolean syntaxCheck(String express){
	try {
		ExpressRunner runner = new ExpressRunner(false, true);
		DefaultContext<String, Object> context = new DefaultContext<>();
		InstructionSet set = runner.parseInstructionSet(express);
	} catch (Exception e) {
		e.printStackTrace();
		return false;
	}
	return true;
}`

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