summaryrefslogtreecommitdiff
path: root/lib/irb/slex.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irb/slex.rb')
-rw-r--r--lib/irb/slex.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/irb/slex.rb b/lib/irb/slex.rb
index 85aa92bd73..26008906e5 100644
--- a/lib/irb/slex.rb
+++ b/lib/irb/slex.rb
@@ -1,9 +1,9 @@
#
-# irb-slex.rb - symple lex analizer
-# $Release Version: 0.6$
+# irb/slex.rb - symple lex analizer
+# $Release Version: 0.7.3$
# $Revision$
# $Date$
-# by Keiju ISHITSUKA(Nippon Rational Inc.)
+# by Keiju ISHITSUKA(keiju@ishituska.com)
#
# --
#
@@ -20,7 +20,7 @@ class SLex
def_exception :ErrNodeAlreadyExists, "node already exists"
class << self
- attr :debug_level, TRUE
+ attr_accessor :debug_level
def debug?
debug_level > 0
end
@@ -88,16 +88,16 @@ class SLex
#
#----------------------------------------------------------------------
class Node
- # if postproc no exist, this node is abstract node.
- # if postproc isn't nil, this node is real node.
+ # if postproc is nil, this node is an abstract node.
+ # if postproc is non-nil, this node is a real node.
def initialize(preproc = nil, postproc = nil)
@Tree = {}
@preproc = preproc
@postproc = postproc
end
- attr :preproc, TRUE
- attr :postproc, TRUE
+ attr_accessor :preproc
+ attr_accessor :postproc
def search(chrs, opt = nil)
return self if chrs.empty?
@@ -159,8 +159,8 @@ class SLex
#
# chrs: String
# character array
- # io It must have getc()/ungetc(), and ungetc() can be
- # called any number of times.
+ # io must have getc()/ungetc(); and ungetc() must be
+ # able to be called arbitrary number of times.
#
def match(chrs, op = "")
print "match>: ", chrs, "op:", op, "\n" if SLex.debug?
@@ -265,7 +265,7 @@ if $0 == __FILE__
print "0: ", tr.inspect, "\n"
tr.def_rule("=") {print "=\n"}
print "1: ", tr.inspect, "\n"
- tr.def_rule("==", proc{FALSE}) {print "==\n"}
+ tr.def_rule("==", proc{false}) {print "==\n"}
print "2: ", tr.inspect, "\n"
print "case 1:\n"