diff --git a/doc/RFC.md b/doc/RFC.md index 7a6a6f2..4be7960 100644 --- a/doc/RFC.md +++ b/doc/RFC.md @@ -4,7 +4,7 @@ > version 1.0.0 -date: 2023-04-07T13:38:59+0200
+date: 2023-04-07T13:41:47+0200
[![Actions Status](https://github.com/coderofsalvation/xrfragment/workflows/test/badge.svg)](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 diff --git a/src/xrfragment/Parser.hx b/src/xrfragment/Parser.hx index 9a8b40c..91566e5 100644 --- a/src/xrfragment/Parser.hx +++ b/src/xrfragment/Parser.hx @@ -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(); var args:Array = 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 ); } }