mirror of
https://github.com/RGBCube/HTMNIX
synced 2025-07-25 23:17:44 +00:00
Some changes
This commit is contained in:
parent
e47be49c04
commit
274cd1f747
1 changed files with 18 additions and 7 deletions
25
flake.nix
25
flake.nix
|
@ -1,13 +1,24 @@
|
||||||
{
|
{
|
||||||
outputs = { self }: {
|
outputs = { self }: let
|
||||||
|
firstChar = builtins.substring 0 1;
|
||||||
|
dropFirstChar = string: builtins.substring 1 (builtins.stringLength string) string;
|
||||||
|
|
||||||
|
lastChar = string: builtins.substring (builtins.stringLength string - 1) 1 string;
|
||||||
|
dropLastChar = string: builtins.substring 0 (builtins.stringLength string - 1) string;
|
||||||
|
|
||||||
|
getType = item: item._type or null;
|
||||||
|
|
||||||
escape = s: s; # TODO
|
escape = s: s; # TODO
|
||||||
|
|
||||||
__findFile = _: name: if builtins.substring 0 1 name == "." then {
|
domListToString = _: escape "TODO";
|
||||||
|
in {
|
||||||
|
|
||||||
|
__findFile = _: name: if firstChar name == "." then {
|
||||||
_type = "end";
|
_type = "end";
|
||||||
_name = builtins.substring 1 (builtins.stringLength name) name;
|
_name = dropFirstChar name;
|
||||||
} else if builtins.substring (builtins.stringLength name - 1) 1 name == "." then {
|
} else if lastChar name == "." then {
|
||||||
_type = "lone";
|
_type = "lone";
|
||||||
_name = builtins.substring 0 (builtins.stringLength name - 1) name;
|
_name = dropLastChar name;
|
||||||
} else {
|
} else {
|
||||||
_type = "start";
|
_type = "start";
|
||||||
_name = name;
|
_name = name;
|
||||||
|
@ -15,10 +26,10 @@
|
||||||
_accum = [];
|
_accum = [];
|
||||||
__functor = let
|
__functor = let
|
||||||
impl = this: next: if
|
impl = this: next: if
|
||||||
next._type or null == "end" &&
|
getType next == "end" &&
|
||||||
next._name == this._name
|
next._name == this._name
|
||||||
then
|
then
|
||||||
this._accum
|
domListToString this
|
||||||
else this // {
|
else this // {
|
||||||
_accum = this._accum ++ [ next ];
|
_accum = this._accum ++ [ next ];
|
||||||
__functor = impl;
|
__functor = impl;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue