Skip to content

Commit

Permalink
feat: remove documentation from signature_
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Hivert <[email protected]>
  • Loading branch information
ghivert committed May 18, 2024
1 parent 77d327b commit 62c6e01
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions apps/backend/src/backend/gleam/generate/sources.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,14 @@ pub fn type_definition_to_string(type_name: String, type_def: TypeDefinition) {
let params = int_parameters_to_string(type_def.parameters)
let base = type_name <> params
use <- bool.guard(when: type_def.constructors == [], return: base)
"type "
<> base
<> " {\n"
{ "type " <> base <> " {\n" }
<> type_constructors_to_string(type_def.constructors)
<> "\n}"
}

fn type_constructors_to_string(constructors: List(TypeConstructor)) {
constructors
|> list.map(fn(c) {
let params = parameters_to_string(c.parameters)
let const_ = " " <> c.name <> params
c.documentation
|> option.map(fn(d) { string.join([" -- " <> d, const_], "\n") })
|> option.unwrap(const_)
})
|> list.map(fn(c) { " " <> c.name <> parameters_to_string(c.parameters) })
|> string.join("\n")
}

Expand Down

0 comments on commit 62c6e01

Please sign in to comment.