Ruby: Remove MethodModifier

This commit is contained in:
Harry Maclean
2022-08-11 09:56:57 +12:00
parent 97e9eab7fc
commit 79abb36faf

View File

@@ -66,25 +66,18 @@ class MethodBase extends Callable, BodyStmt, Scope, TMethodBase {
}
/**
* A method call which modifies another method in some way.
* A method call that sets the visibility of other methods.
* For example, `private :foo` makes the method `foo` private.
*/
private class MethodModifier extends MethodCall {
/** Gets the name of the method that this call applies to. */
Expr getMethodArgument() { result = this.getArgument(0) }
}
/** A method call that sets the visibility of other methods. */
private class VisibilityModifier extends MethodModifier {
private Namespace namespace;
private int position;
private class VisibilityModifier extends MethodCall {
VisibilityModifier() {
this.getMethodName() =
["public", "private", "protected", "public_class_method", "private_class_method"] and
namespace.getStmt(position) = this
["public", "private", "protected", "public_class_method", "private_class_method"]
}
/** Gets the name of the method that this call applies to. */
Expr getMethodArgument() { result = this.getArgument(0) }
/**
* Holds if this modifier changes the "ambient" visibility - i.e. the default
* visibility of any subsequent method definitions.