Current section
Files
Jump to
Current section
Files
src/roundabout@generate_other.erl
-module(roundabout@generate_other).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/roundabout/generate_other.gleam").
-export([generate_header/0, generate_imports/0, generate_utils/0]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
-file("src/roundabout/generate_other.gleam", 4).
?DOC(false).
-spec generate_header() -> glam@doc:document().
generate_header() ->
_pipe = <<"//// This module was generated using roundabout.
////
"/utf8>>,
_pipe@1 = glam@doc:from_string(_pipe),
glam@doc:append(_pipe@1, {line, 1}).
-file("src/roundabout/generate_other.gleam", 13).
?DOC(false).
-spec generate_imports() -> glam@doc:document().
generate_imports() ->
_pipe = [glam@doc:from_string(<<"import gleam/int"/utf8>>),
{line, 1},
glam@doc:from_string(<<"import gleam/result"/utf8>>),
glam@doc:lines(2)],
glam@doc:concat(_pipe).
-file("src/roundabout/generate_other.gleam", 24).
?DOC(false).
-spec generate_utils() -> glam@doc:document().
generate_utils() ->
_pipe = <<"
fn with_int(str: String, fun) {
int.parse(str)
|> result.try(fun)
}
"/utf8>>,
glam@doc:from_string(_pipe).