• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/ruby-106/ruby/misc/

Lines Matching +defs:end +defs:point

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)
251 (defvar ruby-indent-point nil "internal variable")
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)
283 (setq beg (point))
292 (nreverse (ruby-imenu-create-index-in-block nil (point-min) nil)))
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 "")
331 (goto-char (point-min))
333 (goto-char (point-min))
352 (delete-region (point) (match-end 2))
383 (setq beg (point))
393 (delete-region beg (point))
399 (setq pnt (or pnt (point)))
400 (let ((c (char-before pnt)) (b (and (< (point-min) pnt) (char-before (1- pnt)))))
408 (and (or (bolp) (not (eq (char-before (point)) ?_)))
415 (start (point)))
421 (or (eq (char-syntax (char-before (point))) ?w)
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)
456 (> (setq n (if (eq (char-before (point)) c)
477 (defun ruby-parse-partial (&optional end in-string nest depth pcol indent)
480 (when (re-search-forward ruby-delimiter end 'move)
481 (let ((pnt (point)) w re expand)
489 (ruby-forward-string (buffer-substring (point) (1+ (point))) end t t))
492 (setq in-string (point))
493 (goto-char end))))
497 (re-search-forward "[^\\]\\(\\\\\\\\\\)*'" end t))
500 (setq in-string (point))
501 (goto-char end))))
507 (if (ruby-forward-string "/" end t t)
509 (setq in-string (point))
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)))
536 (setq in-string (point))
537 (goto-char end)))
544 (goto-char (match-end 0)))
552 (goto-char (point))
559 (setq pnt (1- (match-end 0))))
560 (setq nest (cons (cons (char-after (point)) (point)) nest))
563 (setq nest (cons (cons (char-after (point)) pnt) nest))
574 (point))))
579 ((looking-at ruby-block-end-re)
583 (setq w (char-after (point)))
588 (setq w (char-after (point)))
600 (not (eq ?_ (char-after (point))))))
604 (goto-char (match-end 0)))
608 (or (not (looking-at (concat "do" ruby-keyword-end-re)))
615 (setq w (char-after (point)))
619 (setq w (char-after (point)))
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)
678 ruby-indent-point t)
680 (setq in-string (match-end 0))
681 (goto-char ruby-indent-point)))
684 (buffer-substring (point) pnt)
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))))))
711 (let ((ruby-indent-point (point))
713 state bol eol begin op-end
720 (setq parse-start (point)))
723 (setq state (ruby-parse-region parse-start ruby-indent-point))
738 ((let ((s (ruby-parse-region (point) ruby-indent-point)))
761 (setq begin (point))
773 (goto-char ruby-indent-point)
774 (end-of-line)
775 (setq eol (point))
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)
799 (setq bol (point))
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))))
814 (setq state (ruby-parse-region parse-start (point))))
820 (not (eq (point) (nth 3 state)))
822 (goto-char (match-end 0))
826 ;; operator at the end of line
827 (let ((c (char-after (point))))
837 (null (nth 0 (ruby-parse-region (or begin parse-start) (point)))))
838 (or (not (eq ?| (char-after (point))))
853 (setq op-end t)))))
857 (null op-end)
868 (goto-char ruby-indent-point)
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[^_]\\)")
918 (let (start pos done down (orig (point)))
920 (setq down (looking-at (if (< n 0) ruby-block-end-re
928 (re-search-forward "^=end\\>"))
929 ((and (< n 0) (looking-at "^=end\\>"))
947 (let ((eol (point-at-eol)) state next)
949 (setq orig (point))
951 (< (point) eol))
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)))
981 (goto-char (scan-sexps (point) 1)))
983 (not (eq (char-before (point)) ?.))
984 (not (eq (char-before (point)) ?:)))
985 (ruby-end-of-block)
1017 (goto-char (scan-sexps (1+ (point)) -1))
1021 (if (eq (char-before (1- (point))) ?%) (forward-char -2))))
1024 (let ((c (char-to-string (char-before (match-end 0)))))
1043 (if (looking-at ruby-block-end-re)
1054 (end-of-line 0)
1056 (delete-region (point) (progn (skip-chars-backward " \t") (point))))
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."
1079 (push-mark (point))
1080 (ruby-end-of-defun)
1081 (push-mark (point) nil t)
1083 (re-search-backward "^\n" (- (point) 1) t))
1086 "Indent each line in the balanced expression following point syntactically.
1090 (let ((here (point-marker)) start top column (nest t))
1095 (setq start (point) top (current-indentation))
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))))
1249 (parse-partial-sexp (point-min) (or pos (point)))))
1252 (let ((ppss (or ppss (syntax-ppss (point)))))
1277 (let ((old-point (point)) (case-fold-search nil))
1283 (ruby-here-doc-find-end old-point)))
1286 (defun ruby-here-doc-find-end (&optional limit)
1287 "Expects the point to be on a line with one or more heredoc
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))
1312 (point)))))
1321 (defun ruby-here-doc-end-syntax ()
1326 (let ((eol (point)))
1330 (progn (goto-char (match-end 0)) ; And it's the last heredoc on its line...
1346 (setq beg (point))
1348 (if (re-search-forward "^=end\\(\\s \\|$\\)" limit t)
1350 (set-match-data (list beg (point)))
1356 (if (and (re-search-backward "^=\\(begin\\|end\\)\\(\\s \\|$\\)" nil t)
1360 (setq beg (point)))))
1361 (if (and beg (and (re-search-forward "^=\\(begin\\|end\\)\\(\\s \\|$\\)" nil t)
1362 (string= (match-string 1) "end")))
1364 (set-match-data (list beg (point)))
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)