diff --git a/doc/RFC.md b/doc/RFC.md index abb1cd8..3deabbe 100644 --- a/doc/RFC.md +++ b/doc/RFC.md @@ -1,17 +1,14 @@ > version 1.0.0 -date: 2023-03-31T12:58:19+0200 (generated by `./make doc`) +date: 2023-03-31T13:31:47+0200 (generated by `./make doc`) -# Url parser (the gist of it) +# URI parser (the gist of it) 1. fragment URI starts with `#` 1. fragments are split by `&` 1. `=` is used to split fragment key/values 1. fragment-values are urlencoded (space becomes `+` using `encodeUriComponent` e.g.) 1. every recognized fragment key/value-pair is added to a central map/associative array/object -> version 1.0.0 - -date: 2023-03-31T12:58:19+0200 (generated by `./make doc`) # XR Fragments (key/value params) @@ -21,7 +18,7 @@ date: 2023-03-31T12:58:19+0200 (generated by `./make doc`) | prio | int (-10..1) | Asset linking | `#prio=-5` | -# Fragment parser (the gist of it) +# XR Fragments parser (the gist of it) 1. each key has a regex to validate its value-type (see regexes) 1. `|` is used to split multiple/fallback values diff --git a/make b/make index 8e54a26..691a335 100755 --- a/make +++ b/make @@ -33,8 +33,6 @@ tests(){ doc(){ generate(){ - echo "> version $VERSION" - echo "\ndate: $(date +"%Y-%m-%dT%H:%M:%S%z") (generated by \`./make doc\`)" cat $1 | awk '/\/\/ / { gsub(".*// ","",$0); gsub("# ","\n# ",$0); @@ -44,8 +42,12 @@ doc(){ print $0; }' } - generate src/xrfragment/Url.hx > doc/RFC.md - generate src/xrfragment/Parser.hx >> doc/RFC.md + { + echo "> version $VERSION" + echo "\ndate: $(date +"%Y-%m-%dT%H:%M:%S%z") (generated by \`./make doc\`)" + generate src/xrfragment/Url.hx + generate src/xrfragment/Parser.hx + } > doc/RFC.md } test -z $1 && { try rm dist/* ; haxe build.hxml; exit $?; } diff --git a/src/xrfragment/Parser.hx b/src/xrfragment/Parser.hx index f58d347..4318195 100644 --- a/src/xrfragment/Parser.hx +++ b/src/xrfragment/Parser.hx @@ -17,7 +17,7 @@ class Parser { Frag.set("prio", Type.isInt); // | prio | int (-10..1) | Asset linking | `#prio=-5` | // - // # Fragment parser (the gist of it) + // # XR Fragments parser (the gist of it) if( Frag.exists(key) ){ // if( Frag.get(key).match(value) ){ // 1. each key has a regex to validate its value-type (see regexes) var v:Value = new Value(); diff --git a/src/xrfragment/Url.hx b/src/xrfragment/Url.hx index f6f755b..8a11457 100644 --- a/src/xrfragment/Url.hx +++ b/src/xrfragment/Url.hx @@ -9,7 +9,7 @@ class Url { public static var error:String = ""; - @:keep // # Url parser (the gist of it) + @:keep // # URI parser (the gist of it) public static function parse(qs:String):haxe.DynamicAccess { // var fragment:Array = qs.split("#"); // 1. fragment URI starts with `#` var splitArray:Array = fragment[1].split('&'); // 1. fragments are split by `&`