Skip to content

Commit

Permalink
Use period as prefix for invisible operators
Browse files Browse the repository at this point in the history
**BREAKING CHANGE**

The following operators have been changed from `old` ⇒ `new`

- INVISIBLE PLUS: `&+` ⇒ `.+`
- INVISIBLE TIMES: `&*` ⇒ `.*`
- FUNCTION APPLICATION: `&$` ⇒ `.$`
- INVISIBLE SEPARATOR: `&,` ⇒ `.,`

Resolves: #75
  • Loading branch information
runarberg committed Nov 2, 2023
1 parent 76212df commit 55a7d12
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion demo/test-cases.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ <h2>Super and Subscripts</h2>
<test-case>a^2_i</test-case>
<test-case>2^2^2^2</test-case>
<test-case>a^2 + b^2 = c^2</test-case>
<test-case>(X^T)_ i&,j = X_ j&,i</test-case>
<test-case>(X^T)_ i.,j = X_ j.,i</test-case>

<test-case display="block">
ln x = int_1^x 1/t dt
Expand Down
8 changes: 4 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -475,19 +475,19 @@ <h3>Operators</h3>
<summary>Operational</summary>

<dl>
<dt><code>&$</code></dt>
<dt><code>.$</code></dt>
<dd>
<code>FUNCTION APPLICATION</code>
(<em>zero width</em>)
</dd>

<dt><code>&*</code></dt>
<dt><code>.*</code></dt>
<dd>
<code>INVISIBLE TIMES</code>
(<em>zero width</em>)
</dd>

<dt><code>&+</code></dt>
<dt><code>.+</code></dt>
<dd>
<code>INVISIBLE PLUS</code>
(<em>zero width</em>)
Expand Down Expand Up @@ -928,7 +928,7 @@ <h3>Operators</h3>
<summary>Punctuations</summary>

<dl>
<dt><code>&,</code></dt>
<dt><code>.,</code></dt>
<dd>
<code>INVISIBLE SEPARATOR</code>
(<em>zero width</em>)
Expand Down
8 changes: 4 additions & 4 deletions src/compiler/tokenizer/lexemes.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ export const KNOWN_IDENTS = new Map([
export const KNOWN_OPS = new Map([
["!=", { value: "≠" }],
["!in", { value: "∉" }],
["&$", { value: "\u2061" }],
["&*", { value: "\u2062" }],
["&+", { value: "\u2064" }],
["&,", { value: "\u2063" }],
[".$", { value: "\u2061" }],
[".*", { value: "\u2062" }],
[".+", { value: "\u2064" }],
[".,", { value: "\u2063" }],
["'", { value: "′", attrs: { lspace: 0, rspace: 0 } }],
["''", { value: "″", attrs: { lspace: 0, rspace: 0 } }],
["'''", { value: "‴", attrs: { lspace: 0, rspace: 0 } }],
Expand Down
2 changes: 1 addition & 1 deletion test/sub-supscripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ test("Pythagorean theorem", (t) => {
});

test("Matrix transpose", (t) => {
t.snapshot(render("(X^T)_ i&,j = X_ j&,i"));
t.snapshot(render("(X^T)_ i.,j = X_ j.,i"));
});

test("The natural logarithm", (t) => {
Expand Down

0 comments on commit 55a7d12

Please sign in to comment.