if(str.split(",").length>1){// 1. `,` assumes 1D/2D/3D vector-values like x[,y[,z]]
var xyz:Array<String>=str.split(",");// 1. parseFloat(..) and parseInt(..) is applied to vector/float and int values
if(xyz.length>0)v.x=Std.parseFloat(xyz[0]);// 1. anything else will be treated as string-value
if(xyz.length>1)v.y=Std.parseFloat(xyz[1]);// 1. incompatible value-types will be dropped / not used
if(xyz.length>2)v.y=Std.parseFloat(xyz[2]);//
}// > the xrfragment specification should stay simple enough
// > for anyone to write a parser using either regexes or grammar/lexers
if(Type.isColor.match(str))v.color=str;// > therefore expressions/comprehensions are not supported (max wildcard/comparison operators for queries e.g.)
// > rule for thumb: type-limitations will piggyback JSON limitations (IEEE floatsize e.g.)
}
// Regexes:
classType{//
staticpublicvar isColor:EReg=~/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;// 1. hex colors are detected using regex `/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/`
staticpublicvar isInt:EReg=~/^[0-9]+$/;// 1. integers are detected using regex `/^[0-9]+$/`
staticpublicvar isFloat:EReg=~/^[0-9]+\.[0-9]+$/;// 1. floats are detected using regex `/^[0-9]+\.[0-9]+$/`
staticpublicvar isVector:EReg=~/([,]+|\w)/;// 1. vectors are detected using regex `/[,]/` (but can also be an string referring to an entity-ID in the asset)