Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added generation of tables of attributes of classes, structs, and str… #24

Conversation

frejanordsiek
Copy link
Contributor

…uct slots.

Adds generation of tables of attributes for structs, classes, and struct slots just like #23 added such a table for class slots; now that eudoxia0/docparser collects these attributes. Note, the PR makes it so that codex will work fine with older versions of docparser as well as the new. It has lots of (when (fboundp 'docparser::class-node-metaclass) ... like constructs to only use the new features of docparser if available. The :: is necessary in the symbols because otherwise, if using an old docparser version, the code can't compile and load because the symbol isn't exported.

Struct slot attributes are shown in the following order:

  1. type
  2. read-only
  3. accessor
  4. initform, if available

Class attributes are shown in the following order:

  1. superclasses
  2. metaclass, if available
  3. default-initargs, if available

And struct attributes are shown, if it is even possible to get them, in the following order:

  1. constructor
  2. predicate
  3. copier
  4. print-function, if there is one
  5. print-object, if there is one
  6. type, if it is something other than nil
  7. named, if type is something other than nil
  8. initial-offset, if type is something other than nil

You will note that :include is not yet included. I am not sure what the best way to show that one is. Listing the name of the struct that it inherits from is easy. But I am not sure what the best way to handle the slot overrides is. One possibility would be to convert the slot nodes for the overrides back to a list and then have them one by one on their own line in the cell on the right hand side of the table. Thoughts?

However, there are a few catches, the second of which is a very big one that must be considered.

For classes, the superclass was already listed due to #22. That is now put into the table.

The CSS in templates/static/nodes.css is a BIG ONE. Previously, there were was a CSS entry for the codex-superclass-list and then lots of CSS entries for the tables but they were class slot specific in that they all have the prefix codex-class-slot-option-. This PR gets renames them to use the codex-class-struct-slot prefix to make them generic for all attribute tables and got rid of the superclass specific one (now codex-class-struct-slot-option-symbol-list-cell is used). This does break backwards comparability to some degree, so it must be considered very carefully. One simple way to improve the compatibility would be to keep the old prefixes and just use them for the new tables even though their name isn't completely accurate (the PR can be easily fixed to do this).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants