summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-07 08:22:42 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-07 08:22:42 +0000
commit549c345cefe03ab3f35b9cca1192a0062f288eca (patch)
treeebec2258661db268552635e00841de994b1918a0 /misc
parent7eef190796511c58756e58d4e3666f3a78523f5c (diff)
* parse.y (parser_yylex): allow ';;' to be block terminator in
place of 'end'. [highly experimental] * misc/ruby-mode.el (ruby-block-end-re): allow ';;' for a negative indent trigger. [highly experimental] * parse.y (parser_yylex): "respond_to?:foo" should be interpreted as "respond_to? :foo" at the command level. [ruby-talk:144303] * sprintf.c (rb_f_sprintf): raise exception on debug mode (-d), not verbose mode (-w/-w). [ruby-core:05123] * sprintf.c (rb_f_sprintf): warn always on verbose mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'misc')
-rw-r--r--misc/ruby-mode.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index 7f2bcabd58..4a93054e99 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -45,7 +45,7 @@
(concat ruby-modifier-beg-re "\\|" ruby-block-op-re)
)
-(defconst ruby-block-end-re "end")
+(defconst ruby-block-end-re "\\<end\\>\\|;;")
(defconst ruby-here-doc-beg-re
"<<\\(-\\)?\\(\\([a-zA-Z0-9_]+\\)\\|[\"]\\([^\"]+\\)[\"]\\|[']\\([^']+\\)[']\\)")
@@ -61,13 +61,13 @@
(defconst ruby-delimiter
(concat "[?$/%(){}#\"'`.:]\\|<<\\|\\[\\|\\]\\|\\<\\("
ruby-block-beg-re
- "\\|" ruby-block-end-re
- "\\)\\>\\|^=begin\\|" ruby-here-doc-beg-re)
+ "\\>\\|" ruby-block-end-re
+ "\\)\\|^=begin\\|" ruby-here-doc-beg-re)
)
(defconst ruby-negative
(concat "^[ \t]*\\(\\(" ruby-block-mid-re "\\)\\>\\|\\("
- ruby-block-end-re "\\)\\>\\|}\\|\\]\\)")
+ ruby-block-end-re "\\)\\|}\\|\\]\\)")
)
(defconst ruby-operator-chars "-,.+*/%&|^~=<>:")
@@ -453,7 +453,7 @@ The variable ruby-indent-level controls the amount of indentation.
(setq depth (1- depth)))
(setq nest (cdr nest))
(goto-char pnt))
- ((looking-at (concat "\\<\\(" ruby-block-end-re "\\)\\>"))
+ ((looking-at ruby-block-end-re)
(if (or (and (not (bolp))
(progn
(forward-char -1)
@@ -776,7 +776,8 @@ An end of a defun is found by moving forward from the beginning of one."
(defun ruby-move-to-block (n)
(let (start pos done down)
(setq start (ruby-calculate-indent))
- (setq down (looking-at (concat "\\<\\(" (if (< n 0) ruby-block-end-re ruby-block-beg-re) "\\)\\>")))
+ (setq down (looking-at (if (< n 0) ruby-block-end-re
+ (concat "\\<\\(" ruby-block-beg-re "\\)\\>"))))
(while (and (not done) (not (if (< n 0) (bobp) (eobp))))
(forward-line n)
(cond
@@ -887,7 +888,7 @@ An end of a defun is found by moving forward from the beginning of one."
(?:
(forward-char -1)
(eq (char-before) :)))))
- (if (looking-at (concat "\\<\\(" ruby-block-end-re "\\)\\>"))
+ (if (looking-at ruby-block-end-re)
(ruby-beginning-of-block))
nil))
(setq i (1- i)))