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

script compare with negative number exception #832

Open
jiezenghuang opened this issue Jun 5, 2024 · 0 comments
Open

script compare with negative number exception #832

jiezenghuang opened this issue Jun 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jiezenghuang
Copy link

jiezenghuang commented Jun 5, 2024

version: 4.6.1

example as below:

static const char* xml_text = R"(
 <root BTCPP_format="4">
     <BehaviorTree>
        <Sequence>
            <Script code=" A:=0 " />
            <AlwaysSuccess _failureIf="A!=-1"/>
        </Sequence>
     </BehaviorTree>
 </root>
 )";

int main(int argc, char** argv)
{
    BT::BehaviorTreeFactory factory;

    try
    {
        auto tree = factory.createTreeFromText(xml_text);
        tree.tickWhileRunning();
    }
    catch(const std::exception& e)
    {
        std::cerr << e.what() << '\n';
    }  

    return 0;    
}

output:
Error in the script "A!=-1"
error: while parsing Grammar::Expression
|
1 | A!=-1
| ^ operator cannot be mixed with previous operators

@facontidavide facontidavide added the bug Something isn't working label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants