Skip to content

Commit

Permalink
Rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
daogrady committed Jan 30, 2024
1 parent 435f4dd commit a19322c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/visitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,16 +449,14 @@ class Visitor {
case 'aspect':
this.#printAspect(name, entity)
break
case 'type':
case 'type': {
// types like inline definitions can be used very similarly to entities.
// They can be extended, contain inline enums, etc., so we treat them as entities.
// Enums seem to be the only actual "type".
if (entity.enum) {
this.#printType(name, entity)
} else {
this.#printEntity(name, entity)
}
const handler = entity.enum ? this.#printType : this.#printEntity
handler.bind(this)(name, entity)
break
}
case 'event':
this.#printEvent(name, entity)
break
Expand Down

0 comments on commit a19322c

Please sign in to comment.