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

Condition validation is not 100% correct #12

Open
johnnymast opened this issue Jul 11, 2021 · 0 comments
Open

Condition validation is not 100% correct #12

johnnymast opened this issue Jul 11, 2021 · 0 comments

Comments

@johnnymast
Copy link

Hi!,

While working on rivescript-php i was porting your checkSyntax function.

if ($line !~ /^.+?\s*(==|eq|!=|ne|<>|<|<=|>|>=)\s*.+?=>.+?$/) {
    return "Invalid format for !Condition: should be like `* value symbol value => response`";
}

This does not validate the usage of the == | != | ne | <> | < | <= | > | >= | characters.

The following script gets passed validation while the syntax of whats supposed to be eq male now says bleep male.

+ set gender
- <set gender=male>thank you

+ what is my gender
* <get gender> bleep male => You told me you were a boy.
* <get gender> eq female => You told me you were a girl.
- You never told me what you were.

I have tested this in the live testing environment as well and i didn't get any errors.

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