mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-11 13:59:31 -06:00
JavaScript lib: fixed bug where an integer was returned by print().
This commit is contained in:
@@ -66,15 +66,15 @@ Fun.prototype.isComplete = function() {
|
||||
|
||||
/* Concrete syntax terms */
|
||||
|
||||
function Arr() { this.values = copy_arguments(arguments, 0); }
|
||||
Arr.prototype.print = function() { return this.values[0].print(); };
|
||||
Arr.prototype.sel = function(i) { return this.values[i.toIndex()]; };
|
||||
function Arr() { this.arr = copy_arguments(arguments, 0); }
|
||||
Arr.prototype.print = function() { return this.arr[0].print(); };
|
||||
Arr.prototype.sel = function(i) { return this.arr[i.toIndex()]; };
|
||||
|
||||
function Seq() { this.values = copy_arguments(arguments, 0); }
|
||||
Seq.prototype.print = function() { return join_print(this.values, " "); };
|
||||
function Seq() { this.seq = copy_arguments(arguments, 0); }
|
||||
Seq.prototype.print = function() { return join_print(this.seq, " "); };
|
||||
|
||||
function Variants() { this.values = copy_arguments(arguments, 0); }
|
||||
Variants.prototype.print = function() { return /*join_print(this.values, "/");*/ this.values[0].print(); };
|
||||
function Variants() { this.variants = copy_arguments(arguments, 0); }
|
||||
Variants.prototype.print = function() { return this.variants[0].print(); };
|
||||
|
||||
function Rp(index,value) { this.index = index; this.value = value; }
|
||||
Rp.prototype.print = function() { return this.index; };
|
||||
@@ -93,7 +93,7 @@ function Str(value) { this.value = value; }
|
||||
Str.prototype.print = function() { return this.value; };
|
||||
|
||||
function Int(value) { this.value = value; }
|
||||
Int.prototype.print = function() { return this.value; };
|
||||
Int.prototype.print = function() { return this.value.toString(); };
|
||||
Int.prototype.toIndex = function() { return this.value; };
|
||||
|
||||
/* Type annotation */
|
||||
@@ -192,6 +192,7 @@ function isArray(a) { return a && typeof a == 'object' && a.constructor == Array
|
||||
function isUndefined(a) { return typeof a == 'undefined'; }
|
||||
function isBoolean(a) { return typeof a == 'boolean'; }
|
||||
function isNumber(a) { return typeof a == 'number' && isFinite(a); }
|
||||
function isFunction(a) { return typeof a == 'function'; }
|
||||
|
||||
function dumpObject (obj) {
|
||||
if (isUndefined(obj)) {
|
||||
|
||||
Reference in New Issue
Block a user