1
1
mirror of https://github.com/github/semantic.git synced 2024-11-25 11:04:00 +03:00

Map Syntax by construction.

This commit is contained in:
Rob Rix 2015-10-23 18:24:19 -04:00
parent 08927d06b5
commit 16876343a4

View File

@ -232,9 +232,9 @@
// forall a b. Syntax a -> (a -> b) -> Syntax b
Syntax.prototype.map = function(transform) {
if (this.indexed != null) { return new Syntax(this.indexed, transform); }
if (this.keyed != null) { return new Syntax(this.keyed, transform); }
if (this.leaf != null) { return new Syntax(this.leaf, transform); }
if (this.indexed != null) { return new Syntax(this, transform); }
if (this.keyed != null) { return new Syntax(this, transform); }
if (this.leaf != null) { return new Syntax(this, transform); }
}
function Diff(json) {