Skip to content

Commit

Permalink
add keyword pairs for ocaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Khady committed Aug 12, 2018
1 parent 5014344 commit 1c20d6f
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion smartparens-ml.el
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,48 @@
(sp-local-pair "`" nil :actions nil)
;; Disable ' because it is used in value names and types
(sp-local-pair "'" nil :actions nil)
(sp-local-pair "(*" "*)" ))
(sp-local-pair "(*" "*)" )
;; Because we want to support strings like {| { |}, this pair has to
;; be disabled in strings. Is this behavior complete? It has to
;; detect correctly the matching pairs when using the {id| |id}
;; syntax.
(sp-local-pair "{" "}" :unless '(sp-in-string-p))
(sp-local-pair "if" "then"
:when '(("SPC"))
:unless '(sp-in-comment-p sp-in-string-p)
:post-handlers '(sp-latex-insert-spaces-inside-pair))
(sp-local-pair "while" "done"
:when '(("SPC"))
:unless '(sp-in-comment-p sp-in-string-p)
:post-handlers '(sp-latex-insert-spaces-inside-pair))
(sp-local-pair "for" "done"
:when '(("SPC"))
:unless '(sp-in-comment-p sp-in-string-p)
:post-handlers '(sp-latex-insert-spaces-inside-pair))
(sp-local-pair "begin" "end"
:when '(("SPC"))
:unless '(sp-in-comment-p sp-in-string-p)
:post-handlers '(sp-latex-insert-spaces-inside-pair))
(sp-local-pair "struct" "end"
:when '(("SPC"))
:unless '(sp-in-comment-p sp-in-string-p)
:post-handlers '(sp-latex-insert-spaces-inside-pair))
(sp-local-pair "sig" "end"
:when '(("SPC"))
:unless '(sp-in-comment-p sp-in-string-p)
:post-handlers '(sp-latex-insert-spaces-inside-pair))
(sp-local-pair "object" "end"
:when '(("SPC"))
:unless '(sp-in-comment-p sp-in-string-p)
:post-handlers '(sp-latex-insert-spaces-inside-pair))
(sp-local-pair "match" "with"
:when '(("SPC"))
:unless '(sp-in-comment-p sp-in-string-p)
:post-handlers '(sp-latex-insert-spaces-inside-pair))
(sp-local-pair "try" "with"
:when '(("SPC"))
:unless '(sp-in-comment-p sp-in-string-p)
:post-handlers '(sp-latex-insert-spaces-inside-pair)))

(sp-with-modes '(reason-mode)
;; Disable ` because it is used in polymorphic variants
Expand Down

0 comments on commit 1c20d6f

Please sign in to comment.