Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mercerenies committed Oct 27, 2022
1 parent ca4ae3c commit bfc02e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion doc/CompilationStages.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ flowchart LR
subgraph GDScript
direction TB
Bind[Bind all top-level declarations in a global symbol table]
Const[Check that any expressions in constant position are actually constant]
Compile[Compile IR into GDScript syntax representation]
Optimize[Run GDScript-Level Optimizations]
Output[Output GDScript to .gd file]
Bind-->Compile-->Optimize-->Output
Bind-->Const-->Compile-->Optimize-->Output
end
AST-->IR-->GDScript
```
Expand Down Expand Up @@ -61,6 +62,11 @@ top-level declarations have their names bound in the global symbol
table. This ensures that, during compilation, functions can access
functions declared anywhere in the file.

With the symbol table, any expressions in constant position are
checked to make sure they are actually constant. This includes `const`
declarations, the right-hand-side of `enum` values, and the inside of
`export` clauses.

Then the IR is compiled into an internal representation of GDScript.
This is basically GDScript source code, but represented as an abstract
syntax tree manipulable within the GDLisp engine. This compilation
Expand Down

0 comments on commit bfc02e6

Please sign in to comment.