Function: octave-smie-rules

octave-smie-rules is a byte-compiled function defined in octave.el.gz.

Signature

(octave-smie-rules KIND TOKEN)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/octave.el.gz
(defun octave-smie-rules (kind token)
  (pcase (cons kind token)
    ;; We could set smie-indent-basic instead, but that would have two
    ;; disadvantages:
    ;; - changes to octave-block-offset wouldn't take effect immediately.
    ;; - edebug wouldn't show the use of this variable.
    ('(:elem . basic) octave-block-offset)
    (`(:list-intro . ,(or "global" "persistent")) t)
    ;; Since "case" is in the same BNF rules as switch..end, SMIE by default
    ;; aligns it with "switch".
    ('(:before . "case") (if (not (smie-rule-sibling-p)) octave-block-offset))
    ('(:after . ";")
     (if (apply #'smie-rule-parent-p octave--block-offset-keywords)
         (smie-rule-parent octave-block-offset)
       ;; For (invalid) code between switch and case.
       ;; (if (smie-rule-parent-p "switch") 4)
       nil))
    ('(:after . "=") (smie-rule-parent octave-block-offset))))