summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichi ITO <[email protected]>2024-07-17 21:29:08 +0900
committergit <[email protected]>2024-07-17 18:17:59 +0000
commit0fe816f3808cdf647ac549a8ddb2e0540320b890 (patch)
treee7e00392c076045aa477fa572cda803fbb20a383
parent7de2c06352be3370e4fc51612bee35b2e6eacf4b (diff)
[ruby/prism] [Doc] Tweak example of `Prism::Dispatcher`
This PR tweaked the documentation to correct an error encountered when running the example code of `Prism::Dispatcher`. This aims to make understanding the example smoother. https://github.com/ruby/prism/commit/165a1a0e78
-rw-r--r--prism/templates/lib/prism/dispatcher.rb.erb3
1 files changed, 2 insertions, 1 deletions
diff --git a/prism/templates/lib/prism/dispatcher.rb.erb b/prism/templates/lib/prism/dispatcher.rb.erb
index 1370ca7636..0db0003464 100644
--- a/prism/templates/lib/prism/dispatcher.rb.erb
+++ b/prism/templates/lib/prism/dispatcher.rb.erb
@@ -14,7 +14,8 @@ module Prism
# end
# end
#
- # dispatcher = Dispatcher.new
+ # listener = OctalListener.new
+ # dispatcher = Prism::Dispatcher.new
# dispatcher.register(listener, :on_integer_node_enter)
#
# Then, you can walk any number of trees and dispatch events to the listeners: