Implemented `getGlobals()` for Program which will return all Variable objects representing variables defined globally

develop_before_lexer_parser_merge_parseName
Tristan B. V. Kildaire 2021-03-21 21:44:22 +02:00
parent 87f7f458c8
commit 779a76acb6
1 changed files with 7 additions and 1 deletions

View File

@ -345,7 +345,13 @@ public class Program
{
Variable[] variables;
// foreach()
foreach(Statement statement; statements)
{
if(typeid(statement) == typeid(Variable))
{
variables ~= cast(Variable)statement;
}
}
return variables;
}