public override string VisitStringLiteralExpr(AstStringLiteral str, int data = 0) { string v = str.StringValue; v = v.Replace("`", "``", StringComparison.InvariantCulture) .Replace("\r", "`r", StringComparison.InvariantCulture) .Replace("\n", "`n", StringComparison.InvariantCulture) .Replace("\0", "`0", StringComparison.InvariantCulture); v = $"\"{v.Replace("\"", "`\"", StringComparison.InvariantCulture)}\""; if (str.Suffix != null) { v += str.Suffix; } return(v); }
public override NodeFinderResult VisitStringLiteralExpr(AstStringLiteral str, int data = 0) { return(new NodeFinderResult(str.Scope, expr: str)); }
public virtual ReturnType VisitStringLiteralExpr(AstStringLiteral expr, DataType data = default) => default;
private static EvalValue CalcString(IEnvironment env, AstStringLiteral ast) { return(new EvalValue(ast.str)); }