Files
jak-project/test/decompiler/reference/jak2/levels/undefined/hal-task_REF.gc
T
Tyler Wilding abf61a94fb docs: add support for :override-doc in method declarations as well as documenting state handlers (#2139)
Adding support for better child-type method docstrings. This is a
problem unique to methods.

Usually, a child-type will have the same signature and a common name
will apply, but the implementation is different. This means, you
probably want a different docstring to describe what is happening.

Currently this is possible to do via `:replace`. The problem with
replace is two fold:
- a replaced method ends up in the generated `deftype`...because you
usually change the signature!
- we don't put docstrings in the `deftype` in normal GOAL, this is just
something we do for the `all-types` file (they go in the `defmethod`
instead)
- more importantly, this means anytime you now want to change the
parent's name/args/return type -- you have to apply that change
everywhere.

So this is a better design you can now just declare the method like so:
```clj
(:override-doc "my new docstring" <method_id>)
```

And internally a pseudo-replaced method will be added, but it will
inherit everything from the parent (except the docstring of course)

Unrelated - I also made all the keyword args for declaring methods not
depend on ordering

This also adds support for documenting virtual and non-virtual state
handlers. For example:

```clj
  (:states
    (part-tester-idle (:event "test") symbol))
```

or

```clj
(idle () _type_ :state (:event "test") 20)
```

I will probably add the ability to give some sort of over-view docstring
at a later date.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00

36 lines
1.1 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition for method 9 of type halt-wait-spot
;; WARN: Return type mismatch int vs none.
(defmethod reset-task! halt-wait-spot ((obj halt-wait-spot))
(set! (-> obj check-done) #f)
(set! (-> obj which-spot) 0)
(set! (-> obj num-spots) (the-as uint 1))
(none)
)
;; definition for method 11 of type halt-wait-spot
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs none.
(defmethod ai-task-method-11 halt-wait-spot ((obj halt-wait-spot) (arg0 bot))
(let ((s4-0 (-> obj which-spot)))
(if (logtest? *display-bot-marks* (bot-marks-controls bmc16))
(bot-debug-draw-spot-sphere
arg0
(the-as int (-> obj num-spots))
(the-as (pointer uint) (-> obj spot-indexes))
(the-as int (-> obj spot-indexes s4-0))
)
)
(mem-copy!
(the-as pointer (-> arg0 spot))
(the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0)))
20
)
)
(set! (-> arg0 root-override2 trans quad) (-> arg0 spot center quad))
((-> obj check-done) obj (the-as hal arg0))
(none)
)