-
Notifications
You must be signed in to change notification settings - Fork 0
Sub bodies
Sub-bodies define where child objects can appear within a parent object, creating hierarchical nesting.
graph TD
subgraph "<---> Default Sub-body"
CLASS1["<b>class</b>"] <-->|"both-sided<br/>dependency"| FUNC1["<b>function</b>"]
end
subgraph "<-function-> Typed Sub-body"
CLASS2["<b>class</b>"] ---|"no dependency<br/>on child"| FUNC2["<b>function</b>"]
FUNC2 -->|"depends on<br/>parent"| CLASS2
end
style CLASS1 fill:#4a90d9,color:#fff
style FUNC1 fill:#7b68ee,color:#fff
style CLASS2 fill:#4a90d9,color:#fff
style FUNC2 fill:#7b68ee,color:#fff
Accepts any child object. Creates a both-sided dependency between parent and child.
<*{}*> { <---> } <*>
<:class:> class <<name>> () { <---> } <:>
Accepts only the named object type. Only the child depends on the parent - not the other way around.
<:class:> class <<name>> () { <-function-> } <:>
<:function:> function <<name>> () { <---> } <:>
This allows loosely coupled structures - e.g., functions within a class where the class doesn't depend on its functions.
| Sub-body | Accepts | Parent → Child | Child → Parent |
|---|---|---|---|
<---> |
Any object | ✅ | ✅ |
<-name-> |
Named type only | ❌ | ✅ |
The Basics grammar uses both types:
| Object | Sub-body | Effect |
|---|---|---|
class |
<-function, class, refference, variable-> |
Typed - only these four types can appear inside a class. The class does not depend on its children. |
function |
<-function_-> |
Wildcard (underscore) - any object type can appear inside a function body. |
In the Test_Repo, class C1 contains function F1, function F2, and several variable objects. These are allowed by the typed sub-body. If the source code contained an import inside the class, it would not be parsed because import is not listed.
See Repo Analysis for the full parsed object trees.
Next: References - Substituting objects into other definitions.
- Getting Started
- Sign-Up
- Home Screen
- Creating Your First Template
- Template Editor
- Application Navigation
- Syntax Overview
- Workflow: End-to-End
- Workflow: Test with simpleDemo
- Workflow: Build Template from angularTemp
- Demo Repositories
- Template
- Workbench
- GitHub Integration
- GitHub App Installation
- GitHub Repository Setup
- GitHub Re-linking
- Settings
- Overview
- Declarations
- Types
- Scoping