Browse files

.

  • Loading branch information...
1 parent 8158f5e commit 172fe262b07de0b2696d3e9f056f467cae59f125 @kschiess committed Jul 31, 2013
Showing with 7 additions and 4 deletions.
  1. +7 −4 lib/parslet/graphviz.rb
View
11 lib/parslet/graphviz.rb
@@ -56,14 +56,17 @@ def visit_lookahead(positive, atom)
recurse atom, parent
end
def visit_re(regexp)
- @parent = nil
+ # downwards node(regexp.object_id, label: escape("re(#{regexp.inspect})"))
end
def visit_str(str)
- @parent = nil
+ # downwards node(str.object_id, label: escape("#{str.inspect}"))
end
- def node name
- @graph.add_nodes name.to_s
+ def escape str
+ str.gsub('"', "'")
+ end
+ def node name, opts={}
+ @graph.add_nodes name.to_s, opts
end
def downwards child
if @parent && !@known_links.include?([@parent, child])

0 comments on commit 172fe26

Please sign in to comment.