From 3206f13be04814f42343f41168311a7c1fb1e8e3 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 23 Oct 2015 16:54:49 -0400 Subject: [PATCH] Syntax is a type. --- prototype/UI/index.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/prototype/UI/index.html b/prototype/UI/index.html index 4ce52453f..4a40fde9b 100644 --- a/prototype/UI/index.html +++ b/prototype/UI/index.html @@ -228,10 +228,11 @@ return this; } - function syntax(json, continuation) { - if (json instanceof Array) { return new Indexed(json, continuation); } - if (json instanceof Object) { return new Keyed(json, continuation); } - return new Leaf(json); + function Syntax(json, continuation) { + if (json instanceof Array) { this.indexed = new Indexed(json, continuation); } + else if (json instanceof Object) { this.keyed = new Keyed(json, continuation); } + else this.leaf = new Leaf(json); + return this; } function Diff(json) { @@ -240,7 +241,7 @@ } if (json.roll != null) { this.ranges = json.roll.extract; - this.roll = syntax(json.roll.unwrap, function(x) { return new Diff(x); }); + this.roll = new Syntax(json.roll.unwrap, function(x) { return new Diff(x); }); } return this; }