diff options
author | Marvin Borner | 2024-03-21 20:45:15 +0100 |
---|---|---|
committer | Marvin Borner | 2024-03-21 20:45:15 +0100 |
commit | a9880a191bbb5eeaf0faef9336263c92ef9351b6 (patch) | |
tree | 51401eef0d24fd38f220229da386330fcfc12e1b | |
parent | 2065029025c6e53eb550717755996d1d6fc5f60d (diff) |
Weird mistakes
-rw-r--r-- | docs/code.js | 5 | ||||
-rw-r--r-- | std/List.bruijn | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/docs/code.js b/docs/code.js index bfeaeb1..71ca75d 100644 --- a/docs/code.js +++ b/docs/code.js @@ -1,13 +1,14 @@ // high-quality syntax highlighter // TODO: Implement actual parser (or fix MANY regex bugs) +// TODO: bug: -0 in (-0 0) is not highlighted as index const term = (t) => t .replaceAll( - /(?<!\([+-]\d*)(?<![a-z][^&; ]*)([0-9])/g, + /(?<!\([+-]\d*)(?<![a-z][^&; ]*)(?<!["'])([0-9])/g, "<span class='index'>$1</span>", ) - .replaceAll(/'(.)'/g, "<span class='string'>'$1'</span>") + .replaceAll(/'([^\'])'/g, "<span class='string'>'$1'</span>") .replaceAll(/"([^\"]*)"/g, "<span class='string'>\"$1\"</span>") .replaceAll(/(\([+-][0-9]+[ubtd]?\))/g, "<span class='number'>$1</span>") .replaceAll(/(?<!\>)(\()/g, "<span class='left-app'>(</span>") diff --git a/std/List.bruijn b/std/List.bruijn index a240e3d..488c131 100644 --- a/std/List.bruijn +++ b/std/List.bruijn @@ -510,8 +510,8 @@ iterate z [[[rec]]] ⧗ (a → a) → a → (List a) :test (take (+5) (iterate i (+4))) (take (+5) (repeat (+4))) :test (take (+0) (iterate ++‣ (+0))) (empty) -# calculates all fixed points of a given function as a list -y* [[[0 1] <$> 0] xs] ⧗ a → (List b) +# calculates all fixed points of given function as a list +y* [[[0 1] <$> 0] xs] ⧗ (List a) → (List b) xs [[1 <! ([[1 2 0]] <$> 0)]] <$> 0 :test (&(+5) <$> (y* ([[[=?0 true (1 --0)]]] : {}[[[=?0 false (2 --0)]]]))) (false : {}true) |