forked from syohex/elixir-mode
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.ex
More file actions
46 lines (31 loc) · 626 Bytes
/
test.ex
File metadata and controls
46 lines (31 loc) · 626 Bytes
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
# Test for elixir-mode
# This is a single line comment.
defmodule Hello do
def hello(person) do
"Hello, " + person + "."
end
end
# Defining a variable
answer = 42
# Functions
sum = fn(x, y) -> x + y end
difference = fn(x, y) do
x - y
end
# Erlang builtins
Erlang.is_atom(true)
# If elixir-mode-higlight-operators is enabled, these will be colored.
lotsofoperators = ((((4 + 4) div 2) * 3 - 4) rem 5 / 2).to_s
!false #%=> true
true && true #%=> true
true || false #%=> true
# Here are some atoms
true
false
nil
'foo
'bar
# Here are some regular expressions
%r("[ \n\t]")
# Some modules
File.name("aa")