Skip to content

Commit

Permalink
Avoid halting at slashes in Erlang binary bit syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
tjarvstrand committed Feb 9, 2013
1 parent b1d8a9a commit 48be489
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion elisp/edts/ferl.el
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ Should be called with point directly before the opening ( or /."
(setq in-arg t))))
(with-temp-buffer
(set-syntax-table erlang-mode-syntax-table)

;; Avoid halting at slashes inside Erlang binary bit syntax
(modify-syntax-entry ?< "(>")
(modify-syntax-entry ?> ")<")

(save-excursion (insert str))
(skip-chars-forward "[:space:]")
(while (< (point) (point-max))
Expand Down Expand Up @@ -248,7 +253,8 @@ Should be called with point directly before the opening ( or /."
(should (eq 2 (ferl-paren-arity "fun() -> ok end, fun() -> ok end")))
(should (eq 1 (ferl-paren-arity "fun() -> begin%a, b\n ok end end")))
(should (eq 2 (ferl-paren-arity "fun foo/2, Arg")))
)
(should (eq 2 (ferl-paren-arity "a, <<a/b, c/d>>")))
(should (eq 2 (ferl-paren-arity "a, <<a/b,\nc/d>>"))))

(ert-deftest slash-arity-test ()
(should (eq 2 (ferl-slash-arity "/2")))))
Expand Down

0 comments on commit 48be489

Please sign in to comment.