emacs - How to define multiple character parenthesis in SMIE -
i copied the code in gnu manual smie. indent of begin , end works fine.
(defvar sample-smie-grammar (smie-prec2->grammar (smie-bnf->prec2 '((id) (inst ("begin" insts "end") ("if" exp "then" inst "else" inst) (id ":=" exp) (exp)) (insts (insts ";" insts) (inst)) (exp (exp "+" exp) (exp "*" exp) ("(" exps ")")) (exps (exps "," exps) (exp))) '((assoc ";")) '((assoc ",")) '((assoc "+") (assoc "*"))))) but when try add class/endclass, module/endmodule below, new added pairs not indent @ all. when enable show-paren-mode. not highlighted begin , end does.
(defvar sample-smie-grammar (smie-prec2->grammar (smie-bnf->prec2 '((id) (inst ("begin" insts "end") ("module" insts "endmodule") ("class" insts "endclass") ("if" exp "then" inst "else" inst) (id ":=" exp) (exp)) (insts (insts ";" insts) (inst)) (exp (exp "+" exp) (exp "*" exp) ("(" exps ")")) (exps (exps "," exps) (exp))) '((assoc ";")) '((assoc ",")) '((assoc "+") (assoc "*")))))
Comments
Post a Comment