{"size": 822, "ext": "scrbl", "max_stars_repo_path": "configs/templates/enums.scrbl", "max_stars_repo_name": "eutro/racket-raylib", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "configs/templates/enums.scrbl", "max_issues_repo_name": "eutro/racket-raylib", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "configs/templates/enums.scrbl", "max_forks_repo_name": "eutro/racket-raylib", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.9090909091, "max_line_length": 80, "alphanum_fraction": 0.6459854015}
#lang scribble/text

@(require racket/match
          racket/format
          raylib/codegen/objects)
@(provide generate-enums)

@(define (generate-enums
          enums-parsed
          #:module this-mod)
@list{
#lang scribble/manual

@"@"(require (for-label @|this-mod| ffi/unsafe racket/base))

@"@"title{Enums}

@"@"table-of-contents[]

@"@"defmodule[@|this-mod|]
@(splice
  (for/list ([parsed-enum (in-list enums-parsed)])
    (match-define (api-enum name description enum-values) parsed-enum)
@list{@(void)
@"@"section{@|description|}
@"@"defthing[_@|name| ctype?]{@|description|}@;
@(for/list ([enum-value (in-list enum-values)])
   (match-define (api-enum-value name enum-desc enum-int-value) enum-value)
@list{@(void)
@"@"defthing[@|name| exact-integer? #:value @|enum-int-value| @(~s enum-desc)]})
@(void)}))
})
