garamor wrote
I have just encountered one other issue actually. What if you are calling a subroutine within your current class? The syntax for that is subroutineName(). The strategy you just showed me does not seem to work in this case because you are not referencing a class or object variable. How could I determine if the callee is a method in this case?
This refers to the following case
- does the call not contain a class or variable?
-> method call referring to own object (this)
So if the call is just containing a method name, it is a call to a (class)-local method. It cannot be a call to a static function: Jack requires that static calls are always using the full Classname.function() format, even if it is a call to a static function within the same class.