なかだです。

At Sat, 31 Jul 2004 01:15:20 +0900,
GOTO Naohisa wrote:
> 例1:
> 
> def aa(b)
>   unless defined?(@b)
> @b = b
> end
> end
> 
> unlessをifにしても同じです。
> defined?の後の括弧を無くすと正常にネストされます。
> 
> 例2:
> 
> unless org
>   org = e.org if e.org
>               end
> 
> 推測ですが、orから始まる変数かメソッドが原因のような気がします。

どちらも原因は同じようですね。


Index: misc/ruby-mode.el =================================================================== RCS file: /cvs/ruby/src/ruby/misc/ruby-mode.el,v retrieving revision 1.81 diff -U2 -p -d -r1.81 ruby-mode.el --- misc/ruby-mode.el 7 May 2004 08:44:24 -0000 1.81 +++ misc/ruby-mode.el 31 Jul 2004 02:39:48 -0000 @@ -322,7 +322,7 @@ The variable ruby-indent-level controls (skip-chars-backward ruby-symbol-chars) (cond - ((or (looking-at ruby-block-beg-re) - (looking-at ruby-block-op-re) - (looking-at ruby-block-mid-re)) + ((or (looking-at (concat "\\<\\(" ruby-block-beg-re + "|" ruby-block-op-re + "|" ruby-block-mid-re "\\)\\>"))) (goto-char (match-end 0)) (not (looking-at "\\s_"))) @@ -452,5 +452,5 @@ The variable ruby-indent-level controls (setq nest (cdr nest)) (goto-char pnt)) - ((looking-at ruby-block-end-re) + ((looking-at (concat "\\<\\(" ruby-block-end-re "\\)\\>")) (if (or (and (not (bolp)) (progn @@ -478,5 +478,5 @@ The variable ruby-indent-level controls (setq depth (1+ depth)))) (goto-char (match-end 0))) - ((looking-at ruby-block-beg-re) + ((looking-at (concat "\\<\\(" ruby-block-beg-re "\\)\\>")) (and (save-match-data @@ -662,5 +662,5 @@ The variable ruby-indent-level controls (or (and (looking-at ruby-symbol-re) (skip-chars-backward ruby-symbol-chars) - (looking-at ruby-block-hanging-re) + (looking-at (concat "\\<\\(" ruby-block-hanging-re "\\)\\>")) (not (eq (point) (nth 3 state))) (save-excursion @@ -701,5 +701,5 @@ The variable ruby-indent-level controls ((and (null op-end) - (not (looking-at ruby-block-hanging-re)) + (not (looking-at (concat "\\<\\(" ruby-block-hanging-re "\\)\\>"))) (eq (ruby-deep-indent-paren-p t) 'space) (not (bobp))) @@ -758,5 +758,5 @@ An end of a defun is found by moving for (let (start pos done down) (setq start (ruby-calculate-indent)) - (setq down (looking-at (if (< n 0) ruby-block-end-re ruby-block-beg-re))) + (setq down (looking-at (concat "\\<\\(" (if (< n 0) ruby-block-end-re ruby-block-beg-re) "\\)\\>"))) (while (and (not done) (not (if (< n 0) (bobp) (eobp)))) (forward-line n) @@ -780,5 +780,5 @@ An end of a defun is found by moving for (save-excursion (back-to-indentation) - (if (looking-at ruby-block-mid-re) + (if (looking-at (concat ("\\<\\(" ruby-block-mid-re "\\)\\>"))) (setq done nil)))))) (back-to-indentation)) @@ -808,5 +808,5 @@ An end of a defun is found by moving for (looking-at "\\s(")) (goto-char (scan-sexps (point) 1))) - ((and (looking-at ruby-block-beg-re) + ((and (looking-at (concat "\\<\\(" ruby-block-beg-re "\\)\\>")) (not (eq (char-before (point)) ?.)) (not (eq (char-before (point)) ?:))) @@ -869,5 +869,5 @@ An end of a defun is found by moving for (forward-char -1) (eq (char-before) :))))) - (if (looking-at ruby-block-end-re) + (if (looking-at (concat "\\<\\(" ruby-block-end-re "\\)\\>")) (ruby-beginning-of-block)) nil))
-- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