UNPKG

minigrace

Version:

A compiler for the Grace programming language

1,096 lines 74.3 kB
let gracecode_unixFilePath_sourceFile = "/Users/black/Development/mg/gracelang/minigrace/unixFilePath.grace"; let gracecode_unixFilePath_sha256 = "c682fdc561b45486b152e5d8582783a5d4d8d09912522128470fc44d84f67561"; let gracecode_unixFilePath_minigraceRevision = "b57591d29fc5ee5270d114920bf671367b8c3ecb"; let gracecode_unixFilePath_minigraceGeneration = "5171"; if (typeof gctCache !== "undefined") gctCache["unixFilePath"] = "dialect:\n standard\nfreshScopes:\n $102\nmethodTypes:$102:\n exists \u2192 Boolean\n newer(other:Unknown) \u2192 Boolean\nmodules:\n io\n standard\npath:\n /Users/black/Development/mg/gracelang/minigrace/unixFilePath.grace\nscope:$101:\n FilePath type\n asDebugString String (go) $scope_string\n asString String (go) $scope_string\n basicAsString String (go) $scope_string\n delimiter Unknown (def) $scope_string public\n file(1)onPath(1)otherwise(1) Unknown (mth) $scope_done\n filePath Unknown (mth) $102\n fromString(1) Unknown (mth) $scope_done\n isMe(1) Boolean (go) $scope_boolean\n myIdentityHash Number (go) $scope_number\n null Unknown (def) $103 public\n sep Unknown (def) $scope_string public\n split(1) Unknown (mth) $scope_done\n withBase(1) Unknown (mth) $scope_done\n withDirectory(1) Unknown (mth) $scope_done\n withDirectory(1)base(1)extension(1) Unknown (mth) $scope_done\n withExtension(1) Unknown (mth) $scope_done\nscope:$102:\n ::(1) Unknown (mth) $scope_done\n ==(1) Unknown (mth) $scope_done\n absolute Unknown (mth) $scope_done\n asDebugString Unknown (mth) $scope_done\n asString Unknown (mth) $scope_done\n base Unknown (var) $scopeEmpty public\n base:=(1) Unknown (var) $scopeEmpty public\n basicAsString String (go) $scope_string\n copy Unknown (mth) $scope_done\n dir Unknown (var) $scopeEmpty\n dir:=(1) Unknown (var) $scopeEmpty\n directory Unknown (mth) $scope_done\n directory:=(1) Unknown (mth) $scope_done\n exists Boolean (mth) $scope_done\n extension Unknown (var) $scopeEmpty public\n extension:=(1) Unknown (var) $scopeEmpty public\n hash Unknown (mth) $scope_done\n inQuotes Unknown (mth) $scope_done\n isAbsolute Unknown (mth) $scope_done\n isMe(1) Boolean (go) $scope_boolean\n myIdentityHash Number (go) $scope_number\n newer(1) Boolean (mth) $scope_done\n prefix== Unknown (mth) $scope_done\n prefix\u2260 Unknown (mth) $scope_done\n quoted Unknown (mth) $scope_done\n setBase(1) Unknown (mth) $scope_done\n setDirectory(1) Unknown (mth) $scope_done\n setExtension(1) Unknown (mth) $scope_done\n shortName Unknown (mth) $scope_done\n \u2260(1) Unknown (mth) $scope_done\nscope:$103:\n ::(1) Unknown (mth) $scope_done\n ==(1) Unknown (mth) $scope_done\n absolute Unknown (mth) $scope_done\n asDebugString Unknown (mth) $scope_done\n asString Unknown (mth) $scope_done\n base Unknown (var) $scopeEmpty public\n base:=(1) Unknown (var) $scopeEmpty public\n basicAsString String (go) $scope_string\n copy Unknown (mth) $scope_done\n dir Unknown (var) $scopeEmpty\n dir:=(1) Unknown (var) $scopeEmpty\n directory Unknown (mth) $scope_done\n directory:=(1) Unknown (mth) $scope_done\n exists Boolean (mth) $scope_done\n extension Unknown (var) $scopeEmpty public\n extension:=(1) Unknown (var) $scopeEmpty public\n hash Unknown (mth) $scope_done\n inQuotes Unknown (mth) $scope_done\n isAbsolute Unknown (mth) $scope_done\n isMe(1) Boolean (go) $scope_boolean\n myIdentityHash Number (go) $scope_number\n newer(1) Boolean (mth) $scope_done\n prefix== Unknown (mth) $scope_done\n prefix\u2260 Unknown (mth) $scope_done\n quoted Unknown (mth) $scope_done\n setBase(1) Unknown (mth) $scope_done\n setDirectory(1) Unknown (mth) $scope_done\n setExtension(1) Unknown (mth) $scope_done\n shortName Unknown (mth) $scope_done\n \u2260(1) Unknown (mth) $scope_done\nself:\n $101\ntypedec:$101.FilePath:\n type FilePath = EqualityObject & interface {\n directory \u2192 String\n base \u2192 String\n extension \u2192 String\n shortName \u2192 String\n quoted \u2192 String\n inQuotes \u2192 String\n directory:=(d)\n setDirectory(d)\n base:=(b)\n setBase(b)\n extension:=(e)\n setExtension(e)\n exists \u2192 Boolean\n newer(o) \u2192 Boolean\n copy \u2192 FilePath\n absolute \u2192 FilePath\n isAbsolute \u2192 Boolean}\ntypes:\n $101.FilePath\n"; if (typeof originalSourceLines !== "undefined") { originalSourceLines["unixFilePath"] = [ "dialect \"standard\"", "import \"io\" as io", "", "type FilePath = EqualityObject & interface {", " directory -> String // the directory part; \"./\" if in current directory", " base -> String // the base part of the file name (without an extension)", " extension -> String // the extension (like `.grace`) , including the `.`", " shortName -> String // the file name without the directory part", " quoted -> String // the file name with internal special characters escaped", " inQuotes -> String // the file name enclosed in quotes, and with internal", " // special characters escaped", "", " directory:=(d) // sets the directory part to d; answers done", " setDirectory(d) // sets the directory part to d; answers self (for chaining)", " base:=(b) // sets the base part of the file name to b; answers done", " setBase(b) // sets the base part of the file name to b; answers self", " extension:=(e) // sets the extension to e; answers done", " setExtension(e) // sets the extension to e; answers self", " exists -> Boolean // true if there is a file on this path", " newer(o) -> Boolean // true if this file is newer than o", " copy -> FilePath // answers a new FilePath equal to self", " absolute -> FilePath // answers a FilePath that reference the same file as self,", " // but as a path from the file system root", " isAbsolute -> Boolean // answers true if self is an absolute path", "}", "", "def sep is public = \"/\" // the file path separator string", "def delimiter is public = \":\" // the delimiter used in PATH variables", "", "class filePath {", " // creates a unixFilePath with empty components.", " // Why is this not called null? Because that name emits confusing error", " // messages. Instead, null redirects to this method.", "", " use equality", "", " var dir := \"\"", " // the directory part; \"\" if in current directory", "", " var base is public := \"\"", " // the base part of the file name (without an extension)", "", " var extension is public := \"\"", " // the extension (like `.grace`) , including the `.`", "", " method asString { dir ++ base ++ extension }", " // the whole file name as a string", "", " method quoted { asString.quoted }", " method inQuotes { \"\\\"{quoted}\\\"\" }", "", " method shortName { base ++ extension }", " // the file name without the directory part", "", " method asDebugString { \"unixFilePath[{dir}|{base}|{extension}]\" }", " // for debugging; shows the division into parts", "", " method directory {", " // the directory part; \"./\" if in current directory", " if (dir == \"\") then { \"./\" } else { dir }", " }", "", " method directory:=(d) {", " // set the directory part", " var newDir := d", " if (newDir == \"\") then {", " dir := \"\"", " return", " }", " if (newDir.at(newDir.size) != \"/\") then {", " newDir := newDir ++ \"/\"", " }", " if (newDir == \"./\") then { newDir := \"\" }", " dir := newDir", " }", " method setDirectory(d) {", " // set the directory part; answers self for chaining", " directory := d", " self", " }", " method setBase(b) {", " // set the base part; answers self for chaining", " base := b", " self", " }", " method setExtension(e) {", " // set the extension; answers self for chaining", " if (e.first == \".\") then {", " extension := e", " } else {", " extension := \".\" ++ e", " }", " self", " }", " method exists -> Boolean {", " // true if his file exists", " io.exists(self.asString)", " }", " method newer(other) -> Boolean {", " // true if this file is newer than other", " io.newer(self.asString, other.asString)", " }", "", " method copy {", " // a copy of this filePath", " def p = filePath", " p.directory := directory", " p.base := base", " p.extension := extension", " p", " }", "", " method == (other) {", " // am I equal to other?", " if (directory != other.directory) then { return false }", " if (base != other.base) then { return false }", " if (extension != other.extension) then { return false }", " return true", " }", "", " method absolute {", " // make me an absolute, rather than relative, path", " directory := io.realpath(dir)", " self", " }", "", " method isAbsolute {", " directory.startsWith(sep)", " }", "", " method hash {", " hashCombine(hashCombine(directory.hash, base.hash), extension.hash)", " }", "}", "", "def null is public = object {", " inherit filePath", " method asString { \"the null file\" }", "}", "", "method withDirectory(d) {", " filePath.setDirectory(d)", "}", "", "method withBase(b) {", " filePath.setBase(b)", "}", "", "method withExtension(e) {", " filePath.setExtension(e)", "}", "", "method withDirectory(d) base(b) extension(e) {", " // creates a unixFilePath with directory d, base b and extension e", " filePath.setDirectory(d).setBase(b).setExtension(e)", "}", "", "method fromString(s) {", " // parses the filename s into components and answers the approriate unixFilePath", " def p = filePath", " var slashPosn := 0", " def sSize = s.size", " var ix := sSize", " while { (slashPosn == 0) && (ix > 0) } do {", " if (s.at(ix) == \"/\") then {", " slashPosn := ix", " } else {", " ix := ix - 1", " }", " }", " p.directory := s.substringFrom 1 to (slashPosn)", " var dotPosn := sSize + 1", " ix := sSize", " while { (dotPosn > sSize) && (ix > slashPosn) } do {", " if (s.at(ix) == \".\") then {", " dotPosn := ix", " } else {", " ix := ix - 1", " }", " }", " if (dotPosn <= sSize) then {", " p.extension := s.substringFrom (dotPosn) to (sSize)", " }", " p.base := s.substringFrom (slashPosn + 1) to (dotPosn - 1)", " p", "}", "", "method split(pathString) {", " // splits pathString, assumed to be a Unix PATH containing items separated by", " // delimiter (a colon), into a List of items. Each item will end with sep (/)", " def locations = list.empty", " var ix := 1", " var ox := 1", " def pss = pathString.size", " while { ox <= pss } do {", " while { (ox <= pss) && {pathString.at(ox) != \":\"} } do {", " ox := ox + 1", " }", " var item := pathString.substringFrom(ix) to(ox-1)", " if (item.isEmpty.not) then {", " if (item.last != \"/\") then { item := item ++ \"/\" }", " locations.addLast (item)", " }", " ix := ox + 1", " ox := ix", " }", " return locations", "}", "", "method file(name) onPath(pathString) otherwise(action) {", " def locations = split(pathString)", " def candidate = name.copy", " def originalDir = name.directory", " if (originalDir.first == \"/\") then {", " if (candidate.exists) then {", " return candidate", " } else {", " return action.apply [originalDir]", " }", " }", " locations.do { each ->", " candidate.setDirectory(each ++ originalDir)", " if ( candidate.exists ) then {", " return candidate", " }", " }", " action.apply(locations)", "}" ]; } function gracecode_unixFilePath() { importedModules["unixFilePath"] = this; const var_$module = this; this.definitionModule = "unixFilePath"; this.definitionLine = 1; setLineNumber(1); // compilenode dialect // Dialect "standard" const var_$dialect = do_import("standard", gracecode_standard); this.outer = var_$dialect; setLineNumber(2); // compilenode import // Import of "io" as io if (typeof gracecode_io == "undefined") throw new GraceExceptionPacket(EnvironmentExceptionObject, new GraceString("could not find module io")); var var_io = do_import("io", gracecode_io); var func0 = function(argcv) { // accessor method io, line 2 const numArgs = arguments.length - 1; if (numArgs > 0) raiseTypeArgError("io", 0, numArgs - 0); return var_io; }; // end of method io this.methods["io"] = func0; func0.methodName = "io"; func0.paramCounts = [0]; func0.paramNames = []; func0.definitionLine = 2; func0.definitionModule = "unixFilePath"; func0.debug = "import"; func0.confidential = true; this.closureKeys = this.closureKeys || []; this.closureKeys.push("outer_unixFilePath_1"); this.outer_unixFilePath_1 = var_$dialect; setLineNumber(4); // compilenode typedec // Type decl FilePath var func2 = function(argcv) { // method FilePath, line 1 var returnTarget = invocationCount; invocationCount++; setLineNumber(1); // compilenode string var string4 = new GraceString("FilePath"); // call case 4: other requests setLineNumber(4); // compilenode interfaceliteral // interface literal var iface6 = new GraceInterface("\u2039anon\u203a"); sig7 = () => { setLineNumber(5); // compilenode member var call8 = selfRequest(var_$dialect, "String", [0]); return new GraceSignature("directory", [], [], [], call8); } sig9 = () => { setLineNumber(6); // compilenode member var call10 = selfRequest(var_$dialect, "String", [0]); return new GraceSignature("base", [], [], [], call10); } sig11 = () => { setLineNumber(7); // compilenode member var call12 = selfRequest(var_$dialect, "String", [0]); return new GraceSignature("extension", [], [], [], call12); } sig13 = () => { setLineNumber(8); // compilenode member var call14 = selfRequest(var_$dialect, "String", [0]); return new GraceSignature("shortName", [], [], [], call14); } sig15 = () => { setLineNumber(9); // compilenode member var call16 = selfRequest(var_$dialect, "String", [0]); return new GraceSignature("quoted", [], [], [], call16); } sig17 = () => { setLineNumber(10); // compilenode member var call18 = selfRequest(var_$dialect, "String", [0]); return new GraceSignature("inQuotes", [], [], [], call18); } sig19 = () => { return new GraceSignature("directory:=(1)", ["d"], [], [type_Unknown], type_Unknown); } sig20 = () => { return new GraceSignature("setDirectory(1)", ["d"], [], [type_Unknown], type_Unknown); } sig21 = () => { return new GraceSignature("base:=(1)", ["b"], [], [type_Unknown], type_Unknown); } sig22 = () => { return new GraceSignature("setBase(1)", ["b"], [], [type_Unknown], type_Unknown); } sig23 = () => { return new GraceSignature("extension:=(1)", ["e"], [], [type_Unknown], type_Unknown); } sig24 = () => { return new GraceSignature("setExtension(1)", ["e"], [], [type_Unknown], type_Unknown); } sig25 = () => { setLineNumber(19); // compilenode member var call26 = selfRequest(var_$dialect, "Boolean", [0]); return new GraceSignature("exists", [], [], [], call26); } sig27 = () => { setLineNumber(20); // compilenode member var call28 = selfRequest(var_$dialect, "Boolean", [0]); return new GraceSignature("newer(1)", ["o"], [], [type_Unknown], call28); } sig29 = () => { setLineNumber(21); // compilenode member var call30 = selfRequest(var_$module, "FilePath", [0]); return new GraceSignature("copy", [], [], [], call30); } sig31 = () => { setLineNumber(22); // compilenode member var call32 = selfRequest(var_$module, "FilePath", [0]); return new GraceSignature("absolute", [], [], [], call32); } sig33 = () => { setLineNumber(24); // compilenode member var call34 = selfRequest(var_$dialect, "Boolean", [0]); return new GraceSignature("isAbsolute", [], [], [], call34); } iface6.typeMethods = { "directory": sig7 , "base": sig9 , "extension": sig11 , "shortName": sig13 , "quoted": sig15 , "inQuotes": sig17 , "directory:=(1)": sig19 , "setDirectory(1)": sig20 , "base:=(1)": sig21 , "setBase(1)": sig22 , "extension:=(1)": sig23 , "setExtension(1)": sig24 , "exists": sig25 , "newer(1)": sig27 , "copy": sig29 , "absolute": sig31 , "isAbsolute": sig33 }; // call case 4: other requests setLineNumber(4); // compilenode member var call35 = selfRequest(var_$dialect, "EqualityObject", [0]); var term5 = request(call35, "&(1)", [1], iface6); var call3 = selfRequest(term5, "setTypeName(1)", [1], string4); return call3; }; // end of method FilePath function memofunc2(argcv) { if (! this.data["memo$FilePath"]) // parameterless memo function this.data["memo$FilePath"] = func2.call(this, argcv); return this.data["memo$FilePath"]; }; this.methods["FilePath"] = memofunc2; memofunc2.methodName = "FilePath"; memofunc2.paramCounts = [0]; memofunc2.paramNames = []; memofunc2.definitionLine = 1; memofunc2.definitionModule = "unixFilePath"; func2.methodName = "FilePath"; func2.paramCounts = [0]; func2.paramNames = []; func2.definitionLine = 1; func2.definitionModule = "unixFilePath"; var func36 = function(argcv) { // method filePath, line 30 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 0) && (numArgs !== 0)) { raiseTypeArgError("filePath", 0, numArgs - 0); } var ouc = emptyGraceObject("filePath", "unixFilePath", 30); var ouc_init = this.methods["filePath$build(3)"].call(this, null, ouc, [], []); ouc_init.call(ouc); return ouc; }; // end of method filePath this.methods["filePath"] = func36; func36.methodName = "filePath"; func36.paramCounts = [0]; func36.paramNames = []; func36.definitionLine = 30; func36.definitionModule = "unixFilePath"; var func37 = function(argcv, inheritingObject, aliases, exclusions) { // method filePath$build(_,_,_), line 30 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 4; if ((numArgs > 0) && (numArgs !== 0)) { raiseTypeArgError("filePath", 0, numArgs - 0); } var obj38_build = function(ignore, outerObj, aliases, exclusions) { this.closureKeys = this.closureKeys || []; this.closureKeys.push("outer_unixFilePath_30"); this.outer_unixFilePath_30 = outerObj; const inheritedExclusions = { }; for (var eix = 0, eLen = exclusions.length; eix < eLen; eix ++) { const exMeth = exclusions[eix]; inheritedExclusions[exMeth] = this.methods[exMeth]; }; setLineNumber(35); // reuse call var initFun39 = selfRequest(var_$dialect, "equality$build(3)", [null], this, [], []); // compileReuseCall this.data.dir = undefined; var reader40_dir = function() { // reader method dir if (this.data.dir === undefined) raiseUninitializedVariable("dir"); return this.data.dir; }; reader40_dir.isVar = true; reader40_dir.confidential = true; this.methods["dir"] = reader40_dir; var writer41_dir = function(argcv, n) { // writer method dir:=(_) this.data.dir = n; return GraceDone; }; writer41_dir.confidential = true; this.methods["dir:=(1)"] = writer41_dir; this.data.base = undefined; var reader42_base = function() { // reader method base if (this.data.base === undefined) raiseUninitializedVariable("base"); return this.data.base; }; reader42_base.isVar = true; this.methods["base"] = reader42_base; var writer43_base = function(argcv, n) { // writer method base:=(_) this.data.base = n; return GraceDone; }; this.methods["base:=(1)"] = writer43_base; this.data.extension = undefined; var reader44_extension = function() { // reader method extension if (this.data.extension === undefined) raiseUninitializedVariable("extension"); return this.data.extension; }; reader44_extension.isVar = true; this.methods["extension"] = reader44_extension; var writer45_extension = function(argcv, n) { // writer method extension:=(_) this.data.extension = n; return GraceDone; }; this.methods["extension:=(1)"] = writer45_extension; var func46 = function(argcv) { // method asString, line 46 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 0) && (numArgs !== 0)) { raiseTypeArgError("asString", 0, numArgs - 0); } setLineNumber(46); // compilenode member var call48 = selfRequest(this, "extension", [0]); // call case 4: other requests var call50 = selfRequest(this, "base", [0]); // call case 4: other requests var call51 = selfRequest(this, "dir", [0]); var concat49 = request(call51, "++(1)", [1], call50); var concat47 = request(concat49, "++(1)", [1], call48); return concat47; }; // end of method asString this.methods["asString"] = func46; func46.methodName = "asString"; func46.paramCounts = [0]; func46.paramNames = []; func46.definitionLine = 46; func46.definitionModule = "unixFilePath"; var func52 = function(argcv) { // method quoted, line 49 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 0) && (numArgs !== 0)) { raiseTypeArgError("quoted", 0, numArgs - 0); } setLineNumber(49); // compilenode member // call case 4: other requests var call54 = selfRequest(this, "asString", [0]); var call53 = request(call54, "quoted", [0]); return call53; }; // end of method quoted this.methods["quoted"] = func52; func52.methodName = "quoted"; func52.paramCounts = [0]; func52.paramNames = []; func52.definitionLine = 49; func52.definitionModule = "unixFilePath"; var func55 = function(argcv) { // method inQuotes, line 50 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 0) && (numArgs !== 0)) { raiseTypeArgError("inQuotes", 0, numArgs - 0); } setLineNumber(50); // compilenode string var string57 = new GraceString("\""); // call case 4: other requests var call59 = selfRequest(this, "quoted", [0]); // call case 4: other requests var string60 = new GraceString("\""); var concat58 = request(string60, "++(1)", [1], call59); var concat56 = request(concat58, "++(1)", [1], string57); return concat56; }; // end of method inQuotes this.methods["inQuotes"] = func55; func55.methodName = "inQuotes"; func55.paramCounts = [0]; func55.paramNames = []; func55.definitionLine = 50; func55.definitionModule = "unixFilePath"; var func61 = function(argcv) { // method shortName, line 52 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 0) && (numArgs !== 0)) { raiseTypeArgError("shortName", 0, numArgs - 0); } setLineNumber(52); // compilenode member var call63 = selfRequest(this, "extension", [0]); // call case 4: other requests var call64 = selfRequest(this, "base", [0]); var concat62 = request(call64, "++(1)", [1], call63); return concat62; }; // end of method shortName this.methods["shortName"] = func61; func61.methodName = "shortName"; func61.paramCounts = [0]; func61.paramNames = []; func61.definitionLine = 52; func61.definitionModule = "unixFilePath"; var func65 = function(argcv) { // method asDebugString, line 55 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 0) && (numArgs !== 0)) { raiseTypeArgError("asDebugString", 0, numArgs - 0); } setLineNumber(55); // compilenode string var string67 = new GraceString("]"); // call case 4: other requests var call69 = selfRequest(this, "extension", [0]); // call case 4: other requests var string71 = new GraceString("|"); // call case 4: other requests var call73 = selfRequest(this, "base", [0]); // call case 4: other requests var string75 = new GraceString("|"); // call case 4: other requests var call77 = selfRequest(this, "dir", [0]); // call case 4: other requests var string78 = new GraceString("unixFilePath["); var concat76 = request(string78, "++(1)", [1], call77); var concat74 = request(concat76, "++(1)", [1], string75); var concat72 = request(concat74, "++(1)", [1], call73); var concat70 = request(concat72, "++(1)", [1], string71); var concat68 = request(concat70, "++(1)", [1], call69); var concat66 = request(concat68, "++(1)", [1], string67); return concat66; }; // end of method asDebugString this.methods["asDebugString"] = func65; func65.methodName = "asDebugString"; func65.paramCounts = [0]; func65.paramNames = []; func65.definitionLine = 55; func65.definitionModule = "unixFilePath"; var func79 = function(argcv) { // method directory, line 58 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 0) && (numArgs !== 0)) { raiseTypeArgError("directory", 0, numArgs - 0); } var if80 = GraceDone; setLineNumber(60); // compilenode string // call case 4: other requests var call82 = selfRequest(this, "dir", [0]); var term81 = request(call82, "==(1)", [1], GraceEmptyString); if (Grace_isTrue(term81)) { var string83 = new GraceString("./"); if80 = string83; } else { var call84 = selfRequest(this, "dir", [0]); if80 = call84; } return if80; }; // end of method directory this.methods["directory"] = func79; func79.methodName = "directory"; func79.paramCounts = [0]; func79.paramNames = []; func79.definitionLine = 58; func79.definitionModule = "unixFilePath"; var func85 = function(argcv, var_d) { // method directory:=(_), line 63 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 1) && (numArgs !== 1)) { raiseTypeArgError("directory:=(_)", 0, numArgs - 1); } setLineNumber(65); // compilenode vardec var var_newDir = var_d; var if86 = GraceDone; setLineNumber(66); // compilenode string // call case 4: other requests if (var_newDir === undefined) raiseUninitializedVariable("newDir"); var term87 = request(var_newDir, "==(1)", [1], GraceEmptyString); if (Grace_isTrue(term87)) { setLineNumber(67); // compilenode string var call88 = selfRequest(this, "dir:=(1)", [1], GraceEmptyString); setLineNumber(68); // compilenode return var call89 = selfRequest(var_$dialect, "done", [0]); return call89; } var if90 = GraceDone; setLineNumber(70); // compilenode string var string92 = new GraceString("/"); // call case 4: other requests // call case 4: other requests if (var_newDir === undefined) raiseUninitializedVariable("newDir"); var call94 = request(var_newDir, "size", [0]); // call case 4: other requests if (var_newDir === undefined) raiseUninitializedVariable("newDir"); var call93 = request(var_newDir, "at(1)", [1], call94); var term91 = request(call93, "\u2260(1)", [1], string92); if (Grace_isTrue(term91)) { setLineNumber(71); // compilenode string var string96 = new GraceString("/"); // call case 4: other requests if (var_newDir === undefined) raiseUninitializedVariable("newDir"); var concat95 = request(var_newDir, "++(1)", [1], string96); var_newDir = concat95; if90 = GraceDone; } var if97 = GraceDone; setLineNumber(73); // compilenode string var string99 = new GraceString("./"); // call case 4: other requests if (var_newDir === undefined) raiseUninitializedVariable("newDir"); var term98 = request(var_newDir, "==(1)", [1], string99); if (Grace_isTrue(term98)) { var_newDir = GraceEmptyString; if97 = GraceDone; } setLineNumber(74); // compilenode call if (var_newDir === undefined) raiseUninitializedVariable("newDir"); var call100 = selfRequest(this, "dir:=(1)", [1], var_newDir); return call100; }; // end of method directory:=(_) this.methods["directory:=(1)"] = func85; func85.methodName = "directory:=(1)"; func85.paramCounts = [1]; func85.paramNames = ["d"]; func85.definitionLine = 63; func85.definitionModule = "unixFilePath"; var func101 = function(argcv, var_d) { // method setDirectory(_), line 76 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 1) && (numArgs !== 1)) { raiseTypeArgError("setDirectory(_)", 0, numArgs - 1); } setLineNumber(78); // compilenode call var call102 = selfRequest(this, "directory:=(1)", [1], var_d); setLineNumber(79); // compilenode yourself return this; }; // end of method setDirectory(_) this.methods["setDirectory(1)"] = func101; func101.methodName = "setDirectory(1)"; func101.paramCounts = [1]; func101.paramNames = ["d"]; func101.definitionLine = 76; func101.definitionModule = "unixFilePath"; var func103 = function(argcv, var_b) { // method setBase(_), line 81 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 1) && (numArgs !== 1)) { raiseTypeArgError("setBase(_)", 0, numArgs - 1); } setLineNumber(83); // compilenode call var call104 = selfRequest(this, "base:=(1)", [1], var_b); setLineNumber(84); // compilenode yourself return this; }; // end of method setBase(_) this.methods["setBase(1)"] = func103; func103.methodName = "setBase(1)"; func103.paramCounts = [1]; func103.paramNames = ["b"]; func103.definitionLine = 81; func103.definitionModule = "unixFilePath"; var func105 = function(argcv, var_e) { // method setExtension(_), line 86 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 1) && (numArgs !== 1)) { raiseTypeArgError("setExtension(_)", 0, numArgs - 1); } var if106 = GraceDone; setLineNumber(88); // compilenode string var string108 = new GraceString("."); // call case 4: other requests // call case 4: other requests var call109 = request(var_e, "first", [0]); var term107 = request(call109, "==(1)", [1], string108); if (Grace_isTrue(term107)) { setLineNumber(89); // compilenode call var call110 = selfRequest(this, "extension:=(1)", [1], var_e); if106 = call110; } else { setLineNumber(91); // compilenode op // call case 4: other requests var string113 = new GraceString("."); var concat112 = request(string113, "++(1)", [1], var_e); var call111 = selfRequest(this, "extension:=(1)", [1], concat112); if106 = call111; } setLineNumber(93); // compilenode yourself return this; }; // end of method setExtension(_) this.methods["setExtension(1)"] = func105; func105.methodName = "setExtension(1)"; func105.paramCounts = [1]; func105.paramNames = ["e"]; func105.definitionLine = 86; func105.definitionModule = "unixFilePath"; var func114 = function(argcv) { // method exists, line 95 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 0) && (numArgs !== 0)) { raiseTypeArgError("exists", 0, numArgs - 0); } setLineNumber(97); // compilenode member var call116 = selfRequest(this, "asString", [0]); // call case 4: other requests var call115 = request(var_io, "exists(1)", [1], call116); setLineNumber(95); // compilenode member var call117 = selfRequest(var_$dialect, "Boolean", [0]); setLineNumber(97); // typecheck assertTypeOrMsg(call115, call117, "result of method exists", "Boolean"); return call115; }; // end of method exists setLineNumber(95); // compilenode member var call118 = selfRequest(var_$dialect, "Boolean", [0]); func114.returnType = call118; this.methods["exists"] = func114; func114.methodName = "exists"; func114.paramCounts = [0]; func114.paramNames = []; func114.definitionLine = 95; func114.definitionModule = "unixFilePath"; var func119 = function(argcv, var_other) { // method newer(_), line 99 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 1) && (numArgs !== 1)) { raiseTypeArgError("newer(_)", 0, numArgs - 1); } setLineNumber(101); // compilenode member var call121 = selfRequest(this, "asString", [0]); // call case 4: other requests var call122 = request(var_other, "asString", [0]); // call case 4: other requests var call120 = request(var_io, "newer(2)", [2], call121, call122); setLineNumber(99); // compilenode member var call123 = selfRequest(var_$dialect, "Boolean", [0]); setLineNumber(101); // typecheck assertTypeOrMsg(call120, call123, "result of method newer(_)", "Boolean"); return call120; }; // end of method newer(_) setLineNumber(99); // compilenode member var call124 = selfRequest(var_$dialect, "Boolean", [0]); func119.returnType = call124; this.methods["newer(1)"] = func119; func119.methodName = "newer(1)"; func119.paramCounts = [1]; func119.paramNames = ["other"]; func119.definitionLine = 99; func119.definitionModule = "unixFilePath"; var func125 = function(argcv) { // method copy, line 104 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 0) && (numArgs !== 0)) { raiseTypeArgError("copy", 0, numArgs - 0); } setLineNumber(106); // compilenode member var call126 = selfRequest(var_$module, "filePath", [0]); var var_p = call126; setLineNumber(107); // compilenode member var call128 = selfRequest(this, "directory", [0]); // call case 4: other requests if (var_p === undefined) raiseUninitializedVariable("p"); var call127 = request(var_p, "directory:=(1)", [1], call128); setLineNumber(108); // compilenode member var call130 = selfRequest(this, "base", [0]); // call case 4: other requests if (var_p === undefined) raiseUninitializedVariable("p"); var call129 = request(var_p, "base:=(1)", [1], call130); setLineNumber(109); // compilenode member var call132 = selfRequest(this, "extension", [0]); // call case 4: other requests if (var_p === undefined) raiseUninitializedVariable("p"); var call131 = request(var_p, "extension:=(1)", [1], call132); if (var_p === undefined) raiseUninitializedVariable("p"); return var_p; }; // end of method copy this.methods["copy"] = func125; func125.methodName = "copy"; func125.paramCounts = [0]; func125.paramNames = []; func125.definitionLine = 104; func125.definitionModule = "unixFilePath"; var func133 = function(argcv, var_other) { // method ==(_), line 113 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 1) && (numArgs !== 1)) { raiseTypeArgError("==(_)", 0, numArgs - 1); } var if134 = GraceDone; setLineNumber(115); // compilenode member // call case 4: other requests var call136 = request(var_other, "directory", [0]); // call case 4: other requests var call137 = selfRequest(this, "directory", [0]); var term135 = request(call137, "\u2260(1)", [1], call136); if (Grace_isTrue(term135)) { return GraceFalse; } var if139 = GraceDone; setLineNumber(116); // compilenode member // call case 4: other requests var call141 = request(var_other, "base", [0]); // call case 4: other requests var call142 = selfRequest(this, "base", [0]); var term140 = request(call142, "\u2260(1)", [1], call141); if (Grace_isTrue(term140)) { return GraceFalse; } var if144 = GraceDone; setLineNumber(117); // compilenode member // call case 4: other requests var call146 = request(var_other, "extension", [0]); // call case 4: other requests var call147 = selfRequest(this, "extension", [0]); var term145 = request(call147, "\u2260(1)", [1], call146); if (Grace_isTrue(term145)) { return GraceFalse; } setLineNumber(118); // compilenode member return GraceTrue; }; // end of method ==(_) this.methods["==(1)"] = func133; func133.methodName = "==(1)"; func133.paramCounts = [1]; func133.paramNames = ["other"]; func133.definitionLine = 113; func133.definitionModule = "unixFilePath"; var func150 = function(argcv) { // method absolute, line 121 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 0) && (numArgs !== 0)) { raiseTypeArgError("absolute", 0, numArgs - 0); } setLineNumber(123); // compilenode member var call153 = selfRequest(this, "dir", [0]); // call case 4: other requests var call152 = request(var_io, "realpath(1)", [1], call153); var call151 = selfRequest(this, "directory:=(1)", [1], call152); setLineNumber(124); // compilenode yourself return this; }; // end of method absolute this.methods["absolute"] = func150; func150.methodName = "absolute"; func150.paramCounts = [0]; func150.paramNames = []; func150.definitionLine = 121; func150.definitionModule = "unixFilePath"; var func154 = function(argcv) { // method isAbsolute, line 127 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 0) && (numArgs !== 0)) { raiseTypeArgError("isAbsolute", 0, numArgs - 0); } setLineNumber(128); // compilenode call if (var_sep === undefined) raiseUninitializedVariable("sep"); // call case 4: other requests var call156 = selfRequest(this, "directory", [0]); var call155 = request(call156, "startsWith(1)", [1], var_sep); return call155; }; // end of method isAbsolute this.methods["isAbsolute"] = func154; func154.methodName = "isAbsolute"; func154.paramCounts = [0]; func154.paramNames = []; func154.definitionLine = 127; func154.definitionModule = "unixFilePath"; var func157 = function(argcv) { // method hash, line 131 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 0) && (numArgs !== 0)) { raiseTypeArgError("hash", 0, numArgs - 0); } setLineNumber(132); // compilenode member // call case 4: other requests var call161 = selfRequest(this, "directory", [0]); var call160 = request(call161, "hash", [0]); // call case 4: other requests var call163 = selfRequest(this, "base", [0]); var call162 = request(call163, "hash", [0]); var call159 = selfRequest(var_$dialect, "hashCombine(2)", [2], call160, call162); // call case 4: other requests var call165 = selfRequest(this, "extension", [0]); var call164 = request(call165, "hash", [0]); var call158 = selfRequest(var_$dialect, "hashCombine(2)", [2], call159, call164); return call158; }; // end of method hash this.methods["hash"] = func157; func157.methodName = "hash"; func157.paramCounts = [0]; func157.paramNames = []; func157.definitionLine = 131; func157.definitionModule = "unixFilePath"; this.mutable = true; 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 = 30; m.definitionModule = "unixFilePath"; 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 obj38_init = function() { // init of object on line 30 setLineNumber(37); // compilenode string this.data.dir = GraceEmptyString; setLineNumber(40); // compilenode string this.data.base = GraceEmptyString; setLineNumber(43); // compilenode string this.data.extension = GraceEmptyString; }; return obj38_init; // from compileBuildAndInitFunctions(_)inMethod(_) }; var obj38_init = obj38_build.call(inheritingObject, null, this, aliases, exclusions); return obj38_init; // from compileBuildMethodFor(_)withObjCon(_)inside(_) }; // end of method filePath$build(_,_,_) this.methods["filePath$build(3)"] = func37; func37.methodName = "filePath$build(3)"; func37.paramCounts = [0]; func37.paramNames = []; func37.definitionLine = 30; func37.definitionModule = "unixFilePath"; var func166 = function(argcv, var_d) { // method withDirectory(_), line 141 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 1) && (numArgs !== 1)) { raiseTypeArgError("withDirectory(_)", 0, numArgs - 1); } setLineNumber(142); // compilenode call // call case 4: other requests var call168 = selfRequest(var_$module, "filePath", [0]); var call167 = request(call168, "setDirectory(1)", [1], var_d); return call167; }; // end of method withDirectory(_) this.methods["withDirectory(1)"] = func166; func166.methodName = "withDirectory(1)"; func166.paramCounts = [1]; func166.paramNames = ["d"]; func166.definitionLine = 141; func166.definitionModule = "unixFilePath"; var func169 = function(argcv, var_b) { // method withBase(_), line 145 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 1) && (numArgs !== 1)) { raiseTypeArgError("withBase(_)", 0, numArgs - 1); } setLineNumber(146); // compilenode call // call case 4: other requests var call171 = selfRequest(var_$module, "filePath", [0]); var call170 = request(call171, "setBase(1)", [1], var_b); return call170; }; // end of method withBase(_) this.methods["withBase(1)"] = func169; func169.methodName = "withBase(1)"; func169.paramCounts = [1]; func169.paramNames = ["b"]; func169.definitionLine = 145; func169.definitionModule = "unixFilePath"; var func172 = function(argcv, var_e) { // method withExtension(_), line 149 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 1) && (numArgs !== 1)) { raiseTypeArgError("withExtension(_)", 0, numArgs - 1); } setLineNumber(150); // compilenode call // call case 4: other requests var call174 = selfRequest(var_$module, "filePath", [0]); var call173 = request(call174, "setExtension(1)", [1], var_e); return call173; }; // end of method withExtension(_) this.methods["withExtension(1)"] = func172; func172.methodName = "withExtension(1)"; func172.paramCounts = [1]; func172.paramNames = ["e"]; func172.definitionLine = 149; func172.definitionModule = "unixFilePath"; var func175 = function(argcv, var_d, var_b, var_e) { // method withDirectory(_)base(_)extension(_), line 153 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 3) && (numArgs !== 3)) { raiseTypeArgError("withDirectory(_)base(_)extension(_)", 0, numArgs - 3); } setLineNumber(155); // compilenode call // call case 4: other requests // call case 4: other requests // call case 4: other requests var call179 = selfRequest(var_$module, "filePath", [0]); var call178 = request(call179, "setDirectory(1)", [1], var_d); var call177 = request(call178, "setBase(1)", [1], var_b); var call176 = request(call177, "setExtension(1)", [1], var_e); return call176; }; // end of method withDirectory(_)base(_)extension(_) this.methods["withDirectory(1)base(1)extension(1)"] = func175; func175.methodName = "withDirectory(1)base(1)extension(1)"; func175.paramCounts = [1, 1, 1]; func175.paramNames = ["d", "b", "e"]; func175.definitionLine = 153; func175.definitionModule = "unixFilePath"; var func180 = function(argcv, var_s) { // method fromString(_), line 158 var returnTarget = invocationCount; invocationCount++; const numArgs = arguments.length - 1; if ((numArgs > 1) && (numArgs !== 1)) { raiseTypeArgError("fromString(_)", 0, numArgs - 1); } setLineNumber(160); // compilenode member var call181 = selfRequest(var_$module, "filePath", [0]); var var_p = call181; setLineNumber(161); // compilenode num var var_slashPosn = new GraceNum(0); setLineNumber(162); // compilenode member // call case 4: other requests var call182 = request(var_s, "size", [0]); var var_sSize = call182; setLineNumber(163); // compilenode vardec if (var_sSize === undefined) raiseUninitializedVariable("sSize"); var var_ix = var_sSize; setLineNumber(164); // compilenode block var block184 = new GraceBlock(this, 164, 0); block184.guard = jsTrue; block184.real = function block184() { setLineNumber(164); // compilenode num // call case 4: other requests if (var_ix === undefined) raiseUninitializedVariable("ix"); var term186 = request(var_ix, ">(