diff options
Diffstat (limited to 'sample/rbc.rb')
-rw-r--r-- | sample/rbc.rb | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/sample/rbc.rb b/sample/rbc.rb index 88a5b2d069..7ab0edba12 100644 --- a/sample/rbc.rb +++ b/sample/rbc.rb @@ -11,29 +11,29 @@ # # rbc.rb [options] file_name opts # options: -# -d デバッグモード(利用しない方が良いでしょう) -# -m bcモード(分数, 行列の計算ができます) -# -r load-module ruby -r と同じ -# --inspect 結果出力にinspectを用いる(bcモード以外はデ -# フォルト). -# --noinspect 結果出力にinspectを用いない. -# --noreadline readlineライブラリを利用しない(デフォルト -# ではreadlineライブラリを利用しようとする). +# -d debug mode(not encouraged) +# -m bc mode(calculate rational, matrix) +# -r load-module same as `ruby -r' +# --inspect use inspect for output. +# (default except in bc mode) +# --noinspect do not use inspect for output. +# --noreadline do not use readline library. +# (rbc tries to use readline as default). # -# 追加 private method: -# exit, quit 終了する. -# inspect(sw = nil) インスペクトモードのトグル -# trace_load(sw = nil) load/require時にrbcのfile読み込み機能を用 -# いるモードのスイッチ(デフォルトはトレース -# モード) +# additional private methods: +# exit, quit quit +# inspect(sw = nil) toggle inspect mode +# trace_load(sw = nil) toggle trace mode for load/require. +# (default is trace mode on) # require "e2mmap.rb" $stdout.sync = TRUE module BC_APPLICATION__ - RCS_ID='-$Header: /home/keiju/var/src/var.lib/ruby/ruby/RCS/rbc.rb,v 1.2 1997/11/27 13:46:06 keiju Exp keiju $-' - + + RCS_ID=%q$Id: rbc.rb,v 1.2 1997/11/27 13:46:06 keiju Exp keiju $ + extend Exception2MessageMapper def_exception :UnrecognizedSwitch, "Unrecognized switch: %s" @@ -120,9 +120,9 @@ module BC_APPLICATION__ if line != "\n" begin if CONFIG[:INSPECT] - print (cont._=eval(line, bind)).inspect, "\n" + print((cont._=eval(line, bind)).inspect, "\n") else - print (cont._=eval(line, bind)), "\n" + print((cont._=eval(line, bind)), "\n") end rescue # $! = 'exception raised' unless $! @@ -186,7 +186,7 @@ module BC_APPLICATION__ PARCENT_LTYPE = { "q" => "\'", - "Q" => "\"", + "Q" => "\"", #" "x" => "\`", "r" => "\/" } @@ -332,7 +332,7 @@ module BC_APPLICATION__ @lex_state = EXPR_BEG end end - @OP.def_rule('$') do + @OP.def_rule('$') do #' |op, rests| identify_gvar(rests) end @@ -444,7 +444,7 @@ module BC_APPLICATION__ print token, "\n" if $DEBUG if state = CLAUSE_STATE_TRANS[token] if @lex_state != EXPR_BEG and token =~ /^(if|unless|while|until)/ - # 修飾子 + # $B=$>~;R(B else if ENINDENT_CLAUSE.include?(token) @indent += 1 @@ -472,7 +472,7 @@ module BC_APPLICATION__ if lt = PARCENT_LTYPE[ch] ch = chrs.shift else - lt = "\"" + lt = "\"" #" end if ch !~ /\W/ chrs.unshift ch @@ -618,7 +618,7 @@ module BC_APPLICATION__ def_exception :ErrNodeAlreadyExists, "node already exists" class Node - # postprocがなければ抽象ノード, nilじゃなければ具象ノード + # 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 |