update documentation
This commit is contained in:
parent
4d9d1a6951
commit
a01fb08e5d
2 changed files with 6 additions and 6 deletions
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
> version 1.0.0
|
||||
|
||||
date: 2023-04-07T13:38:59+0200<br>
|
||||
date: 2023-04-07T13:41:47+0200<br>
|
||||
[](https://github.com/coderofsalvation/xrfragment/actions)
|
||||
|
||||
# XRFragment Grammar
|
||||
|
|
@ -60,8 +60,8 @@ the gist of it:
|
|||
1. check if param exist
|
||||
1. each key has a regex to validate its value-type (see regexes)
|
||||
1. extract the type
|
||||
1. use `|` on stringvalues, to split multiple/fallback values
|
||||
1. for each multiple/fallback value, guess the type
|
||||
1. use `|` on stringvalues, to split multiple values
|
||||
1. for each multiple value, guess the type
|
||||
1. `,` assumes 1D/2D/3D vector-values like x[,y[,z]]
|
||||
1. parseFloat(..) and parseInt(..) is applied to vector/float and int values
|
||||
1. anything else will be treated as string-value
|
||||
|
|
|
|||
|
|
@ -32,13 +32,13 @@ class Parser {
|
|||
if( Frag.get(key).match(value) ){ // 1. each key has a regex to validate its value-type (see regexes)
|
||||
var v:Value = new Value();
|
||||
guessType(v, value); // 1. extract the type
|
||||
// process multiple/fallback values
|
||||
if( value.split("|").length > 1 ){ // 1. use `|` on stringvalues, to split multiple/fallback values
|
||||
// process multiple values
|
||||
if( value.split("|").length > 1 ){ // 1. use `|` on stringvalues, to split multiple values
|
||||
v.args = new Array<Value>();
|
||||
var args:Array<String> = value.split("|");
|
||||
for( i in 0...args.length){
|
||||
var x:Value = new Value();
|
||||
guessType(x, args[i]); // 1. for each multiple/fallback value, guess the type
|
||||
guessType(x, args[i]); // 1. for each multiple value, guess the type
|
||||
v.args.push( x );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue