File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 18
18
19
19
describe 'Guard syntax' do
20
20
it 'guard in function' do
21
- expect ( <<~EOF ) . to include_elixir_syntax ( 'elixirGuardFunction ' , 'is_atom' )
21
+ expect ( <<~EOF ) . to include_elixir_syntax ( 'elixirKeyword ' , 'is_atom' )
22
22
def fun(a) when is_atom(a), do:
23
23
EOF
24
24
end
25
25
26
26
it 'guard in if' do
27
- expect ( <<~EOF ) . to include_elixir_syntax ( 'elixirGuardFunction ' , 'is_atom' )
27
+ expect ( <<~EOF ) . to include_elixir_syntax ( 'elixirKeyword ' , 'is_atom' )
28
28
if is_atom(:atom), do: true
29
29
EOF
30
30
end
31
31
32
32
it 'guard in case' do
33
- expect ( <<~EOF ) . to include_elixir_syntax ( 'elixirGuardFunction ' , 'is_atom' )
33
+ expect ( <<~EOF ) . to include_elixir_syntax ( 'elixirKeyword ' , 'is_atom' )
34
34
case true do
35
35
true when is_atom(:atom) -> true
36
36
end
37
37
EOF
38
38
end
39
39
40
40
it 'guard in case (multiline)' do
41
- expect ( <<~EOF ) . to include_elixir_syntax ( 'elixirGuardFunction ' , 'is_atom' )
41
+ expect ( <<~EOF ) . to include_elixir_syntax ( 'elixirKeyword ' , 'is_atom' )
42
42
case true do
43
43
true when is_boolean(true) and
44
44
is_atom(:atom) -> true
Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ syn match elixirId '\<[_a-zA-Z]\w*[!?]\?\>' contains=elixirUnusedVariable
20
20
21
21
syn match elixirKeyword ' \(\.\)\@ <!\<\( for\| case\| when\| with\| cond\| if\| unless\| try\| receive\| after\| rescue\| catch\| else\| quote\| unquote\| super\| unquote_splicing\)\> :\@ !'
22
22
23
- syn match elixirGuardFunction ' \(\.\)\@ <!\<\( is_atom\| is_binary\| is_bitstring\| is_boolean\| is_float\| is_function\| is_integer\| is_list\| is_map\| is_nil\| is_number\| is_pid\| is_port\| is_reference\| is_tuple\| abs\| binary_part\| bit_size\| byte_size\| div\| elem\| hd\| length\| map_size\| node\| rem\| round\| self\| tl\| trunc\| tuple_size\| band\| bor\| bnot\| bsl\| bsr\| bxor\)\> :\@ !'
24
-
25
23
syn keyword elixirInclude import require alias use
26
24
27
25
syn keyword elixirSelf self
You can’t perform that action at this time.
0 commit comments