Permalink
Browse files

Basic support for unpacking R sexps in rserve.js

  • Loading branch information...
gordonwoodhull committed Mar 27, 2013
1 parent 6334764 commit 6e3d65e381d9a70acd68945bd7919eeac648c268
Showing with 52 additions and 16 deletions.
  1. +10 −10 htdocs/lib/ace_bundle.min.js
  2. +20 −2 htdocs/lib/dependencies_bundle.js
  3. +2 −2 htdocs/lib/dependencies_bundle.min.js
  4. +20 −2 htdocs/lib/js/rserve.js

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -33160,9 +33160,27 @@ Robj = {
}
}
}),
- symbol: make_basic("symbol"),
+ symbol: make_basic("symbol", {
+ json: function() {
+ return this.value;
+ }
+ }),
list: make_basic("list"),
- lang: make_basic("lang"),
+ lang: make_basic("lang", {
+ json: function() {
+ var values = _.map(this.value, function (x) { return x.json(); });
+ if (_.isUndefined(this.attributes)) {
+ return values;
+ } else {
+ var keys = this.attributes.value.names.value;
+ var result = {};
+ _.each(keys, function(key, i) {
+ result[key] = values[i];
+ });
+ return result;
+ }
+ }
+ }),
tagged_list: make_basic("tagged_list"),
tagged_lang: make_basic("tagged_lang"),
vector_exp: make_basic("vector_exp"),

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -603,9 +603,27 @@ Robj = {
}
}
}),
- symbol: make_basic("symbol"),
+ symbol: make_basic("symbol", {
+ json: function() {
+ return this.value;
+ }
+ }),
list: make_basic("list"),
- lang: make_basic("lang"),
+ lang: make_basic("lang", {
+ json: function() {
+ var values = _.map(this.value, function (x) { return x.json(); });
+ if (_.isUndefined(this.attributes)) {
+ return values;
+ } else {
+ var keys = this.attributes.value.names.value;
+ var result = {};
+ _.each(keys, function(key, i) {
+ result[key] = values[i];
+ });
+ return result;
+ }
+ }
+ }),
tagged_list: make_basic("tagged_list"),
tagged_lang: make_basic("tagged_lang"),
vector_exp: make_basic("vector_exp"),

0 comments on commit 6e3d65e

Please sign in to comment.