shell stuff, preprocessor directive

This commit is contained in:
udo
2022-01-21 22:22:14 +00:00
parent 3e8f0f1fa7
commit 939009f9a1
22 changed files with 342 additions and 54 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ first
join
nibble
split
str_to_lower
str_to_upper
replace
to_lower
to_upper
trim
+11 -3
View File
@@ -43,18 +43,26 @@ RENDER()
for(auto file_name : ls("pages/"))
{
String ft = nibble(file_name, ".");
if(ft[1] == '_')
if(ft.substr(0, 2) == "0_")
{
String fn = ft;
String pre = nibble(fn, "_");
?>
<div><a href="?p=<?= ft ?>"><?= fn ?></a><span style="opacity:0.5"> : struct</span></div>
<div><a href="?p=<?= uri_encode(ft) ?>"><?= fn ?></a><span style="opacity:0.5"> : struct</span></div>
<?
}
else if(ft.substr(0, 2) == "1_")
{
String fn = ft;
String pre = nibble(fn, "_");
?>
<div><a href="?p=<?= uri_encode(ft) ?>"><?= fn ?></a><span style="opacity:0.5"> : directive</span></div>
<?
}
else
{
?>
<div><a href="?p=<?= ft ?>"><?= ft ?><span style="opacity:0.5">()</span></a></div>
<div><a href="?p=<?= uri_encode(ft) ?>"><?= ft ?><span style="opacity:0.5">()</span></a></div>
<?
}
}
+9
View File
@@ -0,0 +1,9 @@
:sig
#load "myfile.uce"
:params
file name : name of an UCE file that should be included
:desc
Includes another UCE file
View File
+14
View File
@@ -0,0 +1,14 @@
:sig
String replace(String s, String search, String replace_with)
:params
s : the string where replacements should happen
search : the string that should be searched for
replace_with : the string that should appear in places where 'search' occurs
return value : a version of 's' where all instances of 'search' have been replaced with 'replace_with'
:desc
Replace all occurrences of 'search' with the string defined in 'replace_with'.
:see
>string
+4 -2
View File
@@ -1,9 +1,11 @@
:sig
StringList split(String str, String delim = "\n")
StringList split(String str, String delim)
StringList split(String str)
:params
str : string to be split
delim : delimiter (defaults to newline character)
delim : optional, delimiter (if omitted, any sequence of whitespace characters will count as a delimiter)
return value : a list of strings
:desc
@@ -1,5 +1,5 @@
:sig
String str_to_lower(String s)
String to_lower(String s)
:params
s : the string to be converted
@@ -1,5 +1,5 @@
:sig
String str_to_upper(String s)
String to_upper(String s)
:params
s : the string to be converted