aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/test/emacs_SUITE_data/highlight
blob: 0719f6516a226cd25239c0e1b36fc447ab8fb589 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
%% -*- Mode: erlang; indent-tabs-mode: nil -*-
%% Copyright Ericsson AB 2017. All Rights Reserved.

%%% Open this file in your editor and manually check the colors of
%%% different types and calls and builtin words

%%% Not everything in these test are set in stone
%%% better indentation rules can be added but by having
%%% these tests we can see what changes in new implementations
%%% and notice when doing unintentional changes


highlighting(X)			  % Function definitions should be highlighted
  when is_integer(X) ->	          % and so should `when' and `is_integer' be
    %% Highlighting
    %% Various characters (we keep an `atom' after to see that highlighting ends)
    $a,atom,			  % Characters should be marked
    "string",atom,		  % and strings
    'asdasd',atom,		  % quote should be atoms??
    'VaV',atom,
    'aVa',atom,
    '\'atom',atom,
    'atom\'',atom,
    'at\'om',atom,
    '#1',atom,

    $", atom,					% atom should be ok
    $', atom,

    "string$", atom,  "string$", atom,  		% currently buggy I know...
    "string\$", atom,   				% workaround for bug above

    "char $in string", atom,

    'atom$', atom,  'atom$', atom,
    'atom\$', atom,

    'char $in atom', atom,

    $[, ${, $\\, atom,
    ?MACRO_1,
    ?MACRO_2(foo),

    %% Numerical constants
    16#DD,					% Should not be highlighted
    32#dd,					% Should not be highlighted
    32#ddAB,				        % Should not be highlighted
    32#101,				        % Should not be highlighted
    32#ABTR,				        % Should not be highlighted

    %% Variables
    Variables = lists:foo(),
    _Variables = lists:foo(),
    AppSpec = Xyz/2,
    Module42 = Xyz(foo, bar),
    Module:foo(),
    _Module:foo(),				%
    FooÅÅ = lists:reverse([tl,hd,tl,hd]),	%  Should highlight FooÅÅ
    _FooÅÅ = 42,				%  Should highlight _FooÅÅ

    %% Bifs
    erlang:registered(),
    registered(),
    hd(tl(tl(hd([a,b,c])))),
    erlang:anything(lists),
    %% Guards
    is_atom(foo), is_float(2.3), is_integer(32), is_number(4323.3),
    is_function(Fun), is_pid(self()),
    not_a_guard:is_list([]),
    %% Other Types

    atom,			  % not (currently) hightlighted
    234234,
    234.43,

    [list, are, not, higlighted],
    {nor, is, tuple},
    ok.