Skip to content

Commit

Permalink
fixing unicode errors in build: more fixes needed (#1701)
Browse files Browse the repository at this point in the history
* more fixes needed

* Add missing backslashes

* Check docs in CI

* Revert "Add missing backslashes"

This reverts commit c19ac75.

---------

Co-authored-by: Richard Dominick <[email protected]>
  • Loading branch information
martin-henz and RichDom2185 authored May 6, 2024
1 parent 9bf8bcb commit cb2e6fc
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 32 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
- name: Install dependencies (apt)
run: |
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends libxi-dev libgl1-mesa-dev
sudo apt-get install -y --no-install-recommends \
libxi-dev libgl1-mesa-dev \
texlive texlive-fonts-extra texlive-lang-cjk latexmk latex-cjk-all
- name: Setup Node
uses: actions/setup-node@v4
with:
Expand All @@ -42,6 +44,8 @@ jobs:
- run: yarn test-coverage
env:
CI: true
- name: Check that docs build
run: yarn jsdoc prepare
- name: Coveralls
uses: coverallsapp/github-action@master
with:
Expand Down
60 changes: 30 additions & 30 deletions docs/lib/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* **primitive**; makes a pair whose head (first component) is <CODE>x</CODE>
* and whose tail (second component) is <CODE>y</CODE>; time: <CODE>Θ(1)</CODE, space: <CODE>Θ(1)</CODE>.
* and whose tail (second component) is <CODE>y</CODE>; time: <CODE>Theta(1)</CODE, space: <CODE>Theta(1)</CODE>.
* @param {value} x - given head
* @param {value} y - given tail
* @returns {pair} pair with <CODE>x</CODE> as head and <CODE>y</CODE> as tail.
Expand All @@ -11,29 +11,29 @@ function pair(x, y) {}

/**
* **primitive**; returns <CODE>true</CODE> if <CODE>x</CODE> is a
* pair and false otherwise; time: <CODE>Θ(1)</CODE, space: <CODE>Θ(1)</CODE>.
* pair and false otherwise; time: <CODE>Theta(1)</CODE, space: <CODE>Theta(1)</CODE>.
* @param {value} x - given value
* @returns {boolean} whether <CODE>x</CODE> is a pair
*/
function is_pair(x) {}

/**
* **primitive**; returns head (first component) of given pair <CODE>p</CODE>; time: <CODE>Θ(1)</CODE, space: <CODE>Θ(1)</CODE>.
* **primitive**; returns head (first component) of given pair <CODE>p</CODE>; time: <CODE>Theta(1)</CODE, space: <CODE>Theta(1)</CODE>.
* @param {pair} p - given pair
* @returns {value} head of <CODE>p</CODE>
*/
function head(p) {}

/**
* **primitive**; returns tail (second component of given pair <CODE>p</CODE>; time: <CODE>Θ(1)</CODE, space: <CODE>Θ(1)</CODE>.
* **primitive**; returns tail (second component of given pair <CODE>p</CODE>; time: <CODE>Theta(1)</CODE, space: <CODE>Theta(1)</CODE>.
* @param {pair} p - given pair
* @returns {value} tail of <CODE>p</CODE>
*/
function tail(p) {}

/**
* **primitive**; returns <CODE>true</CODE> if <CODE>x</CODE> is the
* empty list <CODE>null</CODE>, and <CODE>false</CODE> otherwise; time: <CODE>Θ(1)</CODE, space: <CODE>Θ(1)</CODE>.
* empty list <CODE>null</CODE>, and <CODE>false</CODE> otherwise; time: <CODE>Theta(1)</CODE, space: <CODE>Theta(1)</CODE>.
* @param {value} x - given value
* @returns {boolean} whether <CODE>x</CODE> is <CODE>null</CODE>
*/
Expand All @@ -43,7 +43,7 @@ function is_null(x) {}
* **primitive**; returns <CODE>true</CODE> if
* <CODE>xs</CODE> is a list as defined in the textbook, and
* <CODE>false</CODE> otherwise. Iterative process;
* time: <CODE>Θ(n)</CODE>, space: <CODE>Θ(1)</CODE>, where <CODE>n</CODE>
* time: <CODE>Theta(n)</CODE>, space: <CODE>Theta(1)</CODE>, where <CODE>n</CODE>
* is the length of the
* chain of <CODE>tail</CODE> operations that can be applied to <CODE>xs</CODE>.
* <CODE>is_list</CODE> recurses down the list and checks that it ends with the empty list null
Expand All @@ -54,7 +54,7 @@ function is_list(xs) {}

/**
* **primitive**; given <CODE>n</CODE> values, returns a list of length <CODE>n</CODE>.
* The elements of the list are the given values in the given order; time: <CODE>Θ(n)</CODE, space: <CODE>Θ(n)</CODE>.
* The elements of the list are the given values in the given order; time: <CODE>Theta(n)</CODE, space: <CODE>Theta(n)</CODE>.
* @param {value} value1,value2,...,value_n - given values
* @returns {list} list containing all values
*/
Expand All @@ -63,7 +63,7 @@ function list(value1, value2, ...values ) {}
/**
* visualizes the arguments in a separate drawing
* area in the Source Academy using box-and-pointer diagrams; time, space:
* <CODE>Θ(n)</CODE>, where <CODE>n</CODE> is the total number of data structures such as
* <CODE>Theta(n)</CODE>, where <CODE>n</CODE> is the total number of data structures such as
* pairs in the arguments.
* @param {value} value1,value2,...,value_n - given values
* @returns {value} given <CODE>x</CODE>
Expand All @@ -82,7 +82,7 @@ function list(value1, value2, ...values ) {}
* with <CODE>===</CODE> (using the definition of <CODE>===</CODE> in the
* respective Source language in use).
* Time, space:
* <CODE>Θ(n)</CODE>, where <CODE>n</CODE> is the total number of data structures such as
* <CODE>Theta(n)</CODE>, where <CODE>n</CODE> is the total number of data structures such as
* pairs in <CODE>x</CODE> and <CODE>y</CODE>.
* @param {value} x - given value
* @param {value} y - given value
Expand Down Expand Up @@ -110,8 +110,8 @@ function equal(xs, ys) {
/**
* Returns the length of the list
* <CODE>xs</CODE>.
* Iterative process; time: <CODE>Θ(n)</CODE>, space:
* <CODE>Θ(1)</CODE>, where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* Iterative process; time: <CODE>Theta(n)</CODE>, space:
* <CODE>Theta(1)</CODE>, where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* @param {list} xs - given list
* @returns {number} length of <CODE>xs</CODE>
*/
Expand All @@ -125,8 +125,8 @@ function $length(xs, acc) {
/**
* Returns a list that results from list
* <CODE>xs</CODE> by element-wise application of unary function <CODE>f</CODE>.
* Iterative process; time: <CODE>Θ(n)</CODE> (apart from <CODE>f</CODE>),
* space: <CODE>Θ(n)</CODE> (apart from <CODE>f</CODE>), where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* Iterative process; time: <CODE>Theta(n)</CODE> (apart from <CODE>f</CODE>),
* space: <CODE>Theta(n)</CODE> (apart from <CODE>f</CODE>), where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* <CODE>f</CODE> is applied element-by-element:
* <CODE>map(f, list(1, 2))</CODE> results in <CODE>list(f(1), f(2))</CODE>.
* @param {function} f - unary
Expand All @@ -147,7 +147,7 @@ function $map(f, xs, acc) {
* Makes a list with <CODE>n</CODE>
* elements by applying the unary function <CODE>f</CODE>
* to the numbers 0 to <CODE>n - 1</CODE>, assumed to be a nonnegative integer.
* Iterative process; time: <CODE>Θ(n)</CODE> (apart from <CODE>f</CODE>), space: <CODE>Θ(n)</CODE> (apart from <CODE>f</CODE>).
* Iterative process; time: <CODE>Theta(n)</CODE> (apart from <CODE>f</CODE>), space: <CODE>Theta(n)</CODE> (apart from <CODE>f</CODE>).
* @param {function} f - unary function
* @param {number} n - given nonnegative integer
* @returns {list} resulting list
Expand All @@ -162,7 +162,7 @@ function $build_list(i, fun, already_built) {
/**
* Applies unary function <CODE>f</CODE> to every
* element of the list <CODE>xs</CODE>.
* Iterative process; time: <CODE>Θ(n)</CODE> (apart from <CODE>f</CODE>), space: <CODE>Θ(1)</CODE> (apart from <CODE>f</CODE>),
* Iterative process; time: <CODE>Theta(n)</CODE> (apart from <CODE>f</CODE>), space: <CODE>Theta(1)</CODE> (apart from <CODE>f</CODE>),
* where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* <CODE>f</CODE> is applied element-by-element:
* <CODE>for_each(fun, list(1, 2))</CODE> results in the calls
Expand All @@ -186,7 +186,7 @@ function for_each(fun, xs) {
* Returns a string that represents
* list <CODE>xs</CODE> using the text-based box-and-pointer notation
* <CODE>[...]</CODE>.
* Iterative process; time: <CODE>Θ(n)</CODE> where <CODE>n</CODE> is the size of the list, space: <CODE>Θ(m)</CODE> where <CODE>m</CODE> is the length of the string.
* Iterative process; time: <CODE>Theta(n)</CODE> where <CODE>n</CODE> is the size of the list, space: <CODE>Theta(m)</CODE> where <CODE>m</CODE> is the length of the string.
* The process is iterative, but consumes space <CODE>O(m)</CODE>
* because of the result string.
* @param {list} xs - given list
Expand All @@ -209,9 +209,9 @@ function $list_to_string(xs, cont) {

/**
* Returns list <CODE>xs</CODE> in reverse
* order. Iterative process; time: <CODE>Θ(n)</CODE>,
* space: <CODE>Θ(n)</CODE>, where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* The process is iterative, but consumes space <CODE>Θ(n)</CODE>
* order. Iterative process; time: <CODE>Theta(n)</CODE>,
* space: <CODE>Theta(n)</CODE>, where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* The process is iterative, but consumes space <CODE>Theta(n)</CODE>
* because of the result list.
* @param {list} xs - given list
* @returns {list} <CODE>xs</CODE> in reverse
Expand All @@ -228,8 +228,8 @@ function $reverse(original, reversed) {
/**
* Returns a list that results from
* appending the list <CODE>ys</CODE> to the list <CODE>xs</CODE>.
* Iterative process; time: <CODE>Θ(n)</CODE>, space:
* <CODE>Θ(n)</CODE>, where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* Iterative process; time: <CODE>Theta(n)</CODE>, space:
* <CODE>Theta(n)</CODE>, where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* In the result, null at the end of the first argument list
* is replaced by the second argument, regardless what the second
* argument consists of.
Expand All @@ -251,8 +251,8 @@ function $append(xs, ys, cont) {
* whose head is identical to
* <CODE>v</CODE> (using <CODE>===</CODE>); returns <CODE>null</CODE> if the
* element does not occur in the list.
* Iterative process; time: <CODE>Θ(n)</CODE>,
* space: <CODE>Θ(1)</CODE>, where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* Iterative process; time: <CODE>Theta(n)</CODE>,
* space: <CODE>Theta(1)</CODE>, where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* @param {value} v - given value
* @param {list} xs - given list
* @returns {list} postfix sublist that starts with <CODE>v</CODE>
Expand All @@ -270,7 +270,7 @@ function member(v, xs) {
* is identical (<CODE>===</CODE>) to <CODE>v</CODE>.
* Returns the original
* list if there is no occurrence. Iterative process;
* time: <CODE>Θ(n)</CODE>, space: <CODE>Θ(n)</CODE>, where <CODE>n</CODE>
* time: <CODE>Theta(n)</CODE>, space: <CODE>Theta(n)</CODE>, where <CODE>n</CODE>
* is the length of <CODE>xs</CODE>.
* @param {value} v - given value
* @param {list} xs - given list
Expand All @@ -294,7 +294,7 @@ function $remove(v, xs, acc) {
* Returns the original
* list if there is no occurrence.
* Iterative process;
* time: <CODE>Θ(n)</CODE>, space: <CODE>Θ(n)</CODE>, where <CODE>n</CODE>
* time: <CODE>Theta(n)</CODE>, space: <CODE>Theta(n)</CODE>, where <CODE>n</CODE>
* is the length of <CODE>xs</CODE>.
* @param {value} v - given value
* @param {list} xs - given list
Expand All @@ -317,7 +317,7 @@ function $remove_all(v, xs, acc) {
* <CODE>pred</CODE>
* returns <CODE>true</CODE>.
* Iterative process;
* time: <CODE>Θ(n)</CODE> (apart from <CODE>pred</CODE>), space: <CODE>Θ(n)</CODE> (apart from <CODE>pred</CODE>),
* time: <CODE>Theta(n)</CODE> (apart from <CODE>pred</CODE>), space: <CODE>Theta(n)</CODE> (apart from <CODE>pred</CODE>),
* where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* @param {function} pred - unary function returning boolean value
* @param {list} xs - given list
Expand All @@ -339,7 +339,7 @@ function $filter(pred, xs, acc) {
* numbers starting from <CODE>start</CODE> using a step size of 1, until
* the number exceeds (<CODE>&gt;</CODE>) <CODE>end</CODE>.
* Iterative process;
* time: <CODE>Θ(n)</CODE>, space: <CODE>Θ(n)</CODE>,
* time: <CODE>Theta(n)</CODE>, space: <CODE>Theta(n)</CODE>,
* where <CODE>n</CODE> is <CODE>end - start</CODE>.
* @param {number} start - starting number
* @param {number} end - ending number
Expand All @@ -359,7 +359,7 @@ function $enum_list(start, end, acc) {
* of list <CODE>xs</CODE> at position <CODE>n</CODE>,
* where the first element has index 0.
* Iterative process;
* time: <CODE>Θ(n)</CODE>, space: <CODE>Θ(1)</CODE>,
* time: <CODE>Theta(n)</CODE>, space: <CODE>Theta(1)</CODE>,
* where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* @param {list} xs - given list
* @param {number} n - given position
Expand All @@ -384,7 +384,7 @@ function list_ref(xs, n) {
* list. Thus, <CODE>accumulate(f,zero,list(1,2,3))</CODE> results in
* <CODE>f(1, f(2, f(3, zero)))</CODE>.
* Iterative process;
* time: <CODE>Θ(n)</CODE> (apart from <CODE>f</CODE>), space: <CODE>Θ(n)</CODE> (apart from <CODE>f</CODE>),
* time: <CODE>Theta(n)</CODE> (apart from <CODE>f</CODE>), space: <CODE>Theta(n)</CODE> (apart from <CODE>f</CODE>),
* where <CODE>n</CODE> is the length of <CODE>xs</CODE>.
* @param {function} f - binary function
* @param {value} initial - initial value
Expand All @@ -405,7 +405,7 @@ function $accumulate(f, initial, xs, cont) {
* Optional second argument.
* Similar to <CODE>display</CODE>, but formats well-formed lists nicely if detected;
* time, space:
* <CODE>Θ(n)</CODE>, where <CODE>n</CODE> is the total number of data structures such as
* <CODE>Theta(n)</CODE>, where <CODE>n</CODE> is the total number of data structures such as
* pairs in <CODE>x</CODE>.
* @param {value} xs - list structure to be displayed
* @param {string} s to be displayed, preceding <CODE>xs</CODE>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function stream_for_each(fun, xs) {
/**
* Returns stream <CODE>xs</CODE> in reverse
* order. Iterative process.
* The process is iterative, but consumes space <CODE>Ω(n)</CODE>
* The process is iterative, but consumes space <CODE>Omega(n)</CODE>
* because of the result stream.
* Lazy? No: <CODE>stream_reverse</CODE>
* forces the exploration of the entire stream
Expand Down

0 comments on commit cb2e6fc

Please sign in to comment.