"""
Nsc410 核心编译器
"""
from numexpr import *
from Nsc371 import *
def Ns4ev(eval_sif, space=None):
    """Ns4ev->es"""
    if space == True:
        pass
    else:
        eval_sif = eval_sif.replace(' ', '')
    
    if "'" in eval_sif:
        list_es = eval_sif.split("'")
        list_es = [i for i in list_es if i != '' and i != '+']
        return ''.join(list_es)
    else:
        try:
            return evaluate(eval_sif)
        except Exception:
            raise SyntaxError(f'Error:Nsc410 expr{eval_sif} is wrong.')

