@@ -551,12 +551,6 @@ def add_child(self, child):
551
551
self .children .append (child )
552
552
child .parent = self
553
553
554
- def to_json (self , assoc ):
555
- return {
556
- "platforms" : list (assoc [self ]),
557
- "children" : [x .to_json (assoc ) for x in self .children ],
558
- }
559
-
560
554
@staticmethod
561
555
def is_start_node ():
562
556
"""
@@ -614,17 +608,6 @@ def __compute_file_hash(self):
614
608
615
609
return hasher .hexdigest ()
616
610
617
- def to_json (self , assoc ):
618
- parent_json = super ().to_json (assoc )
619
- mydict = {
620
- "type" : "file" ,
621
- "file" : self .filename ,
622
- "name" : os .path .basename (self .filename ),
623
- "sloc" : self .total_sloc ,
624
- }
625
- parent_json .update (mydict )
626
- return parent_json
627
-
628
611
def __repr__ (self ):
629
612
return _representation_string (self , attrs = ["filename" ])
630
613
@@ -653,23 +636,6 @@ def __init__(self, start_line=-1, end_line=-1, num_lines=0, source=None):
653
636
self .num_lines = num_lines
654
637
self .source = source
655
638
656
- def to_json (self , assoc ):
657
- parent_json = super ().to_json (assoc )
658
- if self .source :
659
- source = "\n " .join (self .source )
660
- else :
661
- source = None
662
-
663
- mydict = {
664
- "type" : "code" ,
665
- "start_line" : self .start_line ,
666
- "end_line" : self .end_line ,
667
- "sloc" : self .num_lines ,
668
- "source" : source ,
669
- }
670
- parent_json .update (mydict )
671
- return parent_json
672
-
673
639
def __repr__ (self ):
674
640
return _representation_string (
675
641
self ,
@@ -707,12 +673,6 @@ class DirectiveNode(CodeNode):
707
673
def __init__ (self ):
708
674
super ().__init__ ()
709
675
710
- def to_json (self , assoc ):
711
- parent_json = super ().to_json (assoc )
712
- mydict = {"type" : "directive" , "source" : "\n " .join (self .spelling ())}
713
- parent_json .update (mydict )
714
- return parent_json
715
-
716
676
717
677
class UnrecognizedDirectiveNode (DirectiveNode ):
718
678
"""
0 commit comments