<commit_before>
//*******************************************************
// and here are the definitions of the drawing operators
//*******************************************************



evaluator._helper.extractPoint=function(v1){
    var erg={};
    erg.ok=false;
    if(v1.ctype=='geo') {
        var val=v1.value;
        if(val.kind=="P"){
            erg.x= Accessor.getField(val,"x").value.real;
            erg.y= Accessor.getField(val,"y").value.real;
            erg.ok=true;
            return erg;
        }
        
    }
    if(v1.ctype!='list'){
        return erg;
    }
    
    var pt1=v1.value;
    var x=0;
    var y=0;
    var z=0;
    if(pt1.length==2){
        var n1=pt1[0];
        var n2=pt1[1];
        if(n1.ctype=='number' && n2.ctype=='number'){
            erg.x=n1.value.real;
            erg.y=n2.value.real;
            erg.ok=true;
            return erg;
        }
    }
    
    if(pt1.length==3){
        var n1=pt1[0];
        var n2=pt1[1];
        var n3=pt1[2];
        if(n1.ctype=='number' && n2.ctype=='number'&& n3.ctype=='number'){
            n1=CSNumber.div(n1,n3);
            n2=CSNumber.div(n2,n3);
            erg.x=n1.value.real;
            erg.y=n2.value.real;
            erg.ok=true;
            return erg;
        }
    }
    
    return erg;
    
}

