[education/rkward] rkward/scriptbackends: Help clang-format to be more sane

Thomas Friedrichsmeier null at kde.org
Wed May 7 14:21:36 BST 2025


Git commit 2001eb2d9cf186ebb8bea00531bbc8a1278aad86 by Thomas Friedrichsmeier.
Committed on 07/05/2025 at 13:21.
Pushed by tfry into branch 'master'.

Help clang-format to be more sane

M  +95   -87   rkward/scriptbackends/rkcomponentscripting.js

https://invent.kde.org/education/rkward/-/commit/2001eb2d9cf186ebb8bea00531bbc8a1278aad86

diff --git a/rkward/scriptbackends/rkcomponentscripting.js b/rkward/scriptbackends/rkcomponentscripting.js
index 64c1c3148..0942394b0 100644
--- a/rkward/scriptbackends/rkcomponentscripting.js
+++ b/rkward/scriptbackends/rkcomponentscripting.js
@@ -30,132 +30,138 @@ function Component(id) {
 		if (this._id == "") return (id);
 		if (id) return (this._id + "." + id);
 		return (this._id);
-	}
+	};
 
-	                  this.getValue = function(id) {
+	this.getValue = function(id) {
 		return (_rkward.getValue(this.absoluteId(id)));
-	}
+	};
 
-	                                  this.getString = function(id) {
+	this.getString = function(id) {
 		return (_rkward.getString(this.absoluteId(id)));
-	}
+	};
 
-	                                                   this.getBoolean = function(id) {
+	this.getBoolean = function(id) {
 		return (_rkward.getBoolean(this.absoluteId(id)));
-	}
+	};
 
-	                                                                     this.getList = function(id) {
+	this.getList = function(id) {
 		return (_rkward.getList(this.absoluteId(id)));
-	}
+	};
 
-	                                                                                    this.setValue = function(id, value) {
+	this.setValue = function(id, value) {
 		return (_rkward.setValue(value, this.absoluteId(id)));
-	}
+	};
 
-	                                                                                                    this.setListValue = function(id, value) {
+	this.setListValue = function(id, value) {
 		return (_rkward.setListValue(value, this.absoluteId(id)));
-	}
+	};
 
-	                                                                                                                        this.getChild = function(id) {
+	this.getChild = function(id) {
 		return (new Component(this.absoluteId(id)));
-	}
+	};
 
-	                                                                                                                                        this.addChangeCommand = function(id, command) {
+	this.addChangeCommand = function(id, command) {
 		_rkward.addChangeCommand(this.absoluteId(id), command);
 	}
-}
+};
+
 makeComponent = function(id) {
 	return (new Component(id));
-} gui = new Component("");
+};
+
+gui = new Component("");
+
 doRCommand = function(command, callback) {
 	return (_rkward.doRCommand(command, callback));
-}
+}:
 
-function RObject(objectname) {
-	this.objectname = objectname;
-
-	// for internal use
-	this.initialize = function() {
-		info = _rkward.getObjectInfo(this.objectname);
-
-		this._dimensions = info.shift();
-		this._classes = info.shift();
-		this._isDataFrame = info.shift();
-		this._isMatrix = info.shift();
-		this._isList = info.shift();
-		this._isFunction = info.shift();
-		this._isEnvironment = info.shift();
-		this._datatype = info.shift();
-	}
+    function RObject(objectname) {
+	    this.objectname = objectname;
 
-	                  this.initialize();
+	    // for internal use
+	    this.initialize = function() {
+		    info = _rkward.getObjectInfo(this.objectname);
 
-	this.getName = function() {
-		return (this.objectname);
-	}
+		    this._dimensions = info.shift();
+		    this._classes = info.shift();
+		    this._isDataFrame = info.shift();
+		    this._isMatrix = info.shift();
+		    this._isList = info.shift();
+		    this._isFunction = info.shift();
+		    this._isEnvironment = info.shift();
+		    this._datatype = info.shift();
+	    };
 
-	               this.exists = function() {
-		return (typeof (this._dimensions) != "undefined");
-	}
+	    this.initialize();
 
-	                             this.dimensions = function() {
-		return (this._dimensions);
-	}
+	    this.getName = function() {
+		    return (this.objectname);
+	    };
 
-	                                               this.classes = function() {
-		return (this._classes);
-	}
+	    this.exists = function() {
+		    return (typeof (this._dimensions) != "undefined");
+	    };
 
-	                                                              this.isClass = function(classname) {
-		return (this._classes.indexOf(classname) != -1);
-	}
+	    this.dimensions = function() {
+		    return (this._dimensions);
+	    };
 
-	                                                                             this.isDataFrame = function() {
-		return (this._isDataFrame);
-	}
+	    this.classes = function() {
+		    return (this._classes);
+	    };
 
-	                                                                                                this.isMatrix = function() {
-		return (this._isMatrix);
-	}
+	    this.isClass = function(classname) {
+		    return (this._classes.indexOf(classname) != -1);
+	    };
 
-	                                                                                                                this.isList = function() {
-		return (this._isList);
-	}
+	    this.isDataFrame = function() {
+		    return (this._isDataFrame);
+	    };
 
-	                                                                                                                              this.isFunction = function() {
-		return (this._isFunction);
-	}
+	    this.isMatrix = function() {
+		    return (this._isMatrix);
+	    };
 
-	                                                                                                                                                this.isEnvironment = function() {
-		return (this._isEnvironment);
-	}
+	    this.isList = function() {
+		    return (this._isList);
+	    };
 
-	                                                                                                                                                                     this.isDataNumeric = function() {
-		return (this._datatype == "numeric");
-	}
+	    this.isFunction = function() {
+		    return (this._isFunction);
+	    };
 
-	                                                                                                                                                                                          this.isDataFactor = function() {
-		return (this._datatype == "factor");
-	}
+	    this.isEnvironment = function() {
+		    return (this._isEnvironment);
+	    };
 
-	                                                                                                                                                                                                              this.isDataCharacter = function() {
-		return (this._datatype == "character");
-	}
+	    this.isDataNumeric = function() {
+		    return (this._datatype == "numeric");
+	    };
 
-	                                                                                                                                                                                                                                     this.isDataLogical = function() {
-		return (this._datatype == "logical");
-	}
+	    this.isDataFactor = function() {
+		    return (this._datatype == "factor");
+	    };
 
-	                                                                                                                                                                                                                                                          this.parent = function() {
-		return (new RObject(_rkward.getObjectParent(this._name)));
-	}
+	    this.isDataCharacter = function() {
+		    return (this._datatype == "character");
+	    };
 
-	                                                                                                                                                                                                                                                                        this.child = function(childname) {
-		return (new RObject(_rkward.getObjectChild(this._name, childname)));
-	}
-} makeRObject = function(objectname) {
+	    this.isDataLogical = function() {
+		    return (this._datatype == "logical");
+	    };
+
+	    this.parent = function() {
+		    return (new RObject(_rkward.getObjectParent(this._name)));
+	    };
+
+	    this.child = function(childname) {
+		    return (new RObject(_rkward.getObjectChild(this._name, childname)));
+	    }
+    };
+
+makeRObject = function(objectname) {
 	return (new RObject(objectname));
-}
+};
 
 function RObjectArray(names) {
 	this._objects = new Array();
@@ -164,6 +170,8 @@ function RObjectArray(names) {
 	while (objs.count > 0) {
 		this._objects.push(new RObject(objs.shift()));
 	}
-} makeRObjectArray = function(objectnames) {
+};
+
+makeRObjectArray = function(objectnames) {
 	return (new RObjectArray(objectnames));
 }



More information about the rkward-tracker mailing list