class Tapioca::Compilers::SymbolTable::SymbolLoader::SymbolTableParser
Public Class Methods
parse(object, parents = [])
click to toggle source
# File lib/tapioca/compilers/symbol_table/symbol_loader.rb, line 57 def self.parse(object, parents = []) symbols = Set.new children = object.fetch("children", []) children.each do |child| kind = child.fetch("kind") name = child.fetch("name") name = name.fetch("name") if name.is_a?(Hash) next if kind.nil? || name.nil? # TODO: CLASS is removed since v0.4.4730 of Sorbet # but keeping here for backward compatibility. Remove # once the minimum version is moved past that. next unless ["CLASS", "CLASS_OR_MODULE", "STATIC_FIELD"].include?(kind) next if name =~ /[<>()$]/ next if name =~ /^[0-9]+$/ next if name == "T::Helpers" parents << name symbols.add(parents.join("::")) symbols.merge(parse(child, parents)) parents.pop end symbols end