• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/ruby-104/ruby/misc/

Lines Matching defs:end

54        (substring ruby-mode-revision (match-beginning 0) (match-end 0)))
57 (defconst ruby-keyword-end-re
71 (concat (regexp-opt '("while" "until" "for" "rescue") t) ruby-keyword-end-re)
107 (defconst ruby-block-end-re "\\_<end\\_>")
112 (defconst ruby-here-doc-end-re
115 (defun ruby-here-doc-end-match ()
137 "\\)\\_>\\|" ruby-block-end-re
143 ruby-block-end-re "\\|}\\|\\]\\)")
165 (define-key ruby-mode-map "\e\C-e" 'ruby-end-of-defun)
169 (define-key ruby-mode-map "\e\C-n" 'ruby-end-of-block)
173 (define-key ruby-mode-map "\C-c\C-e" 'ruby-insert-end)
254 (defun ruby-imenu-create-index-in-block (prefix beg end)
258 (while (re-search-forward "^\\s *\\(\\(class\\s +\\|\\(class\\s *<<\\s *\\)\\|module\\s +\\)\\([^\(<\n ]+\\)\\|\\(def\\|alias\\)\\s +\\([^\(\n ]+\\)\\)" end t)
261 (setq next (match-end 0))
276 (ruby-accurate-end-of-block end))
282 (ruby-accurate-end-of-block end)
294 (defun ruby-accurate-end-of-block (&optional end)
296 (or end (setq end (point-max)))
297 (while (and (setq state (apply 'ruby-parse-partial end state))
298 (>= (nth 2 state) 0) (< (point) end)))))
310 (make-local-variable 'comment-end)
311 (setq comment-end "")
352 (delete-region (point) (match-end 2))
440 (goto-char (match-end 0))
448 (defun ruby-forward-string (term &optional end no-error expand)
453 (while (and (re-search-forward re end no-error)
455 (ruby-forward-string "}{" end no-error nil)
477 (defun ruby-parse-partial (&optional end in-string nest depth pcol indent)
480 (when (re-search-forward ruby-delimiter end 'move)
489 (ruby-forward-string (buffer-substring (point) (1+ (point))) end t t))
493 (goto-char end))))
497 (re-search-forward "[^\\]\\(\\\\\\\\\\)*'" end t))
501 (goto-char end))))
507 (if (ruby-forward-string "/" end t t)
510 (goto-char end)))
529 (unless (cond (re (ruby-forward-string re end t expand))
530 (expand (ruby-forward-string w end t t))
535 end t)))
537 (goto-char end)))
544 (goto-char (match-end 0)))
559 (setq pnt (1- (match-end 0))))
579 ((looking-at ruby-block-end-re)
604 (goto-char (match-end 0)))
608 (or (not (looking-at (concat "do" ruby-keyword-end-re)))
634 (ruby-forward-string (buffer-substring (match-beginning 1) (match-end 1)) end))
636 (goto-char (match-end 0)))
638 (goto-char (match-end 0)))
643 (goto-char (match-end 0)))
645 (if (re-search-forward "^=end" end t)
647 (setq in-string (match-end 0))
648 (goto-char end)))
655 (let* ((id-end (goto-char (match-end 0)))
656 (line-end-position (save-excursion (end-of-line) (point)))
659 (while (and (> line-end-position (point))
661 line-end-position state))))
668 (if (re-search-forward (concat "^" re "$") end 'move)
670 (setq in-string id-end)
671 (goto-char end))))
677 (if (re-search-forward (ruby-here-doc-end-match)
680 (setq in-string (match-end 0))
688 (defun ruby-parse-region (start end)
695 (narrow-to-region (point) end)
696 (while (and (> end (point))
697 (setq state (apply 'ruby-parse-partial end state))))))
713 state bol eol begin op-end
774 (end-of-line)
782 (and (not (eq ?_ (char-after (match-end 0))))
791 (let (end done)
794 (setq end (point))
796 (if (re-search-forward "^\\s *#" end t)
800 (end-of-line)
801 ;; skip the comment at the end
803 (let (end (pos (point)))
806 (setq end (1- (point)))
807 (or (ruby-special-char-p end)
808 (and (setq state (ruby-parse-region parse-start end))
810 (setq end nil))
811 (goto-char (or end pos))
813 (setq begin (if (and end (nth 0 state)) pos (cdr (nth 1 state))))
822 (goto-char (match-end 0))
826 ;; operator at the end of line
853 (setq op-end t)))))
857 (null op-end)
895 Returns t unless search stops due to end of buffer."
908 (defun-region-command ruby-end-of-defun (&optional arg)
909 "Move forward to next end of defun.
910 An end of a defun is found by moving forward from the beginning of one."
912 (and (re-search-forward (concat "^\\(" ruby-block-end-re "\\)\\($\\|\\b[^_]\\)")
920 (setq down (looking-at (if (< n 0) ruby-block-end-re
928 (re-search-forward "^=end\\>"))
929 ((and (< n 0) (looking-at "^=end\\>"))
962 (defun-region-command ruby-end-of-block (&optional arg)
975 (if (looking-at ",\\s *") (goto-char (match-end 0)))
977 (goto-char (match-end 0)))
985 (ruby-end-of-block)
1024 (let ((c (char-to-string (char-before (match-end 0)))))
1043 (if (looking-at ruby-block-end-re)
1054 (end-of-line 0)
1061 (defun ruby-decomment-region (beg end)
1065 (while (re-search-forward "^\\([ \t]*\\)#" end t)
1070 (defun ruby-insert-end ()
1072 (insert "end")
1074 (end-of-line))
1077 "Put mark at end of this Ruby function, point at beginning."
1080 (ruby-end-of-defun)
1169 (defun ruby-brace-to-do-end ()
1171 (let ((orig (point)) (end (progn (ruby-forward-sexp) (point))))
1176 (insert "end")
1189 (defun ruby-do-end-to-brace ()
1193 (let ((orig (point)) (end (progn (ruby-forward-sexp) (point))))
1195 (when (looking-at ruby-block-end-re)
1202 (delete-char (- (match-end 0) (match-beginning 0) 1)))
1207 (or (ruby-brace-to-do-end)
1208 (ruby-do-end-to-brace)))
1241 ("^\\(=\\)end\\(\\s \\|$\\)" 1 (7 . nil))
1245 (,ruby-here-doc-end-re 3 (ruby-here-doc-end-syntax))))
1283 (ruby-here-doc-find-end old-point)))
1286 (defun ruby-here-doc-find-end (&optional limit)
1290 buffer position `limit' or the end of the buffer."
1294 (let ((eol (save-excursion (end-of-line) (point)))
1296 ;; Fake match data such that (match-end 0) is at eol
1297 (end-match-data (progn (looking-at ".*$") (match-data)))
1298 beg-match-data end-re)
1301 (setq end-re (ruby-here-doc-end-match))
1303 (set-match-data end-match-data)
1304 (goto-char (match-end 0))
1305 (unless (re-search-forward end-re limit t) (throw 'done nil))
1306 (setq end-match-data (match-data))
1309 (goto-char (match-end 0)))
1310 (set-match-data end-match-data)
1311 (goto-char (match-end 0))
1321 (defun ruby-here-doc-end-syntax ()
1330 (progn (goto-char (match-end 0)) ; And it's the last heredoc on its line...
1348 (if (re-search-forward "^=end\\(\\s \\|$\\)" limit t)
1356 (if (and (re-search-backward "^=\\(begin\\|end\\)\\(\\s \\|$\\)" nil t)
1361 (if (and beg (and (re-search-forward "^=\\(begin\\|end\\)\\(\\s \\|$\\)" nil t)
1362 (string= (match-string 1) "end")))
1396 "end"
1420 ruby-keyword-end-re)
1468 ("[^_]\\<\\(begin\\|case\\|else\\|elsif\\|end\\|ensure\\|for\\|if\\|unless\\|rescue\\|then\\|when\\|while\\|until\\|do\\|yield\\)\\>\\([^_]\\|$\\)" 1 defun)