tmteam / NFun

Expressions Evaluator for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow to use '=' instead of '== ' in single line anonymous expression

tmteam opened this issue · comments

var a = Funny.SingleEqualOp.Calc("if(now().day = 1 and now().month = 1) 'happy new year' else 'go to job'")

The problem is to distinguish equality check and field assignment

var a = Funny.SingleEqualOp.Calc( 
"""
    if(now().day = 1 and now().month = 1) 
       { msg =  'happy new year' }
    else 
      { msg =  'go to job' }
"""
)