update documentation
This commit is contained in:
parent
a14434c2e2
commit
2ccda806f8
3 changed files with 12 additions and 9 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
> version 1.0.0
|
> version 1.0.0
|
||||||
|
|
||||||
date: 2023-04-02T21:22:10+0200<br>
|
date: 2023-04-02T21:37:32+0200<br>
|
||||||
[](https://github.com/coderofsalvation/xrfragment/actions)
|
[](https://github.com/coderofsalvation/xrfragment/actions)
|
||||||
|
|
||||||
# `://foo.com/my3d.asset#pos=1,0,0&prio=-5`
|
# `://foo.com/my3d.asset#pos=1,0,0&prio=-5`
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@
|
||||||
#
|
#
|
||||||
# var foo; // comment with 2 leading spaces is markdown too $(date)
|
# var foo; // comment with 2 leading spaces is markdown too $(date)
|
||||||
#
|
#
|
||||||
|
# easily refactorable to hash-based languages (py/bash/perl/lua e.g.)
|
||||||
|
# by changing the regexes
|
||||||
|
#
|
||||||
/\$\(/ { cmd=$0;
|
/\$\(/ { cmd=$0;
|
||||||
gsub(/^.*\$\(/,"",cmd);
|
gsub(/^.*\$\(/,"",cmd);
|
||||||
gsub(/\).*/,"",cmd);
|
gsub(/\).*/,"",cmd);
|
||||||
|
|
|
||||||
|
|
@ -53,14 +53,14 @@ class Parser {
|
||||||
@:keep
|
@:keep
|
||||||
public static function guessType(v:Value, str:String):Void {
|
public static function guessType(v:Value, str:String):Void {
|
||||||
v.string = str;
|
v.string = str;
|
||||||
if( str.split(",").length > 1){ /// 1. `,` assumes 1D/2D/3D vector-values like x[,y[,z]]
|
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
|
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 > 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 > 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]); ///
|
if( xyz.length > 2 ) v.y = Std.parseFloat(xyz[2]); //
|
||||||
} /// > the xrfragment specification should stay simple enough
|
} // > the xrfragment specification should stay simple enough
|
||||||
/// > for anyone to write a parser using either regexes or grammar/lexers
|
// > 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.)
|
if( Type.isColor.match(str) ) v.color = str; // > therefore expressions/comprehensions are not supported (max wildcard/comparison operators for queries e.g.)
|
||||||
if( Type.isFloat.match(str) ) v.float = Std.parseFloat(str);
|
if( Type.isFloat.match(str) ) v.float = Std.parseFloat(str);
|
||||||
if( Type.isInt.match(str) ) v.int = Std.parseInt(str);
|
if( Type.isInt.match(str) ) v.int = Std.parseInt(str);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue