Skip to content

Commit 4270e09

Browse files
committed
ast: Improve astDumpSmall() to show VAR/IDX/DEREF/etc. offsets
1 parent 7df63a1 commit 4270e09

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/compiler/ast-node-misc.bas

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,11 @@ sub astDumpSmall( byval n as ASTNODE ptr, byref prefix as string )
10211021
s += typeDump( n->dtype, n->subtype )
10221022

10231023
select case as const( n->class )
1024+
case AST_NODECLASS_VAR : if( n->var_.ofs ) then s += " ofs=" & n->var_.ofs
1025+
case AST_NODECLASS_DEREF : if( n->ptr.ofs ) then s += " ofs=" & n->ptr.ofs
1026+
case AST_NODECLASS_OFFSET : if( n->ofs.ofs ) then s += " ofs=" & n->ofs.ofs
1027+
case AST_NODECLASS_IDX : if( n->idx.ofs ) then s += " ofs=" & n->idx.ofs
1028+
if( n->idx.mult <> 1 ) then s += " mult=" & n->idx.mult
10241029
case AST_NODECLASS_BOP, AST_NODECLASS_UOP
10251030
s += " " + astDumpOp( n->op.op )
10261031
case AST_NODECLASS_CONST

0 commit comments

Comments
 (0)