-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
112 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
const Algorithm = require('./Algorithm'); | ||
module.exports = class Eqn extends Algorithm { | ||
constructor(spec, node) { | ||
super(spec, node); | ||
this.aoid = node.getAttribute('aoid'); | ||
this.id = this.aoid; | ||
this.spec.biblio.ops[this.aoid] = { | ||
aoid: this.aoid, | ||
id: this.id, | ||
location: '', | ||
}; | ||
} | ||
|
||
build() { | ||
let contents = this.node.innerHTML; | ||
contents = '<div>' + contents.split(/\r?\n/g) | ||
.filter(function(s) { return s.trim().length > 0; }) | ||
.join('</div><div>'); | ||
this.node.innerHTML = this.autolinkOps(contents); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
{ | ||
"http://people.mozilla.org/~jorendorff/es6-draft.html": { | ||
"abstract operations": { | ||
"ReturnIfAbrupt": "#sec-returnifabrupt", | ||
"Get": "#sec-get-o-p" | ||
"ops": { | ||
"ReturnIfAbrupt": { | ||
"id": "sec-returnifabrupt", | ||
"aoid": "ReturnIfAbrupt" | ||
}, | ||
"Get": { | ||
"id": "sec-get-o-p", | ||
"aoid": "Get" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<link rel=stylesheet href="./css/elements.css"> | ||
<pre class=metadata>toc: false</pre> | ||
<emu-alg> | ||
1. Return Value(_val_); | ||
</emu-alg> | ||
<emu-eqn aoid="Value2"> | ||
Value2(t) | ||
= DateValue(t) if Type(t) is string | ||
= t | ||
</emu-eqn> | ||
<emu-eqn aoid="DateValue"> | ||
DateValue(t) | ||
= 0 if t = 0 | ||
= 1 if t = 1 | ||
= 2 | ||
</emu-eqn> | ||
<emu-eqn aoid="Value"> | ||
Value(t) | ||
= DateValue(t) if Type(t) is string | ||
= t | ||
</emu-eqn> | ||
<emu-alg> | ||
1. Return Value(_val_); | ||
</emu-alg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<head><link rel="stylesheet" href="./css/elements.css"> | ||
</head><body> | ||
<emu-alg><ol><li>Return <a href="#Value">Value</a>(<var>val</var>);</li></ol></emu-alg> | ||
|
||
<emu-eqn aoid="Value2"><div> <a href="#Value2">Value2</a>(t)</div><div> = <a href="#DateValue">DateValue</a>(t) if <a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-ecmascript-data-types-and-values">Type</a>(t) is string</div><div> = t</div></emu-eqn> | ||
|
||
<emu-eqn aoid="DateValue"><div> <a href="#DateValue">DateValue</a>(t)</div><div> = 0 if t = 0</div><div> = 1 if t = 1</div><div> = 2</div></emu-eqn> | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
bterlson
Author
Member
|
||
|
||
<emu-eqn aoid="Value"><div> <a href="#Value">Value</a>(t)</div><div> = <a href="#DateValue">DateValue</a>(t) if <a href="http://www.ecma-international.org/ecma-262/6.0/index.html#sec-ecmascript-data-types-and-values">Type</a>(t) is string</div><div> = t</div></emu-eqn> | ||
|
||
<emu-alg><ol><li>Return <a href="#Value">Value</a>(<var>val</var>);</li></ol></emu-alg> | ||
</body> |
Shouldn't e.g.
t
be wrapped in<var>
? (and maybe0
in<emu-val>
...) Or I guess we should make authors do that in their EMU/EMD input, and this is just a slightly-incomplete example? Disclaimer: I haven't actually checked the spec's rendering.