visitDeclVar method

  1. @override
GzBaseNode visitDeclVar(
  1. DeclVar declVar
)
override

Implementation

@override
GzBaseNode visitDeclVar(DeclVar declVar) {
  final id = declVar.id.lexeme;
  final value = declVar.init?.accept(this);
  final attr =switch(declVar.attr?.lexeme) {
    final String s => ' <$s> ',
    _ => ''
  };

  return node(
    'local $id$attr',
    color: skyBlue,
    shape: 'box',
    children: value != null ? [value] : null,
  );
}