minigrace
Version:
A compiler for the Grace programming language
1,085 lines (1,074 loc) • 63.3 kB
JavaScript
let gracecode_intrinsic_sourceFile = "intrinsic.grace";
let gracecode_intrinsic_sha256 = "6e94e04bf55793f159478abdfb7bf89d7b49b4e53761ccc740bb1c62429755cc";
let gracecode_intrinsic_minigraceRevision = "b57591d29fc5ee5270d114920bf671367b8c3ecb";
let gracecode_intrinsic_minigraceGeneration = "5171";
if (typeof gctCache !== "undefined")
gctCache["intrinsic"] = "dialect:\nfreshScopes:\n $102 trait\n $103 trait\n $104 trait\nmodules:\npath:\n /Users/black/Development/mg/gracelang/minigrace/intrinsic.grace\nscope:$100:\n Exception Unknown (mth) $scope_done\n annotations Unknown (mth) $102\n asDebugString String (go) $scope_string\n asString String (go) $scope_string\n basicAsString String (go) $scope_string\n become(2) Unknown (mth) $scope_done\n constants Unknown (mth) $103\n controlStructures Unknown (mth) $104\n curriedPredicate(2) Unknown (mth) $scope_done\n engine Unknown (mth) $scope_done\n hashCombine(2) Unknown (mth) $scope_done\n inBrowser Unknown (mth) $scope_done\n isMe(1) Boolean (go) $scope_boolean\n myIdentityHash Number (go) $scope_number\n noneType Unknown (mth) $101\nscope:$101:\n &(1) Unknown (mth) $scope_done\n +(1) Unknown (mth) $scope_done\n -(1) Unknown (mth) $scope_done\n ==(1) Unknown (mth) $scope_done\n asDebugString String (go) $scope_string\n asString Unknown (mth) $scope_done\n basicAsString String (go) $scope_string\n hash Unknown (mth) $scope_done\n isMe(1) Boolean (go) $scope_boolean\n isNone Unknown (mth) $scope_done\n isType Unknown (mth) $scope_done\n matches(1) Unknown (mth) $scope_done\n methodNames Unknown (mth) $scope_done\n myIdentityHash Number (go) $scope_number\n name Unknown (mth) $scope_done\n prefix\u00ac Unknown (mth) $scope_done\n |(1) Unknown (mth) $scope_done\nscope:$102:\n abstract Unknown (mth) $scope_done annotation\n annotation Unknown (mth) $scope_done annotation\n asDebugString String (go) $scope_string\n asString String (go) $scope_string\n basicAsString String (go) $scope_string\n confidential Unknown (mth) $scope_done annotation\n isMe(1) Boolean (go) $scope_boolean\n myIdentityHash Number (go) $scope_number\n override Unknown (mth) $scope_done annotation\n public Unknown (mth) $scope_done annotation\n readable Unknown (mth) $scope_done annotation\n required Unknown (mth) $scope_done annotation\n writable Unknown (mth) $scope_done annotation\nscope:$103:\n BoundsError Unknown (mth) $scope_done\n DialectError Unknown (mth) $scope_done\n EnvironmentException Unknown (mth) $scope_done\n Exception Unknown (mth) $scope_done\n IteratorExhausted Unknown (mth) $scope_done\n NoSuchMethod Unknown (mth) $scope_done\n NoSuchObject Unknown (mth) $scope_done\n ProgrammingError Unknown (mth) $scope_done\n ResourceException Unknown (mth) $scope_done\n RuntimeError Unknown (mth) $scope_done\n TypeError Unknown (mth) $scope_done\n UnimplementedMethod Unknown (mth) $scope_done\n asDebugString String (go) $scope_string\n asString String (go) $scope_string\n basicAsString String (go) $scope_string\n done Unknown (mth) $scope_done\n infinity Unknown (mth) $scope_done\n isMe(1) Boolean (go) $scope_boolean\n myIdentityHash Number (go) $scope_number\n primitiveArray Unknown (mth) $105\nscope:$104:\n asDebugString String (go) $scope_string\n asString String (go) $scope_string\n basicAsString String (go) $scope_string\n isMe(1) Boolean (go) $scope_boolean\n myIdentityHash Number (go) $scope_number\n while(1)do(1) Unknown (mth) $scope_done\nscope:$105:\n asDebugString String (go) $scope_string\n asString String (go) $scope_string\n basicAsString String (go) $scope_string\n isMe(1) Boolean (go) $scope_boolean\n myIdentityHash Number (go) $scope_number\n new(1) Unknown (mth) $scope_done\nself:\n $100\ntypes:\n";
if (typeof originalSourceLines !== "undefined") {
originalSourceLines["intrinsic"] = [
"dialect \"none\"",
"",
"// The intrinsic module. This is the home for language elements that cannot",
"// be defined in Grace itself because they are beyond the descriptive power",
"// of the language.",
"",
"once method Exception { native \"js\" code ‹return ExceptionObject;› }",
"def UnimplementedMethod = Exception.refine \"UnimplementedMethod\"",
"",
"once class noneType {",
" method name { \"None\" }",
" method matches(obj) { false }",
" method | (other) { other }",
" method & (other) { self }",
" method prefix ¬ { interface { } }",
" method +(other) { other }",
" method -(other) {",
" UnimplementedMethod.raise \"can't subtract methods from type {name}\"",
" }",
" method asString { \"type {name}\" }",
" method methodNames {",
" UnimplementedMethod.raise",
" \"can't get the methods of type {name} because they form an infinite set\"",
" }",
" method ==(other) { self.isMe(other) }",
" method hash { myIdentityHash }",
" method isNone { true }",
" method isType { true }",
"}",
"",
"trait annotations {",
" // these _can_ be declared in Grace, but we don't want to repeat the",
" // definitions in many files",
"",
" method annotation is annotation",
" method required is annotation",
" method abstract is annotation",
" method confidential is annotation",
" method public is annotation",
" method readable is annotation",
" method writable is annotation",
" method override is annotation",
"}",
"",
"trait constants {",
" method Exception { outer.Exception }",
" method UnimplementedMethod { outer.UnimplementedMethod }",
" method ProgrammingError { native \"js\" code ‹",
" return ProgrammingErrorObject; ›",
" }",
" method EnvironmentException { native \"js\" code ‹",
" return EnvironmentExceptionObject; ›",
" }",
" method ResourceException { native \"js\" code ‹",
" return ResourceExceptionObject; ›",
" }",
" method RuntimeError { native \"js\" code ‹",
" return RuntimeErrorObject; ›",
" }",
" method TypeError { native \"js\" code ‹",
" return TypeErrorObject; ›",
" }",
" method NoSuchMethod { native \"js\" code ‹",
" return NoSuchMethodErrorObject; ›",
" }",
" method BoundsError { native \"js\" code ‹",
" return BoundsErrorObject; ›",
" }",
" method IteratorExhausted { native \"js\" code ‹",
" return IteratorExhaustedObject; ›",
" }",
" method NoSuchObject { native \"js\" code ‹",
" return NoSuchObjectErrorObject; ›",
" }",
" once method DialectError {",
" Exception.refine \"DialectError\"",
" }",
" once method infinity { native \"js\" code ‹",
" return new GraceNum(Infinity); ›",
" }",
" method done { native \"js\" code ‹",
" return GraceDone;›",
" }",
"",
" once class primitiveArray {",
" method new(size) {",
" native \"js\" code ‹return new GracePrimitiveArray(var_size._value);›",
" }",
" }",
"}",
"",
"trait controlStructures {",
" method while (cond) do (block) {",
" native \"js\" code ‹",
" const c = var_cond;",
" const b = var_block;",
" if (c.className === \"boolean\" || c.className === \"number\")",
" throw new GraceExceptionPacket(TypeErrorObject,",
" new GraceString(\"expected Block for first argument of \" +",
" \"while(_)do(_), got \" + c.className + \".\"));",
" if ((typeof minigrace != \"undefined\") && minigrace.breakLoops) {",
" var count = 0;",
" var runningTime = 0;",
" var runningCount = 0;",
" var startTime = new Date();",
" var diff;",
" while (Grace_isTrue(callmethod(c, \"apply\", [0]))) {",
" count++;",
" if (count % 100000 === 0 && ((diff=new Date()-startTime) > 5000)) {",
" var totTime = runningTime + diff;",
" var totIterations = runningCount + count;",
" if (! confirm(\"A while loop is taking a long time to run. \" +",
" \"Do you want to continue? \" +",
" totIterations + \" iterations of the loop have taken \" +",
" totTime + \"ms so far.\" +",
" \"\\n\\nChoose Cancel to stop the program, or OK to \" +",
" \"let it continue.\"))",
" throw new GraceExceptionPacket(ResourceExceptionObject,",
" new GraceString(\"user abort of long-running loop.\"));",
" else {",
" runningCount += count;",
" runningTime += diff;",
" count = 0;",
" startTime = new Date();",
" }",
" }",
" callmethod(b, \"apply\", [0]);",
" }",
" } else {",
" while (Grace_isTrue(callmethod(c, \"apply\", [0]))) {",
" callmethod(b, \"apply\", [0]);",
" }",
" }",
" return GraceDone;›",
" }",
"}",
"",
"method inBrowser {",
" native \"js\" code ‹return (typeof global === \"undefined\") ? GraceTrue : GraceFalse;›",
"}",
"",
"method engine {",
" native \"js\" code ‹return new GraceString(\"js\");› // only when generating JS",
" constants.ProgrammingError.raise \"the method `engine` must be augmented to support this execution engine\"",
"}",
"",
"method become(a, b) {",
" // not clear what this is actualy intended to do ... it's used in statictypes dialect",
" // it won't exchange the prototypes of the two objects, so they may not work.",
" native \"js\" code ‹",
" for (let k in var_a) {",
" const temp = var_a[k];",
" var_a[k] = var_b[k];",
" var_b[k] = temp;",
" }",
" GraceDone;",
" ›",
"}",
"",
"method hashCombine(a, b) {",
" native \"c\" code ‹",
" int a = (int)(args[0]->data);",
" int b = (int)(args[1]->data);",
" int aHash = a * 1664525;",
" int bHash = (b * 1664525 - 0xA21FE89) * 3;",
" return alloc_Float64((aHash * 2) ^ bHash);›",
" native \"js\" code ‹",
" var a = var_a._value;",
" var b = var_b._value;",
" var aHash = a * 1664525;",
" var bHash = (b * 1664525 - 0xA21FE89) * 3;",
" result = new GraceNum((aHash * 2) ^ bHash);›",
"}",
"",
"method curriedPredicate(subject, methodName) {",
" native \"js\" code ‹",
" var methName = var_methodName._value;",
" if (methName.substr(methName.length - 3) === \"(_)\") {",
" methName = methName.substring(0, methName.length - 3) + \"(1)\"",
" } else if (methName.substr(methName.length - 3) !== \"(1)\") {",
" raiseException(RequestErrorObject,",
" \"curriedPredicate requires a single-argument method such as ==(_); given \" + methName)",
" }",
" return new GracePredicatePattern(arg =>",
" selfRequest(var_subject, methName, [1], arg));",
" ›",
"}" ];
}
function gracecode_intrinsic() {
importedModules["intrinsic"] = this;
const var_$module = this;
this.definitionModule = "intrinsic";
this.definitionLine = 1;
setLineNumber(1); // compilenode dialect
// Dialect "none"
const var_$dialect = new GraceModule("none");
this.outer = var_$dialect;
this.closureKeys = this.closureKeys || [];
this.closureKeys.push("outer_intrinsic_1");
this.outer_intrinsic_1 = var_$dialect;
var func0 = function(argcv) { // method Exception, line 7
var returnTarget = invocationCount;
invocationCount++;
setLineNumber(7); // compilenode call
var result = GraceDone; // start native code from line 7
return ExceptionObject; // end native code insertion
return result;
}; // end of method Exception
function memofunc0(argcv) {
if (! this.data["memo$Exception"]) // parameterless memo function
this.data["memo$Exception"] = func0.call(this, argcv);
return this.data["memo$Exception"];
};
this.methods["Exception"] = memofunc0;
memofunc0.methodName = "Exception";
memofunc0.paramCounts = [0];
memofunc0.paramNames = [];
memofunc0.definitionLine = 7;
memofunc0.definitionModule = "intrinsic";
func0.methodName = "Exception";
func0.paramCounts = [0];
func0.paramNames = [];
func0.definitionLine = 7;
func0.definitionModule = "intrinsic";
var func2 = function(argcv) { // method noneType, line 10
var returnTarget = invocationCount;
invocationCount++;
setLineNumber(10); // compilenode object
var obj3_build = function(ignore, outerObj, aliases, exclusions) {
this.closureKeys = this.closureKeys || [];
this.closureKeys.push("outer_intrinsic_10");
this.outer_intrinsic_10 = outerObj;
const inheritedExclusions = { };
for (var eix = 0, eLen = exclusions.length; eix < eLen; eix ++) {
const exMeth = exclusions[eix];
inheritedExclusions[exMeth] = this.methods[exMeth]; };
var func4 = function(argcv) { // method name, line 11
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("name", 0, numArgs - 0);
}
setLineNumber(11); // compilenode string
var string5 = new GraceString("None");
return string5;
}; // end of method name
this.methods["name"] = func4;
func4.methodName = "name";
func4.paramCounts = [0];
func4.paramNames = [];
func4.definitionLine = 11;
func4.definitionModule = "intrinsic";
var func6 = function(argcv, var_obj) { // method matches(_), line 12
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 1) && (numArgs !== 1)) {
raiseTypeArgError("matches(_)", 0, numArgs - 1);
}
setLineNumber(12); // compilenode member
return GraceFalse;
}; // end of method matches(_)
this.methods["matches(1)"] = func6;
func6.methodName = "matches(1)";
func6.paramCounts = [1];
func6.paramNames = ["obj"];
func6.definitionLine = 12;
func6.definitionModule = "intrinsic";
var func8 = function(argcv, var_other) { // method |(_), line 13
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 1) && (numArgs !== 1)) {
raiseTypeArgError("|(_)", 0, numArgs - 1);
}
return var_other;
}; // end of method |(_)
this.methods["|(1)"] = func8;
func8.methodName = "|(1)";
func8.paramCounts = [1];
func8.paramNames = ["other"];
func8.definitionLine = 13;
func8.definitionModule = "intrinsic";
var func9 = function(argcv, var_other) { // method &(_), line 14
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 1) && (numArgs !== 1)) {
raiseTypeArgError("&(_)", 0, numArgs - 1);
}
setLineNumber(14); // compilenode yourself
return this;
}; // end of method &(_)
this.methods["&(1)"] = func9;
func9.methodName = "&(1)";
func9.paramCounts = [1];
func9.paramNames = ["other"];
func9.definitionLine = 14;
func9.definitionModule = "intrinsic";
var func10 = function(argcv) { // method prefix¬, line 15
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("prefix¬", 0, numArgs - 0);
}
setLineNumber(15); // compilenode interfaceliteral
// interface literal
var iface11 = new GraceInterface("\u2039anon\u203a");
iface11.typeMethods = {
};
return iface11;
}; // end of method prefix¬
this.methods["prefix\u00ac"] = func10;
func10.methodName = "prefix\u00ac";
func10.paramCounts = [0];
func10.paramNames = [];
func10.definitionLine = 15;
func10.definitionModule = "intrinsic";
var func12 = function(argcv, var_other) { // method +(_), line 16
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 1) && (numArgs !== 1)) {
raiseTypeArgError("+(_)", 0, numArgs - 1);
}
return var_other;
}; // end of method +(_)
this.methods["+(1)"] = func12;
func12.methodName = "+(1)";
func12.paramCounts = [1];
func12.paramNames = ["other"];
func12.definitionLine = 16;
func12.definitionModule = "intrinsic";
var func13 = function(argcv, var_other) { // method -(_), line 17
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 1) && (numArgs !== 1)) {
raiseTypeArgError("-(_)", 0, numArgs - 1);
}
setLineNumber(18); // compilenode string
// call case 4: other requests
var call17 = selfRequest(this, "name", [0]);
// call case 4: other requests
var string18 = new GraceString("can't subtract methods from type ");
var concat16 = request(string18, "++(1)", [1], call17);
var concat15 = request(concat16, "++(1)", [1], GraceEmptyString);
// call case 4: other requests
if (var_UnimplementedMethod === undefined) raiseUninitializedVariable("UnimplementedMethod");
var call14 = request(var_UnimplementedMethod, "raise(1)", [1], concat15);
return call14;
}; // end of method -(_)
this.methods["-(1)"] = func13;
func13.methodName = "-(1)";
func13.paramCounts = [1];
func13.paramNames = ["other"];
func13.definitionLine = 17;
func13.definitionModule = "intrinsic";
var func19 = function(argcv) { // method asString, line 20
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("asString", 0, numArgs - 0);
}
setLineNumber(20); // compilenode string
// call case 4: other requests
var call22 = selfRequest(this, "name", [0]);
// call case 4: other requests
var string23 = new GraceString("type ");
var concat21 = request(string23, "++(1)", [1], call22);
var concat20 = request(concat21, "++(1)", [1], GraceEmptyString);
return concat20;
}; // end of method asString
this.methods["asString"] = func19;
func19.methodName = "asString";
func19.paramCounts = [0];
func19.paramNames = [];
func19.definitionLine = 20;
func19.definitionModule = "intrinsic";
var func24 = function(argcv) { // method methodNames, line 21
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("methodNames", 0, numArgs - 0);
}
setLineNumber(23); // compilenode string
var string27 = new GraceString(" because they form an infinite set");
// call case 4: other requests
var call29 = selfRequest(this, "name", [0]);
// call case 4: other requests
var string30 = new GraceString("can't get the methods of type ");
var concat28 = request(string30, "++(1)", [1], call29);
var concat26 = request(concat28, "++(1)", [1], string27);
// call case 4: other requests
if (var_UnimplementedMethod === undefined) raiseUninitializedVariable("UnimplementedMethod");
var call25 = request(var_UnimplementedMethod, "raise(1)", [1], concat26);
return call25;
}; // end of method methodNames
this.methods["methodNames"] = func24;
func24.methodName = "methodNames";
func24.paramCounts = [0];
func24.paramNames = [];
func24.definitionLine = 21;
func24.definitionModule = "intrinsic";
var func31 = function(argcv, var_other) { // method ==(_), line 25
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 1) && (numArgs !== 1)) {
raiseTypeArgError("==(_)", 0, numArgs - 1);
}
setLineNumber(25); // compilenode call
var call32 = selfRequest(this, "isMe(1)", [1], var_other);
return call32;
}; // end of method ==(_)
this.methods["==(1)"] = func31;
func31.methodName = "==(1)";
func31.paramCounts = [1];
func31.paramNames = ["other"];
func31.definitionLine = 25;
func31.definitionModule = "intrinsic";
var func33 = function(argcv) { // method hash, line 26
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("hash", 0, numArgs - 0);
}
setLineNumber(26); // compilenode member
var call34 = selfRequest(this, "myIdentityHash", [0]);
return call34;
}; // end of method hash
this.methods["hash"] = func33;
func33.methodName = "hash";
func33.paramCounts = [0];
func33.paramNames = [];
func33.definitionLine = 26;
func33.definitionModule = "intrinsic";
var func35 = function(argcv) { // method isNone, line 27
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("isNone", 0, numArgs - 0);
}
setLineNumber(27); // compilenode member
return GraceTrue;
}; // end of method isNone
this.methods["isNone"] = func35;
func35.methodName = "isNone";
func35.paramCounts = [0];
func35.paramNames = [];
func35.definitionLine = 27;
func35.definitionModule = "intrinsic";
var func37 = function(argcv) { // method isType, line 28
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("isType", 0, numArgs - 0);
}
setLineNumber(28); // compilenode member
return GraceTrue;
}; // end of method isType
this.methods["isType"] = func37;
func37.methodName = "isType";
func37.paramCounts = [0];
func37.paramNames = [];
func37.definitionLine = 28;
func37.definitionModule = "intrinsic";
const overridenByAliases = { };
for (let aix = 0, aLen = aliases.length; aix < aLen; aix ++) {
const a = aliases[aix];
const newNm = a.newName;
const oldNm = a.oldName;
overridenByAliases[newNm] = this.methods[newNm];
const m = confidentialVersion(overridenByAliases[oldNm] || this.methods[oldNm], newNm);
m.definitionLine = 10;
m.definitionModule = "intrinsic";
this.methods[newNm] = m;
}
for (let exName in inheritedExclusions) {
if (inheritedExclusions.hasOwnProperty(exName)) {
if (inheritedExclusions[exName]) {
this.methods[exName] = inheritedExclusions[exName];
} else {
delete this.methods[exName];
}
}
}
var obj3_init = function() { // init of object on line 10
};
return obj3_init; // from compileBuildAndInitFunctions(_)inMethod(_)
};
var obj3 = emptyGraceObject("noneType", "intrinsic", 10);
var obj3_init = obj3_build.call(obj3, null, this, [], []);
obj3_init.call(obj3); // end of compileobject
return obj3;
}; // end of method noneType
function memofunc2(argcv) {
if (! this.data["memo$noneType"]) // parameterless memo function
this.data["memo$noneType"] = func2.call(this, argcv);
return this.data["memo$noneType"];
};
this.methods["noneType"] = memofunc2;
memofunc2.methodName = "noneType";
memofunc2.paramCounts = [0];
memofunc2.paramNames = [];
memofunc2.definitionLine = 10;
memofunc2.definitionModule = "intrinsic";
func2.methodName = "noneType";
func2.paramCounts = [0];
func2.paramNames = [];
func2.definitionLine = 10;
func2.definitionModule = "intrinsic";
var func39 = function(argcv) { // method annotations, line 31
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("annotations", 0, numArgs - 0);
}
var ouc = emptyGraceObject("annotations", "intrinsic", 31);
var ouc_init = this.methods["annotations$build(3)"].call(this, null, ouc, [], []);
ouc_init.call(ouc);
return ouc;
}; // end of method annotations
this.methods["annotations"] = func39;
func39.methodName = "annotations";
func39.paramCounts = [0];
func39.paramNames = [];
func39.definitionLine = 31;
func39.definitionModule = "intrinsic";
var func40 = function(argcv, inheritingObject, aliases, exclusions) { // method annotations$build(_,_,_), line 31
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 4;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("annotations", 0, numArgs - 0);
}
var obj41_build = function(ignore, outerObj, aliases, exclusions) {
this.closureKeys = this.closureKeys || [];
this.closureKeys.push("outer_intrinsic_31");
this.outer_intrinsic_31 = outerObj;
const inheritedExclusions = { };
for (var eix = 0, eLen = exclusions.length; eix < eLen; eix ++) {
const exMeth = exclusions[eix];
inheritedExclusions[exMeth] = this.methods[exMeth]; };
var func42 = function(argcv) { // method annotation, line 35
var returnTarget = invocationCount;
invocationCount++;
setLineNumber(35); // annotation method
raiseException(ProgrammingErrorObject,
"annotation is an annotation; it cannot be requested as a method");
}; // end of method annotation
this.methods["annotation"] = func42;
func42.methodName = "annotation";
func42.paramCounts = [0];
func42.paramNames = [];
func42.definitionLine = 35;
func42.definitionModule = "intrinsic";
var func43 = function(argcv) { // method required, line 36
var returnTarget = invocationCount;
invocationCount++;
setLineNumber(36); // annotation method
raiseException(ProgrammingErrorObject,
"required is an annotation; it cannot be requested as a method");
}; // end of method required
this.methods["required"] = func43;
func43.methodName = "required";
func43.paramCounts = [0];
func43.paramNames = [];
func43.definitionLine = 36;
func43.definitionModule = "intrinsic";
var func44 = function(argcv) { // method abstract, line 37
var returnTarget = invocationCount;
invocationCount++;
setLineNumber(37); // annotation method
raiseException(ProgrammingErrorObject,
"abstract is an annotation; it cannot be requested as a method");
}; // end of method abstract
this.methods["abstract"] = func44;
func44.methodName = "abstract";
func44.paramCounts = [0];
func44.paramNames = [];
func44.definitionLine = 37;
func44.definitionModule = "intrinsic";
var func45 = function(argcv) { // method confidential, line 38
var returnTarget = invocationCount;
invocationCount++;
setLineNumber(38); // annotation method
raiseException(ProgrammingErrorObject,
"confidential is an annotation; it cannot be requested as a method");
}; // end of method confidential
this.methods["confidential"] = func45;
func45.methodName = "confidential";
func45.paramCounts = [0];
func45.paramNames = [];
func45.definitionLine = 38;
func45.definitionModule = "intrinsic";
var func46 = function(argcv) { // method public, line 39
var returnTarget = invocationCount;
invocationCount++;
setLineNumber(39); // annotation method
raiseException(ProgrammingErrorObject,
"public is an annotation; it cannot be requested as a method");
}; // end of method public
this.methods["public"] = func46;
func46.methodName = "public";
func46.paramCounts = [0];
func46.paramNames = [];
func46.definitionLine = 39;
func46.definitionModule = "intrinsic";
var func47 = function(argcv) { // method readable, line 40
var returnTarget = invocationCount;
invocationCount++;
setLineNumber(40); // annotation method
raiseException(ProgrammingErrorObject,
"readable is an annotation; it cannot be requested as a method");
}; // end of method readable
this.methods["readable"] = func47;
func47.methodName = "readable";
func47.paramCounts = [0];
func47.paramNames = [];
func47.definitionLine = 40;
func47.definitionModule = "intrinsic";
var func48 = function(argcv) { // method writable, line 41
var returnTarget = invocationCount;
invocationCount++;
setLineNumber(41); // annotation method
raiseException(ProgrammingErrorObject,
"writable is an annotation; it cannot be requested as a method");
}; // end of method writable
this.methods["writable"] = func48;
func48.methodName = "writable";
func48.paramCounts = [0];
func48.paramNames = [];
func48.definitionLine = 41;
func48.definitionModule = "intrinsic";
var func49 = function(argcv) { // method override, line 42
var returnTarget = invocationCount;
invocationCount++;
setLineNumber(42); // annotation method
raiseException(ProgrammingErrorObject,
"override is an annotation; it cannot be requested as a method");
}; // end of method override
this.methods["override"] = func49;
func49.methodName = "override";
func49.paramCounts = [0];
func49.paramNames = [];
func49.definitionLine = 42;
func49.definitionModule = "intrinsic";
const overridenByAliases = { };
for (let aix = 0, aLen = aliases.length; aix < aLen; aix ++) {
const a = aliases[aix];
const newNm = a.newName;
const oldNm = a.oldName;
overridenByAliases[newNm] = this.methods[newNm];
const m = confidentialVersion(overridenByAliases[oldNm] || this.methods[oldNm], newNm);
m.definitionLine = 31;
m.definitionModule = "intrinsic";
this.methods[newNm] = m;
}
for (let exName in inheritedExclusions) {
if (inheritedExclusions.hasOwnProperty(exName)) {
if (inheritedExclusions[exName]) {
this.methods[exName] = inheritedExclusions[exName];
} else {
delete this.methods[exName];
}
}
}
var obj41_init = function() { // init of object on line 31
};
return obj41_init; // from compileBuildAndInitFunctions(_)inMethod(_)
};
var obj41_init = obj41_build.call(inheritingObject, null, this, aliases, exclusions);
return obj41_init; // from compileBuildMethodFor(_)withObjCon(_)inside(_)
}; // end of method annotations$build(_,_,_)
this.methods["annotations$build(3)"] = func40;
func40.methodName = "annotations$build(3)";
func40.paramCounts = [0];
func40.paramNames = [];
func40.definitionLine = 31;
func40.definitionModule = "intrinsic";
var func50 = function(argcv) { // method constants, line 45
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("constants", 0, numArgs - 0);
}
var ouc = emptyGraceObject("constants", "intrinsic", 45);
var ouc_init = this.methods["constants$build(3)"].call(this, null, ouc, [], []);
ouc_init.call(ouc);
return ouc;
}; // end of method constants
this.methods["constants"] = func50;
func50.methodName = "constants";
func50.paramCounts = [0];
func50.paramNames = [];
func50.definitionLine = 45;
func50.definitionModule = "intrinsic";
var func51 = function(argcv, inheritingObject, aliases, exclusions) { // method constants$build(_,_,_), line 45
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 4;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("constants", 0, numArgs - 0);
}
var obj52_build = function(ignore, outerObj, aliases, exclusions) {
this.closureKeys = this.closureKeys || [];
this.closureKeys.push("outer_intrinsic_45");
this.outer_intrinsic_45 = outerObj;
const inheritedExclusions = { };
for (var eix = 0, eLen = exclusions.length; eix < eLen; eix ++) {
const exMeth = exclusions[eix];
inheritedExclusions[exMeth] = this.methods[exMeth]; };
var func53 = function(argcv) { // method Exception, line 46
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("Exception", 0, numArgs - 0);
}
setLineNumber(46); // compilenode yourself
var call54 = selfRequest(this.outer_intrinsic_45, "Exception", [0]);
return call54;
}; // end of method Exception
this.methods["Exception"] = func53;
func53.methodName = "Exception";
func53.paramCounts = [0];
func53.paramNames = [];
func53.definitionLine = 46;
func53.definitionModule = "intrinsic";
var func55 = function(argcv) { // method UnimplementedMethod, line 47
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("UnimplementedMethod", 0, numArgs - 0);
}
setLineNumber(47); // compilenode yourself
var call56 = selfRequest(this.outer_intrinsic_45, "UnimplementedMethod", [0]);
return call56;
}; // end of method UnimplementedMethod
this.methods["UnimplementedMethod"] = func55;
func55.methodName = "UnimplementedMethod";
func55.paramCounts = [0];
func55.paramNames = [];
func55.definitionLine = 47;
func55.definitionModule = "intrinsic";
var func57 = function(argcv) { // method ProgrammingError, line 48
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("ProgrammingError", 0, numArgs - 0);
}
setLineNumber(48); // compilenode call
var result = GraceDone; // start native code from line 48
return ProgrammingErrorObject; // end native code insertion
return result;
}; // end of method ProgrammingError
this.methods["ProgrammingError"] = func57;
func57.methodName = "ProgrammingError";
func57.paramCounts = [0];
func57.paramNames = [];
func57.definitionLine = 48;
func57.definitionModule = "intrinsic";
var func59 = function(argcv) { // method EnvironmentException, line 51
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("EnvironmentException", 0, numArgs - 0);
}
setLineNumber(51); // compilenode call
var result = GraceDone; // start native code from line 51
return EnvironmentExceptionObject; // end native code insertion
return result;
}; // end of method EnvironmentException
this.methods["EnvironmentException"] = func59;
func59.methodName = "EnvironmentException";
func59.paramCounts = [0];
func59.paramNames = [];
func59.definitionLine = 51;
func59.definitionModule = "intrinsic";
var func61 = function(argcv) { // method ResourceException, line 54
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("ResourceException", 0, numArgs - 0);
}
setLineNumber(54); // compilenode call
var result = GraceDone; // start native code from line 54
return ResourceExceptionObject; // end native code insertion
return result;
}; // end of method ResourceException
this.methods["ResourceException"] = func61;
func61.methodName = "ResourceException";
func61.paramCounts = [0];
func61.paramNames = [];
func61.definitionLine = 54;
func61.definitionModule = "intrinsic";
var func63 = function(argcv) { // method RuntimeError, line 57
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("RuntimeError", 0, numArgs - 0);
}
setLineNumber(57); // compilenode call
var result = GraceDone; // start native code from line 57
return RuntimeErrorObject; // end native code insertion
return result;
}; // end of method RuntimeError
this.methods["RuntimeError"] = func63;
func63.methodName = "RuntimeError";
func63.paramCounts = [0];
func63.paramNames = [];
func63.definitionLine = 57;
func63.definitionModule = "intrinsic";
var func65 = function(argcv) { // method TypeError, line 60
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("TypeError", 0, numArgs - 0);
}
setLineNumber(60); // compilenode call
var result = GraceDone; // start native code from line 60
return TypeErrorObject; // end native code insertion
return result;
}; // end of method TypeError
this.methods["TypeError"] = func65;
func65.methodName = "TypeError";
func65.paramCounts = [0];
func65.paramNames = [];
func65.definitionLine = 60;
func65.definitionModule = "intrinsic";
var func67 = function(argcv) { // method NoSuchMethod, line 63
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("NoSuchMethod", 0, numArgs - 0);
}
setLineNumber(63); // compilenode call
var result = GraceDone; // start native code from line 63
return NoSuchMethodErrorObject; // end native code insertion
return result;
}; // end of method NoSuchMethod
this.methods["NoSuchMethod"] = func67;
func67.methodName = "NoSuchMethod";
func67.paramCounts = [0];
func67.paramNames = [];
func67.definitionLine = 63;
func67.definitionModule = "intrinsic";
var func69 = function(argcv) { // method BoundsError, line 66
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("BoundsError", 0, numArgs - 0);
}
setLineNumber(66); // compilenode call
var result = GraceDone; // start native code from line 66
return BoundsErrorObject; // end native code insertion
return result;
}; // end of method BoundsError
this.methods["BoundsError"] = func69;
func69.methodName = "BoundsError";
func69.paramCounts = [0];
func69.paramNames = [];
func69.definitionLine = 66;
func69.definitionModule = "intrinsic";
var func71 = function(argcv) { // method IteratorExhausted, line 69
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("IteratorExhausted", 0, numArgs - 0);
}
setLineNumber(69); // compilenode call
var result = GraceDone; // start native code from line 69
return IteratorExhaustedObject; // end native code insertion
return result;
}; // end of method IteratorExhausted
this.methods["IteratorExhausted"] = func71;
func71.methodName = "IteratorExhausted";
func71.paramCounts = [0];
func71.paramNames = [];
func71.definitionLine = 69;
func71.definitionModule = "intrinsic";
var func73 = function(argcv) { // method NoSuchObject, line 72
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("NoSuchObject", 0, numArgs - 0);
}
setLineNumber(72); // compilenode call
var result = GraceDone; // start native code from line 72
return NoSuchObjectErrorObject; // end native code insertion
return result;
}; // end of method NoSuchObject
this.methods["NoSuchObject"] = func73;
func73.methodName = "NoSuchObject";
func73.paramCounts = [0];
func73.paramNames = [];
func73.definitionLine = 72;
func73.definitionModule = "intrinsic";
var func75 = function(argcv) { // method DialectError, line 75
var returnTarget = invocationCount;
invocationCount++;
setLineNumber(76); // compilenode string
var string77 = new GraceString("DialectError");
// call case 4: other requests
var call78 = selfRequest(this, "Exception", [0]);
var call76 = request(call78, "refine(1)", [1], string77);
return call76;
}; // end of method DialectError
function memofunc75(argcv) {
if (! this.data["memo$DialectError"]) // parameterless memo function
this.data["memo$DialectError"] = func75.call(this, argcv);
return this.data["memo$DialectError"];
};
this.methods["DialectError"] = memofunc75;
memofunc75.methodName = "DialectError";
memofunc75.paramCounts = [0];
memofunc75.paramNames = [];
memofunc75.definitionLine = 75;
memofunc75.definitionModule = "intrinsic";
func75.methodName = "DialectError";
func75.paramCounts = [0];
func75.paramNames = [];
func75.definitionLine = 75;
func75.definitionModule = "intrinsic";
var func79 = function(argcv) { // method infinity, line 78
var returnTarget = invocationCount;
invocationCount++;
setLineNumber(78); // compilenode call
var result = GraceDone; // start native code from line 78
return new GraceNum(Infinity); // end native code insertion
return result;
}; // end of method infinity
function memofunc79(argcv) {
if (! this.data["memo$infinity"]) // parameterless memo function
this.data["memo$infinity"] = func79.call(this, argcv);
return this.data["memo$infinity"];
};
this.methods["infinity"] = memofunc79;
memofunc79.methodName = "infinity";
memofunc79.paramCounts = [0];
memofunc79.paramNames = [];
memofunc79.definitionLine = 78;
memofunc79.definitionModule = "intrinsic";
func79.methodName = "infinity";
func79.paramCounts = [0];
func79.paramNames = [];
func79.definitionLine = 78;
func79.definitionModule = "intrinsic";
var func81 = function(argcv) { // method done, line 81
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 0) && (numArgs !== 0)) {
raiseTypeArgError("done", 0, numArgs - 0);
}
setLineNumber(81); // compilenode call
var result = GraceDone; // start native code from line 81
return GraceDone; // end native code insertion
return result;
}; // end of method done
this.methods["done"] = func81;
func81.methodName = "done";
func81.paramCounts = [0];
func81.paramNames = [];
func81.definitionLine = 81;
func81.definitionModule = "intrinsic";
var func83 = function(argcv) { // method primitiveArray, line 85
var returnTarget = invocationCount;
invocationCount++;
setLineNumber(85); // compilenode object
var obj84_build = function(ignore, outerObj, aliases, exclusions) {
this.closureKeys = this.closureKeys || [];
this.closureKeys.push("outer_intrinsic_85");
this.outer_intrinsic_85 = outerObj;
const inheritedExclusions = { };
for (var eix = 0, eLen = exclusions.length; eix < eLen; eix ++) {
const exMeth = exclusions[eix];
inheritedExclusions[exMeth] = this.methods[exMeth]; };
var func85 = function(argcv, var_size) { // method new(_), line 86
var returnTarget = invocationCount;
invocationCount++;
const numArgs = arguments.length - 1;
if ((numArgs > 1) && (numArgs !== 1)) {
raiseTypeArgError("new(_)", 0, numArgs - 1);
}
setLineNumber(87); // compilenode call
var result = GraceDone; // start native code from line 87
return new GracePrimitiveArray(var_size._value); // end native code insertion
return result;
}; // end of method new(_)
this.methods["new(1)"] = func85;
func85.methodName = "new(1)";
func85.paramCounts = [1];
func85.paramNames = ["size"];
func85.definitionLine = 86;
func85.definitionModule = "intrinsic";
const overridenByAliases = { };
for (let aix = 0, aLen = aliases.length; aix < aLen; aix ++) {
const a = aliases[aix];
const newNm = a.newName;
const oldNm = a.oldName;
overridenByAliases[newNm] = this.methods[newNm];
const m = confidentialVersion(overridenByAliases[oldNm] || this.methods[oldNm], newNm);
m.definitionLine = 85;
m.definitionModule = "intrinsic";
this.methods[newNm] = m;
}
for (let exName in inheritedExclusions) {
if (inheritedExclusions.hasOwnProperty(exName)) {
if (inheritedExclusions[exName]) {
this.methods[exName] = inheritedExclusions[exName];
} else {
delete this.methods[exName];
}
}
}
var obj84_init = function() { // init of object on line 85
};
return obj84_init; // from compileBuildAndInitFunctions(_)inMethod(_)
};
var obj84 = emptyGraceObject("constants.primitiveArray", "intrinsic", 85);
var obj84_init = obj84_build.call(obj84, null, this, [], []);
obj84_init.call(obj84); // end of compileobject
return obj84;
}; // end of method primitiveArray
function memofunc83(argcv) {
if (! this.data["memo$primitiveArray"]) // parameterless memo function
this.data["memo$primitiveArray"] = func83.call(this, argcv);
return this.data["memo$primitiveArray"];
};
this.methods["primitiveArray"] = memofunc83;
memofunc83.methodName = "primitiveArray";
memofunc83.paramCounts = [0];
memofunc83.paramNames = [];
memofunc83.definitionLine = 85;
memofunc83.definitionModule = "intrinsic";
func83.methodName = "primitiveArray";
func83.paramCounts = [0];
func83.paramNames = [];
func83.definitionLine = 85;
func83.definitionModule = "intrinsic";
const overridenByAliases = { };
for (let aix = 0, aLen = aliases.length; aix < aLen; aix ++) {
const a = aliases[aix];
const newNm = a.newName;
co