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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -