diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-04-30 17:54:55 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-04-30 17:54:55 +0000 |
commit | 859a7a92775a84f118a063e5afba4580c7d6d0df (patch) | |
tree | 62732b6945b603c1760c07620f7dc3acafc99492 /lib/irb/slex.rb | |
parent | f8ab487e4d60a14dd7f807ab146168d9d034a6ea (diff) | |
download | ruby-859a7a92775a84f118a063e5afba4580c7d6d0df.tar.gz |
Merge from irb 0.7.3.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb/slex.rb')
-rw-r--r-- | lib/irb/slex.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/irb/slex.rb b/lib/irb/slex.rb index 85aa92bd73..e283df40fe 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 @@ -90,14 +90,15 @@ class SLex class Node # if postproc no exist, this node is abstract node. # if postproc isn't nil, this node is real node. + # (JP: postproc$B$,$J$1$l$PCj>]%N!<%I(B, nil$B$8$c$J$1$l$P6q>]%N!<%I(B) 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? @@ -158,9 +159,11 @@ class SLex # # chrs: String - # character array + # character array (JP: $B0lJ8;z$E$D$N(BArray) # io It must have getc()/ungetc(), and ungetc() can be # called any number of times. + # (JP:$B$@$@$7(B, getc/ungetc$B$,Hw$o$C$F$$$J$1$l$P$J$i$J$$(B. + # $B$5$i$K(B, ungetc$B$OJ#?t2s2DG=$G$J$/$F$O$J$i$J$$(B.) # def match(chrs, op = "") print "match>: ", chrs, "op:", op, "\n" if SLex.debug? @@ -265,7 +268,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" |