@@ -103,26 +103,11 @@ default_node_type(::Type{<:AbstractExpression{T}}) where {T} = Node{T}
103103# #######################################################
104104# Abstract interface ###################################
105105# #######################################################
106- """
107- get_operators(ex::AbstractExpression, operators::Union{Nothing,Any})
108-
109- which will return the operators to be passed to internal functions
110- such as `eval_tree_array` or `string_tree`, either from the expression itself,
111- or `cur_operators` if it is not `nothing`. If left as default,
112- it requires `cur_operators` to not be `nothing`.
113- `cur_operators` would typically be an `OperatorEnum`.
114- """
115106function get_operators (
116107 ex:: AbstractExpression , operators:: Union{AbstractOperatorEnum,Nothing} = nothing
117108)
118109 return error (" `get_operators` function must be implemented for $(typeof (ex)) types." )
119110end
120-
121- """
122- get_variable_names(ex::AbstractExpression, variable_names::Union{Nothing,AbstractVector{<:AbstractString}})
123-
124- The same as `operators`, but for variable names.
125- """
126111function get_variable_names (
127112 ex:: AbstractExpression ,
128113 variable_names:: Union{Nothing,AbstractVector{<:AbstractString}} = nothing ,
@@ -132,12 +117,6 @@ function get_variable_names(
132117 )
133118end
134119
135- """
136- get_tree(ex::AbstractExpression)
137-
138- A method that extracts the expression tree from `AbstractExpression`
139- and should return an `AbstractExpressionNode`.
140- """
141120function get_tree (ex:: AbstractExpression )
142121 return error (" `get_tree` function must be implemented for $(typeof (ex)) types." )
143122end
@@ -169,6 +148,50 @@ function get_metadata(ex::AbstractExpression)
169148end
170149# #######################################################
171150
151+ """
152+ get_operators(ex::AbstractExpression, operators::Union{Nothing,Any})
153+
154+ which will return the operators to be passed to internal functions
155+ such as `eval_tree_array` or `string_tree`, either from the expression itself,
156+ or `cur_operators` if it is not `nothing`. If left as default,
157+ it requires `cur_operators` to not be `nothing`.
158+ `cur_operators` would typically be an `OperatorEnum`.
159+ """
160+ get_operators
161+
162+ """
163+ get_variable_names(ex::AbstractExpression, variable_names::Union{Nothing,AbstractVector{<:AbstractString}})
164+
165+ The same as `operators`, but for variable names.
166+ """
167+ get_variable_names
168+
169+ """
170+ get_tree(ex::AbstractExpression)
171+
172+ A method that extracts the expression tree from `AbstractExpression`
173+ and should return an `AbstractExpressionNode`.
174+ """
175+ get_tree
176+
177+ """
178+ get_contents(ex::AbstractExpression)
179+
180+ Get the contents of the expression, which might be a plain
181+ `AbstractExpressionNode`, or some combination of them, or other data.
182+ This should include everything other than that returned by [`get_metadata`](@ref).
183+ """
184+ get_contents
185+
186+ """
187+ get_metadata(ex::AbstractExpression)
188+
189+ Get the metadata of the expression, which might be a plain
190+ `NamedTuple`, or some combination of them, or other data.
191+ This should include everything other than that returned by [`get_contents`](@ref).
192+ """
193+ get_metadata
194+
172195"""
173196 with_contents(ex::AbstractExpression, tree::AbstractExpressionNode)
174197 with_contents(ex::AbstractExpression, tree::AbstractExpression)
0 commit comments