evaluator.draw=function(args,modifs){
    var erg;
    var psize=csport.drawingstate.pointsize;
    var lsize=csport.drawingstate.linesize;
    if(psize<0) psize=0;
    if(lsize<0) lsize=0;
    var overhang=1;//TODO Eventuell dfault setzen
    var dashing=false;
    var isArrow=false;
    var col;
    var black="rgb(0,0,0)";
    if(csport.drawingstate.alpha!=1){
        black="rgba(0,0,0,"+csport.drawingstate.alpha+")";
    }
    var handleModifs = function(type){
        if(modifs.size!==undefined){
            erg =evaluate(modifs.size);
            if(erg.ctype=='number'){
                if(type=="P"){
                    psize=erg.value.real;                       
                    if(psize<0) psize=0;
                    if(psize>1000) psize=1000;
                }
                if(type=="L"){
                    lsize=erg.value.real;
                    if(lsize<0) lsize=0;
                    if(lsize>1000) lsize=1000;
                }
            }
        }
        
        if(type=="L"){
            if(modifs.dashpattern!==undefined){
                erg =evaluate(modifs.dashpattern);
                if(erg.ctype=='list'){
                    var pat=[]; 
                    for(var i=0; i<erg.value.length;i++){
                        pat[i]=erg.value[i].value.real;
                    }
                    evaluator._helper.setDash(pat,lsize);
                    dashing=true;
                }
            }
            
            
            if(modifs.dashtype!==undefined){
                erg =evaluate(modifs.dashtype);
                if(erg.ctype=='number'){
                    var type=Math.floor(erg.value.real);
                    evaluator._helper.setDashType(type,lsize);
                    dashing=true;
                    
                    
                }
            }
            
            if(modifs.dashing!==undefined){
                erg =evaluate(modifs.dashing);
                if(erg.ctype=='number'){
                    var si=Math.floor(erg.value.real);
                    evaluator._helper.setDash([si*2,si],lsize);
                    dashing=true;
                    
                    
                }
            }
            if(modifs.overhang!==undefined){
                erg =evaluate(modifs.overhang);
                if(erg.ctype=='number'){
                     overhang=(erg.value.real);
                                        
                }
            }
            if(modifs.arrow!==undefined){
		    erg = evaluate(modifs.arrow);

		    if(erg.ctype == 'boolean'){
                    isArrow = erg.value; 
		    }
                }
            
        }
        
        
        
        
        if(modifs.color===undefined &&modifs.alpha===undefined){
            return;
        }
        
        
        var r=0;
        var g=0;
        var b=0;
        var alpha=csport.drawingstate.alpha;
        if(type=="P"){
            r=csport.drawingstate.pointcolorraw[0]*255;
            g=csport.drawingstate.pointcolorraw[1]*255;<commit_msg>added debug output to arrow drawing<commit_after>
//*******************************************************
// and here are the definitions of the drawing operators
//*******************************************************



evaluator._helper.extractPoint=function(v1){
    var erg={};
    erg.ok=false;
    if(v1.ctype=='geo') {
        var val=v1.value;
        if(val.kind=="P"){
            erg.x= Accessor.getField(val,"x").value.real;
            erg.y= Accessor.getField(val,"y").value.real;
            erg.ok=true;
            return erg;
        }
        
    }
    if(v1.ctype!='list'){
        return erg;
    }
    
    var pt1=v1.value;
    var x=0;
    var y=0;
    var z=0;
    if(pt1.length==2){
        var n1=pt1[0];
        var n2=pt1[1];
        if(n1.ctype=='number' && n2.ctype=='number'){
            erg.x=n1.value.real;
            erg.y=n2.value.real;
            erg.ok=true;
            return erg;
        }
    }
    
    if(pt1.length==3){
        var n1=pt1[0];
        var n2=pt1[1];
        var n3=pt1[2];
        if(n1.ctype=='number' && n2.ctype=='number'&& n3.ctype=='number'){
            n1=CSNumber.div(n1,n3);
            n2=CSNumber.div(n2,n3);
            erg.x=n1.value.real;
            erg.y=n2.value.real;
            erg.ok=true;
            return erg;
        }
    }
    
    return erg;
    
}

evaluator.draw=function(args,modifs){
    var erg;
    var psize=csport.drawingstate.pointsize;
    var lsize=csport.drawingstate.linesize;
    if(psize<0) psize=0;
    if(lsize<0) lsize=0;
    var overhang=1;//TODO Eventuell dfault setzen
    var dashing=false;
    var isArrow=false;
    var col;
    var black="rgb(0,0,0)";
    if(csport.drawingstate.alpha!=1){
        black="rgba(0,0,0,"+csport.drawingstate.alpha+")";
    }
    var handleModifs = function(type){
        if(modifs.size!==undefined){
            erg =evaluate(modifs.size);
            if(erg.ctype=='number'){
                if(type=="P"){
                    psize=erg.value.real;                       
                    if(psize<0) psize=0;
                    if(psize>1000) psize=1000;
                }
                if(type=="L"){
                    lsize=erg.value.real;
                    if(lsize<0) lsize=0;
                    if(lsize>1000) lsize=1000;
                }
            }
        }
        
        if(type=="L"){
            if(modifs.dashpattern!==undefined){
                erg =evaluate(modifs.dashpattern);
                if(erg.ctype=='list'){
                    var pat=[]; 
                    for(var i=0; i<erg.value.length;i++){
                        pat[i]=erg.value[i].value.real;
                    }
                    evaluator._helper.setDash(pat,lsize);
                    dashing=true;
                }
            }
            
            
            if(modifs.dashtype!==undefined){
                erg =evaluate(modifs.dashtype);
                if(erg.ctype=='number'){
                    var type=Math.floor(erg.value.real);
                    evaluator._helper.setDashType(type,lsize);
                    dashing=true;
                    
                    
                }
            }
            
            if(modifs.dashing!==undefined){
                erg =evaluate(modifs.dashing);
                if(erg.ctype=='number'){
                    var si=Math.floor(erg.value.real);
                    evaluator._helper.setDash([si*2,si],lsize);
                    dashing=true;
                    
                    
                }
            }
            if(modifs.overhang!==undefined){
                erg =evaluate(modifs.overhang);
                if(erg.ctype=='number'){
                     overhang=(erg.value.real);
                                        
                }
            }
            if(modifs.arrow !== undefined){
		    erg = evaluate(modifs.arrow);

		    if(erg.ctype == 'boolean'){
                    isArrow = erg.value; 
		    }
		    else{
			    console.error("arrow needs to be of type boolean");
		    }
                }
            
        }
        
        
        
        
        if(modifs.color===undefined &&modifs.alpha===undefined){
            return;
        }
        
        
        var r=0;
        var g=0;
        var b=0;
        var alpha=csport.drawingstate.alpha;
        if(type=="P"){
            r=csport.drawingstate.pointcolorraw[0]*255;
            g=csport.drawingstate.pointcolorraw[1]*255;
{'fraction_non_alphanumeric': 0.1562605848481427, 'fraction_numerical': 0.01987128824658462, 'mean_word_length': 1.2351753721927832, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '326428', 'n_tokens_mistral': 2947, 'n_tokens_neox': 2692, 'n_words': 347}