Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public override NodeFinderResult VisitStringLiteralExpr(AstStringLiteral str, int data = 0)
 {
     return(new NodeFinderResult(str.Scope, expr: str));
 }
Ejemplo n.º 3
0
 public virtual ReturnType VisitStringLiteralExpr(AstStringLiteral expr, DataType data = default) => default;
Ejemplo n.º 4
0
 private static EvalValue CalcString(IEnvironment env, AstStringLiteral ast)
 {
     return(new EvalValue(ast.str));
 }