forked from amber-lang/amber-vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
keywords.ab
112 lines (104 loc) · 1.22 KB
/
keywords.ab
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// THIS IS NOT A FUNCTIONAL AMBER SCRIPT
// USE TO TEST VIM SYNTAX HIGHLIGHTING
// Shebang line.
#!/usr/bin/env amber
// Compiler flags.
#[allow_generic_return]
// Keywords.
and
as
break
cd
const
continue
echo
else
exit
fail
failed
for
from
fun
if
import
in
is
len
let
lines
loop
main
mv
nameof
not
or
pub
ref
return
silent
status
then
trust
unsafe
failing()? // (highlights `?` only)
__reserved // (highlights `__` and following word)
// Functions; use positive lookahead to match `glob` in `glob(`.
glob() // (highlights `glob` only)
glob // (highlights nothing)
// Data types.
Bool
Null
Num
Text
Bool?
Null?
Num?
Text?
[Bool]
[Null]
[Num]
[Text]
[Bool]?
[Null]?
[Num]?
[Text]?
// Operators.
1 + 2
1 - 2
1 * 2
1 / 2
1 % 2
foo = 3
foo += 3
foo -= 3
foo *= 3
foo /= 3
foo %= 3
foo++
foo--
1 == 2
1 != 2
1 < 2
1 > 2
1 <= 2
1 >= 2
5..10
5..=10
foo and bar
foo or bar
not foo
// Integers, decimals and booleans (must be defined after the operators,
// so the syntax match for negative number `-42` takes precedence over
// the one for subtraction operator `-`).
42
-42
123.45
-123.45
true
false
null
// Strings and commands, with interpolation.
"Simple string"
"With quoted \"word\""
"With interpolated {value}"
$ test -f {file} && cat {file} $