public override string AddExpression(ExpressionDetails expressionDetails, string parentHash, List <string> modelTypes = null) { var statement = expressionDetails.Statement; StringMapper(ref statement); Expression expression = new(statement, parentHash); expression.Hash = Tools.ByteToHex(Tools.GetSha256Hash(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(expression)))); Memory.Add(expression); return(expression.Hash); }
public override string AddExpression(ExpressionDetails expressionDetails, string parentHash, List <string> modelTypes = null) { if (expressionDetails.SyntaxKind == SyntaxKind.LocalDeclarationStatement) { expressionDetails.Statement = expressionDetails.Statement.Split(" ", 2).Select((content, count) => count == 0 ? content.CheckRequiresMemorySyntax(modelTypes) : content).Aggregate((i, j) => i + " " + j); } var statement = expressionDetails.Statement; StringMapper(ref statement); Expression expression = new(statement, parentHash); expression.Hash = Tools.ByteToHex(Tools.GetSha256Hash(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(expression)))); Memory.Add(expression); return(expression.Hash); }
public abstract string AddExpression(ExpressionDetails expressionDetails, string parentHash, List <string> modelTypes = null);