1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-27 21:57:28 +00:00

Fine-tuned the verbose of the weight of the symbols and the onlyZP flag.

This commit is contained in:
Sven Van de Velde 2023-12-05 11:21:22 +01:00
parent 59fd0e0703
commit a4bbf1fd4f

View File

@ -369,11 +369,11 @@ public abstract class Scope implements Symbol {
if(symbol instanceof StructDefinition)
continue;
if(!onlyVars || symbol instanceof Procedure || symbol instanceof BlockScope || symbol instanceof ProgramScope)
res.append(((Scope) symbol).toStringVars(program, onlyVars, false));
res.append(((Scope) symbol).toStringVars(program, onlyVars, onlyZP));
} else if(symbol instanceof Variable) {
Variable symVar = (Variable) symbol;
if(!onlyVars || symVar.isVariable()) {
if(!(onlyZP && symVar.getRegister() instanceof Registers.RegisterZpMem && symVar.getRegister().getType() == Registers.RegisterType.ZP_MEM)) continue; // Show only ZP vars
if(onlyZP && !(symVar.getMemoryArea() != null && symVar.getMemoryArea().equals(Variable.MemoryArea.ZEROPAGE_MEMORY) && symVar.getAllocation() != null)) continue; // Show only ZP vars
// Output if not instructed to only output variables - or if it is a variable
if(symVar.isKindLoadStore()) res.append("__loadstore ");
if(symVar.isKindConstant()) res.append("__constant ");