lib/rley/gfg/grm_flow_graph.rb in rley-0.6.08 vs lib/rley/gfg/grm_flow_graph.rb in rley-0.6.09
- old
+ new
@@ -137,9 +137,13 @@
case visitee
when Rley::GFG::StartVertex
if first_time
stack.push(Branching.new(visitee, curr_edge))
curr_edge = stack.last.next_edge
+ elsif curr_edge.nil?
+ # Error probably caused by missing terminal symbol object
+ msg = "Undefined grammar symbol #{visitee.label.sub(/^\./, '')}"
+ raise StandardError, msg
else
# Skip both start and end vertices
# Retrieve the corresponding return edge
curr_edge = get_matching_return(curr_edge)
end