beltoforion / muparserx

A C++ Library for Parsing Expressions with Strings, Complex Numbers, Vectors, Matrices and more.
http://beltoforion.de/en/muparserx
BSD 2-Clause "Simplified" License
136 stars 60 forks source link

fail at parsing boolean linear operation #129

Closed hxm-cpp closed 8 months ago

hxm-cpp commented 8 months ago

it seems like when i try to parse a NOT or a XOR, the parser :

p.SetExpr("~X[0]^X[1]^X[2]");
Value result = p.Eval();

it crash :

<unknown> 0x00007ffd27b5cf19
_CxxThrowException(void *,const _s__ThrowInfo *) 0x00007ff7dfa12241
`mup::TokenReader::IsVarOrConstTok'::`1'::catch$10(...) mpTokenReader.cpp:1025
_CallSettingFrame_LookupContinuationIndex() 0x00007ff7dfa340f0
__FrameHandler4::CxxCallCatchBlock(_EXCEPTION_RECORD *) 0x00007ff7dfa1c76e
<unknown> 0x00007ffd2a271716
mup::TokenReader::IsVarOrConstTok(mup::TokenPtr<…> &) mpTokenReader.cpp:994
mup::TokenReader::ReadNextToken() mpTokenReader.cpp:347
mup::ParserXBase::CreateRPN() mpParserBase.cpp:762
mup::ParserXBase::ParseFromString() mpParserBase.cpp:1024
mup::ParserXBase::Eval() mpParserBase.cpp:245

is there a way to use boolean operators this way, or if not point me another lib. thanks

beltoforion commented 8 months ago

Can't help you, your report does not contain enough information

hxm-cpp commented 8 months ago

the parse is unable to identify ~ as a NOT operator.