-
Notifications
You must be signed in to change notification settings - Fork 0
/
loopy-md-untemplate.scala
57 lines (45 loc) · 2.61 KB
/
loopy-md-untemplate.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// DO NOT HAND EDIT -- Autogenerated from 'loopy.md.untemplate' at 2024-06-18T04:02:12.851796Z
package untemplatedoc
import java.io.{Writer,StringWriter}
import scala.collection.{immutable,mutable}
val Untemplate_loopy_md = new untemplate.Untemplate[immutable.Map[String,Any],Nothing]:
val UntemplateFunction : untemplate.Untemplate[immutable.Map[String,Any],Nothing] = this
val UntemplateName : String = "loopy_md"
val UntemplatePackage : String = "untemplatedoc"
val UntemplateInputName : String = "input"
val UntemplateInputTypeDeclared : String = "immutable.Map[String,Any]"
val UntemplateInputTypeCanonical : Option[String] = untemplate.Macro.nonEmptyStringOption( untemplate.Macro.recursiveCanonicalName[immutable.Map[String,Any]] )
val UntemplateInputDefaultArgument : Option[immutable.Map[String,Any]] = Some(immutable.Map.empty)
val UntemplateOutputMetadataTypeDeclared : String = "Nothing"
val UntemplateOutputMetadataTypeCanonical : Option[String] = untemplate.Macro.nonEmptyStringOption( untemplate.Macro.recursiveCanonicalName[Nothing] )
val UntemplateHeaderNote : String = ""
val UntemplateLastModified : Option[Long] = Some(1673166579000L)
val UntemplateSynthetic : Boolean = false
val UntemplateAttributes : immutable.Map[String,Any] = immutable.Map.empty
def apply(input : immutable.Map[String,Any] = immutable.Map.empty) : untemplate.Result[Nothing] =
val writer : StringWriter = new StringWriter(1900)
val attrs : immutable.Map[String,Any] = UntemplateAttributes
var mbMetadata : Option[Nothing] = None
var outputTransformer : Function1[untemplate.Result[Nothing],untemplate.Result[Nothing]] = identity
val num = math.round(math.random * 10).toInt
for (i <- 0 until num)
val block0 = new Function0[String]:
def apply() : String =
"# Loopy\n"
writer.write(block0())
if (num >= 5)
val block1 = new Function0[String]:
def apply() : String =
"\nAnd we're a winner! (num = " + (num) +
")\n"
writer.write(block1())
else
val block2 = new Function0[String]:
def apply() : String =
"\nIt sucks to be us. (num = " + (num) +
")\n"
writer.write(block2())
outputTransformer( untemplate.Result( mbMetadata, writer.toString ) )
end apply
end Untemplate_loopy_md
def loopy_md(input : immutable.Map[String,Any] = immutable.Map.empty) : untemplate.Result[Nothing] = Untemplate_loopy_md( input )