aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarvin Borner2024-10-28 02:48:55 +0100
committerMarvin Borner2024-10-28 02:48:55 +0100
commite9896ef70fc3c203ef13f741aa036dad82540fbf (patch)
tree6ed21a28cfad34429f78339e3ae462a13d2428e3
parent551cfb83fd8f3cb88a3428c0bb6a7cbb933e4eeb (diff)
Fixed minor intelligence issues
-rw-r--r--docs/code.js5
-rwxr-xr-xstd/generate_map.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/docs/code.js b/docs/code.js
index 7572c0b..a00818e 100644
--- a/docs/code.js
+++ b/docs/code.js
@@ -12,7 +12,7 @@ const decodeHTML = (html) => {
};
const encodeHTML = (str) =>
- str.replace(/[\u00A0-\u9999<>\&]/g, (i) => "&#" + i.charCodeAt(0) + ";");
+ str.replace(/[\u00A0-\u9999<>\&\#]/g, (i) => "&#" + i.charCodeAt(0) + ";");
// just basic token parsing
const parseTerm = (str) => {
@@ -58,6 +58,9 @@ const parseFile = (str) => {
tree.push({ kind: "input", path: matches[1] });
} else if ((matches = line.match(/^:import (.*) (.*)$/))) {
tree.push({ kind: "import", path: matches[1], namespace: matches[2] });
+ } else if ((matches = line.match(/^:import (.*)$/))) {
+ const namespace = matches[1].split("/").slice(-1)[0];
+ tree.push({ kind: "import", path: matches[1], namespace: namespace });
} else if ((matches = line.match(/^:test (\(.*\)) (\(.*\))$/))) {
tree.push({
kind: "test",
diff --git a/std/generate_map.py b/std/generate_map.py
index 251aaf8..3ae2d53 100755
--- a/std/generate_map.py
+++ b/std/generate_map.py
@@ -22,7 +22,7 @@ def list_defs(path, kind, prefix):
res = res + list_defs(import_path, "import", new_prefix)
elif (
line.startswith(":")
- or line.startswith("#")
+ or line.startswith("# ")
or line.strip() == ""
or line[0].isspace()
):