Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11420c690c
|
||
|
|
4340e4dff2
|
@@ -339,7 +339,7 @@ When processing a predicate definition, we first need gather all parameters and
|
||||
caption: [Midas Typer: implementation of `visit_predicate_stmt`]
|
||||
) <fig:midas-visit_predicate_stmt>
|
||||
|
||||
== Example
|
||||
=== Example
|
||||
|
||||
Continuing with our example from @fig:example-midas-ast, the type statement would register a new type named `Kelvin` with internal representation given in
|
||||
|
||||
|
||||
@@ -12,5 +12,59 @@
|
||||
edge(<python>, "d", <reg>, "<|-"),
|
||||
edge((<python.south>, 50%, <python.south-east>), "d", <gen>, "-|>"),
|
||||
edge(<reg>, "d", <gen>, "-|>"),
|
||||
node(align(bottom + left)[*Type Checker*], enclose: (<midas>, <python>, <reg>, <gen>), fill: teal.lighten(80%))
|
||||
)
|
||||
node(align(bottom + left)[*Type Checker*], enclose: (<midas>, <python>, <reg>, <gen>), fill: teal.lighten(80%)),
|
||||
|
||||
node((-1, 0), [Midas File], name: <midas-file>),
|
||||
node((-1, 1), [Python File], name: <python-file>),
|
||||
edge(
|
||||
<midas-file.south>,
|
||||
((), "|-", (-1, 0.4)),
|
||||
((), "-|", (<midas.south-west>, 50%, <midas.south>)),
|
||||
((), "|-", <midas.south>),
|
||||
"=|>",
|
||||
mark-scale: 150%
|
||||
),
|
||||
edge(
|
||||
<python-file.north>,
|
||||
((), "|-", (-1, 0.6)),
|
||||
((), "-|", (<python.south-west>, 50%, <python.south>)),
|
||||
((), "|-", <python.south>),
|
||||
"=|>",
|
||||
mark-scale: 150%
|
||||
),
|
||||
/*node((-1, .5), [
|
||||
types.midas\
|
||||
source.py
|
||||
], name: <files>),*/
|
||||
/*edge(
|
||||
(<files.north-east>, 80%, <files.east>),
|
||||
((), "-|", (<midas.south-west>, 50%, <midas.south>)),
|
||||
((), "|-", <midas.south>),
|
||||
"=|>",
|
||||
mark-scale: 150%,
|
||||
),
|
||||
edge(
|
||||
(<files.south-east>, 80%, <files.east>),
|
||||
((), "-|", (<python.south-west>, 50%, <python.south>)),
|
||||
((), "|-", <python.south>),
|
||||
"=|>",
|
||||
mark-scale: 150%,
|
||||
)*/
|
||||
|
||||
node((3, 1.5), [Stubs], name: <stubs>, width: 5.5em),
|
||||
node((3, 2), [Generated Python], name: <output>, width: 5.5em),
|
||||
edge(
|
||||
<gen>,
|
||||
<output>,
|
||||
"=|>",
|
||||
mark-scale: 150%
|
||||
),
|
||||
edge(
|
||||
<gen>,
|
||||
"r",
|
||||
((), "|-", <stubs>),
|
||||
<stubs>,
|
||||
"=|>",
|
||||
mark-scale: 150%
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user