From 6bd07b639bfa4a8e49562b08a4b288d0a5848d9d Mon Sep 17 00:00:00 2001 From: MultisampledNight Date: Tue, 9 Jan 2024 11:58:42 +0100 Subject: [PATCH] docs(design): add larger source example --- docs/design/graphics.typ | 1 + docs/design/iowo-design.typ | 21 +++++++++++++++++++-- docs/template.typ | 3 ++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/docs/design/graphics.typ b/docs/design/graphics.typ index 5e0ef4c..320a46d 100644 --- a/docs/design/graphics.typ +++ b/docs/design/graphics.typ @@ -66,6 +66,7 @@ #let stages-overview = canvas({ nodes( [Source], + [AST], [Graph IR], [Runtime], ) diff --git a/docs/design/iowo-design.typ b/docs/design/iowo-design.typ index 4d8e8d8..76b4697 100644 --- a/docs/design/iowo-design.typ +++ b/docs/design/iowo-design.typ @@ -25,9 +25,14 @@ clusters.insert(1, "\u{FEFF}") clusters.join() } -// TODO: could make this just look over headings in section "Execution stages" tbh +// even though it looks like this could be automated with a `query`, +// this'd require wrapping the whole document in a show rule +// at which point `query` doesn't find anything anymore #let terms = ( "source", + "ast", + "abstract syntax tree", + "Abstract Syntax Tree", "graph IR", "runtime", @@ -86,7 +91,15 @@ #graphics.stages-overview -== Source +== Source + +```iowo +open base.png >| +open stencil.png >| +mask +|> (invert | show) +|> show +``` Functional and pipeline-based. However, in contrast to classic shell commands, @@ -180,6 +193,10 @@ Done with any of `--` or `//`. - Outputs of streamers are spliced into the contained list. - In effect, they are automatically flattened. +== Abstract Syntax Tree + +Essentially just the source lexed and parsed. + == Graph IR === Optimizer diff --git a/docs/template.typ b/docs/template.typ index 5bdf52a..fc7f8b2 100644 --- a/docs/template.typ +++ b/docs/template.typ @@ -38,7 +38,8 @@ ) show raw.where(block: false): box.with( fill: luma(95%), - outset: 0.25em, + outset: (y: 0.25em), + inset: (x: 0.15em), radius: 0.25em, )