Next: , Previous: , Up: SMIE: 無邪気なインデントエンジン   [Contents][Index]


24.7.1.8 インデントルールの例

以下はインデント関数の例です:

(defun sample-smie-rules (kind token)
  (pcase (cons kind token)
    (`(:elem . basic) sample-indent-basic)
    (`(,_ . ",") (smie-rule-separator kind))
    (`(:after . ":=") sample-indent-basic)
    (`(:before . ,(or `"begin" `"(" `"{"))
     (if (smie-rule-hanging-p) (smie-rule-parent)))
    (`(:before . "if")
     (and (not (smie-rule-bolp)) (smie-rule-prev-p "else")
          (smie-rule-parent)))))

注意すべき点がいくつかあります:

This page has generated for branch:master, commit:762705fb24fd90db318f2e51c1e762452d26f7e2 to check Japanese translation.