Function: web-mode-razor-skip

web-mode-razor-skip is a natively compiled function defined in web-mode.el.

Signature

(web-mode-razor-skip POS)

Source Code

;; Defined in /nix/store/2qgnz1rp30nzfz6w0apx4kdm14if1bbs-emacs-packages-deps/share/emacs/site-lisp/elpa/web-mode-20260831.219/web-mode.el
(defun web-mode-razor-skip (pos)
  (goto-char pos)
  (let ((continue t) (i 0))
    (while continue
      (skip-chars-forward " =@a-zA-Z0-9_-")
      (cond
        ((> (setq i (1+ i)) 500)
         (message "razor-skip ** warning **")
         (setq continue nil))
        ((and (eq (char-after) ?\*)
              (eq (char-before) ?@))
         (when (not (search-forward "*@" nil t))
           (setq continue nil))
         )
        ((looking-at-p "@[({]")
         (forward-char)
         (when (setq pos (web-mode-closing-paren-position (point)))
           (goto-char pos))
         (forward-char)
         )
        ((and (not (eobp)) (eq ?\( (char-after)))
         (cond
           ((looking-at-p "[ \n]*[<@]")
            (setq continue nil))
           ((setq pos (web-mode-closing-paren-position))
            (goto-char pos)
            (forward-char))
           (t
            (forward-char))
           ) ;cond
         )
        ((and (not (eobp)) (eq ?\< (char-after)) (looking-back "[a-z]" (point-min)))
         (setq pos (point))
         (cond
           ;; #988
           ((search-forward ">" (line-end-position) t)
            (goto-char pos)
            (setq continue nil)
            )
           (t
            (setq continue nil))
           ) ;cond
         )
        ((and (not (eobp)) (eq ?\. (char-after)))
         (forward-char))
        ((and (not (eobp)) (looking-at-p "[ \n]*else"))
         (re-search-forward "[ \t]*else")
         )
        ((looking-at-p "[ \n]*{")
         (search-forward "{")
         (search-forward "=>" (line-end-position) 't)
         (if (looking-at-p "[ \n]*[<@]")
             (setq continue nil)
             (backward-char)
             (when (setq pos (web-mode-closing-paren-position))
               (goto-char pos))
             (forward-char)
             ) ;if
         )
        ((looking-at-p "}")
         (forward-char))
        (t
         (setq continue nil))
        ) ;cond
      ) ;while
    ))