Skip to content

Commit

Permalink
Remove empty-child RuleNode and UniformHole constructors
Browse files Browse the repository at this point in the history
They are better-suited as functions in `HerbGrammar`
  • Loading branch information
ReubenJ committed Nov 26, 2024
1 parent 1bf674c commit f6cea02
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/rulenode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ mutable struct RuleNode <: AbstractRuleNode
children::Vector{AbstractRuleNode}
end

function RuleNode(ind::Int, grammar::AbstractGrammar)
RuleNode(
ind, nothing, [Hole(get_domain(grammar, type)) for type in grammar.childtypes[ind]])
end

function RuleNode(ind::Int, _val::Any, grammar::AbstractGrammar)
RuleNode(
ind, _val, [Hole(get_domain(grammar, type)) for type in grammar.childtypes[ind]])
end

"""
AbstractHole <: AbstractRuleNode
Expand Down Expand Up @@ -78,11 +68,6 @@ mutable struct UniformHole <: AbstractUniformHole
children::Vector{AbstractRuleNode}
end

function UniformHole(domain::BitVector, grammar::AbstractGrammar)
UniformHole(domain,
[Hole(get_domain(grammar, type)) for type in grammar.childtypes[findfirst(domain)]])
end

"""
Hole <: AbstractHole
Expand Down

0 comments on commit f6cea02

Please sign in to comment.