File: highlight.erl

package info (click to toggle)
kate4 4%3A4.14.3-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 33,264 kB
  • ctags: 14,143
  • sloc: xml: 199,778; cpp: 116,560; python: 9,947; ansic: 994; ruby: 397; sh: 370; asm: 166; makefile: 151; php: 137; jsp: 128; haskell: 116; f90: 99; ml: 75; perl: 63; erlang: 54; sed: 48; awk: 40; yacc: 37; tcl: 29; lisp: 24
file content (68 lines) | stat: -rw-r--r-- 2,259 bytes parent folder | download | duplicates (21)
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
% testing for the erlang syntax highlighter
% NOTE alerts work in comments to TODO !

% pragmas (show as keywords)
-module
-export
-define
-undef
-ifdef
-ifndef
-else
-endif
-include
-include_lib

% key words
after begin case catch cond  end fun if let of query receive all_true some_true 

% operators
div rem or xor bor bxor bsl bsr and band not bnot
+ - * / == /= =:= =/= < =< > >= ++ -- = ! <-

% separators (show as functions)
( ) { } [ ] . : | || ; , ? -> #

% functions - predefined (part of erlang module) - show as functions
abs accept alarm apply atom_to_list binary_to_list binary_to_term check_process_code
concat_binary date delete_module disconnect_node element erase exit float float_to_list
garbage_collect get get_keys group_leader halt hd integer_to_list is_alive is_atom is_binary
is_boolean is_float is_function is_integer is_list is_number is_pid is_port is_process_alive
is_record is_reference is_tuple length link list_to_atom list_to_binary list_to_float list_to_integer
list_to_pid list_to_tuple load_module loaded localtime make_ref module_loaded node nodes now
open_port pid_to_list port_close port_command port_connect port_control ports pre_loaded process_flag
process_info processes purge_module put register registered round self setelement size
spawn spawn_link spawn_opt split_binary statistics term_to_binary throw time tl trunc tuple_to_list
unlink unregister whereis

% functions - inferred
module:function
function()

% atoms (show as "char")
% begin with underscore, lowercase, contain numbers letters and @ - or anything between ''
middle_underscore
abc ab4d a@cd8 a@
'And this is (\012) an atom \' Atoo' Variable 'atom again' 

% variables (begin with capital letter or underscore, contain numbers, letters and @)
_leadingUnderscore AbdD@ B45@c

% this is a string 
"a string sits between \" double quotes" atom "more string"

% integers (decimal)
1. 234 $A

% integers (specified base)
2#10101 34#567

% float
12.23 12.9e-67 12.8E+89 33.34e89

% and finally some real code, so we can see what it looks like...
-module(codetest).			% everything is in a module
-export([fac/1]).		% name and number of arguments - need this to be called outside of the module

fac(N) when N > 0  -> N * fac(N-1);
fac(N) when N == 0 -> 1.