1 %% This file contains Erlang code for testing the
2 %% Erlware emacs mode. It contains functions that
3 %% use different corner cases to make sure the mode
4 %% does the right thing.
6 %% <<If comment-multi-line is on, Press Return to get another %% line>>
12 % This line should stay here after a tab.
13 % If the comment-multi-line variable is non-nil, then pressing
14 % Return at end of this line shouldto get another % line.
18 % Pressing tabs on all lines should not change indents.
26 [$
% | ["should not be highlighted as a comment"]],
30 % If you edit the font lock mode to underline function names,
31 % there should not be an underline character after the '->'.
36 module:somefun(monkey
, horse
)
38 % both these clauses should maintain their indents after tab presses
41 error:function_clause
->
47 % `is_atom' should be highlighted as a guard above
49 % All functions below should be highlighted as functions, not
50 % as guards or bifs. So each entire function name should be
51 % highlighted in the same way.
58 % atom_to_list and element should be highlighted as bifs
59 AppName
= atom_to_list(element(1, AppSpec
)),
61 % These should be highlighted as bifs.
64 hd(tl(tl(hd([a
,b
,c
])))).
66 % `-spec' should be highlighted as an attribute, i.e. the same way as
70 -spec
func6() -> any().
73 % These should be highlighted as atoms
80 % 3 lines below should be highlighted as literals
84 % in line below, V should be highlited as a var
85 V
= fun() -> hello
end,
89 % in line below, Mo and Vv should be highlited as vars
91 % in line below, Mo as var, bla as func call
93 % the ':' should no be highlighted
94 ets:insert(bla
,{'$1',{'$2','$3'}}).
97 % should keep indentation on tab
104 % anatom should be highlighted as an atom, not a string
108 % N.B. A '$' at the end of a string must be escaped, or the
109 % highlighting will not work. This is of course a bug, but I don't
110 % know how to fix it and the workaround is simple.
112 % this comment should be highlighted as a comment
113 % following should be highlighted as a string, should indent on tab
116 func9(Term
, [$
{|T
]) ->
117 % above should be highlighted correctly
118 % all function body lines should not indent further on tab