add block_scope to --output ast

This commit is contained in:
kzc 2018-01-13 14:56:40 -05:00
parent aa1786dedf
commit 30395e40da

View File

@ -268,6 +268,13 @@ function run() {
var result = {
_class: "AST_" + value.TYPE
};
if (value.block_scope) {
result.block_scope = {
variables: value.block_scope.variables,
functions: value.block_scope.functions,
enclosed: value.block_scope.enclosed,
};
}
value.CTOR.PROPS.forEach(function(prop) {
result[prop] = value[prop];
});