qingyi-yan / POET

Other
1 stars 2 forks source link

Feat function decl #21

Closed Samuel-Oglegba closed 1 year ago

Samuel-Oglegba commented 1 year ago

This PR addresses the issue of function parameters and variables declared in a function not found in the global symbol table after entering a function block by changing:

<code FunctionDecl pars=(name,params,ret,body) symtab="" />

to

<code FunctionDecl pars=(name,params,ret,body) symtab="" 
rebuild=(
if (symtab : "") {
enter_block("NEW");
foreach p = CODE.TypeInfo \in params do 
insert_typeInfo(p);
enddo
FunctionDecl[symtab=exit_block()]#(name,params,ret,body)
} else {
FunctionDecl[symtab=symtab]#(name,params,ret,body)
}
/>