package org.yinwang.pysonar.ast;

import org.jetbrains.annotations.NotNull;
import org.yinwang.pysonar.Analyzer;
import org.yinwang.pysonar.State;
import org.yinwang.pysonar.types.Type;


public class Str extends Node {

    public String value;


    public Str(@NotNull Object value, int start, int end) {
        super(start, end);
        this.value = value.toString();
    }


    @NotNull
    @Override
    public Type transform(State s) {
        return Analyzer.self.builtins.BaseStr;
    }


    @NotNull
    @Override
    public String toString() {
        return "<Str>";
    }


    @Override
    public void visit(@NotNull NodeVisitor v) {
        v.visit(this);
    }
}

@@ -564,21 +564,194 @@
     
-return %22%3CStr%3E
+String summary;%0A        if (value.length() %3E 10) %7B%0A            summary = value.substring(0, 10);%0A        %7D else %7B%0A            summary = value;%0A        %7D%0A        return %22'%22 + summary + %22'
 %22;%0A 

simplify string display