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