Skip to content

Commit a75065e

Browse files
committed
Print more information when node does not have attribute
1 parent 59fff26 commit a75065e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/syntax_graph.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ function Base.getproperty(ex::SyntaxTree, name::Symbol)
213213
name === :_id && return getfield(ex, :_id)
214214
_id = getfield(ex, :_id)
215215
return get(getproperty(getfield(ex, :_graph), name), _id) do
216-
error("Property `$name[$_id]` not found")
216+
attrstr = join(["\n $n = $(getproperty(ex, n))"
217+
for n in attrnames(ex)], ",")
218+
error("Property `$name[$_id]` not found. Available attributes:$attrstr")
217219
end
218220
end
219221

0 commit comments

Comments
 (0)