annotate runtime/syntax/erlang.vim @ 5229:1261caf9bc51 v7.4a.040

updated for version 7.4a.040 Problem: Win32: using uninitialized variable. Solution: (Yukihiro Nakadaira)
author Bram Moolenaar <bram@vim.org>
date Wed, 24 Jul 2013 13:49:22 +0200
parents 2b11ac90d9e9
children 42bf9264e64e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
2 " Language: Erlang (http://www.erlang.org)
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
3 " Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
4 " Last Update: 2013-Jun-01
3281
af1e8a1714c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
5 " License: Vim license
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
6 " URL: https://github.com/hcs42/vim-erlang
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
8 " Acknowledgements: This script was originally created by Kresimir Marzic [1].
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
9 " The script was then revamped by Csaba Hoch [2]. During the revamp, the new
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
10 " highlighting style and some code was taken from the Erlang syntax script
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
11 " that is part of vimerl [3], created by Oscar Hellström [4] and improved by
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
12 " Ricardo Catalinas Jiménez [5].
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
13
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
14 " [1]: Kreąimir Marľić (Kresimir Marzic) <kmarzic@fly.srk.fer.hr>
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
15 " [2]: Csaba Hoch <csaba.hoch@gmail.com>
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
16 " [3]: https://github.com/jimenezrick/vimerl
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
17 " [4]: Oscar Hellström <oscar@oscarh.net> (http://oscar.hellstrom.st)
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
18 " [5]: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
19
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
20 " Customization:
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
21 "
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
22 " To use the old highlighting style, add this to your .vimrc:
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
23 "
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
24 " let g:erlang_old_style_highlight = 1
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
25 "
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
26 " To highlight further module attributes, add them to
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
27 " ~/.vim/after/syntax/erlang.vim:
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
28 "
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
29 " syn keyword erlangAttribute myattr1 myattr2 contained
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
30
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
31 " For version 5.x: Clear all syntax items
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
32 " For version 6.x: Quit when a syntax file was already loaded
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
33 if version < 600
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
34 syntax clear
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
35 elseif exists("b:current_syntax")
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
36 finish
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
39 " Case sensitive
3281
af1e8a1714c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
40 syn case match
af1e8a1714c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
41
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
42 if version >= 600
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
43 setlocal iskeyword+=$,@-@
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
44 endif
3281
af1e8a1714c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
45
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
46 " Comments
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
47 syn match erlangComment '%.*$' contains=erlangCommentAnnotation,erlangTodo
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
48 syn match erlangCommentAnnotation ' \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|private\|equiv\|spec\|throws\)' contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
49 syn match erlangCommentAnnotation /`[^']*'/ contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
50 syn keyword erlangTodo TODO FIXME XXX contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
51 syn match erlangShebang '^#!.*'
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
52
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
53 " Numbers (minimum base is 2, maximum is 36.)
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
54 syn match erlangNumberInteger '\<\d\+\>'
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
55 syn match erlangNumberInteger '\<\%([2-9]\|[12]\d\|3[0-6]\)\+#[[:alnum:]]\+\>'
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
56 syn match erlangNumberFloat '\<\d\+\.\d\+\%([eE][+-]\=\d\+\)\=\>'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
58 " Strings, atoms, characters
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
59 syn region erlangString start=/"/ end=/"/ contains=erlangStringModifier
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
60 syn region erlangQuotedAtom start=/'/ end=/'/ contains=erlangQuotedAtomModifier
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
61 syn match erlangStringModifier '\~\a\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
62 syn match erlangQuotedAtomModifier '\~\a\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)' contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
63 syn match erlangModifier '\$\%([^\\]\|\\\%(\o\{1,3}\|x\x\x\|x{\x\+}\|\^.\|.\)\)'
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
64
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
65 " Operators, separators
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
66 syn match erlangOperator '==\|=:=\|/=\|=/=\|<\|=<\|>\|>=\|++\|--\|=\|!\|<-\|+\|-\|\*\|\/'
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
67 syn keyword erlangOperator div rem or xor bor bxor bsl bsr and band not bnot andalso orelse
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
68 syn match erlangBracket '{\|}\|\[\|]\||\|||'
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
69 syn match erlangPipe '|'
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
70 syn match erlangRightArrow '->'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
72 " Atoms, function calls (order is important)
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
73 syn match erlangAtom '\<\l[[:alnum:]_@]*' contains=erlangBoolean
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
74 syn keyword erlangBoolean true false contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
75 syn match erlangLocalFuncCall '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangBIF
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
76 syn match erlangLocalFuncRef '\<\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@='
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
77 syn match erlangGlobalFuncCall '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*(\)\@=' contains=erlangComment
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
78 syn match erlangGlobalFuncRef '\<\%(\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*\.\%(\s\|\n\|%.*\n\)*\)*\a[[:alnum:]_@]*\%(\s\|\n\|%.*\n\)*:\%(\s\|\n\|%.*\n\)*\a[[:alnum:]_@]*\>\%(\%(\s\|\n\|%.*\n\)*/\)\@=' contains=erlangComment
3281
af1e8a1714c2 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
79
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
80 " Variables, macros, records
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
81 syn match erlangVariable '\<[A-Z_][[:alnum:]_@]*'
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
82 syn match erlangMacro '??\=[[:alnum:]_@]\+'
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
83 syn match erlangMacro '\%(-define(\)\@<=[[:alnum:]_@]\+'
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
84 syn match erlangRecord '#\s*\l[[:alnum:]_@]*'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
86 " Bitstrings
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
87 syn match erlangBitType '\%(\/\%(\s\|\n\|%.*\n\)*\)\@<=\%(integer\|float\|binary\|bytes\|bitstring\|bits\|binary\|utf8\|utf16\|utf32\|signed\|unsigned\|big\|little\|native\|unit\)\%(\%(\s\|\n\|%.*\n\)*-\%(\s\|\n\|%.*\n\)*\%(integer\|float\|binary\|bytes\|bitstring\|bits\|binary\|utf8\|utf16\|utf32\|signed\|unsigned\|big\|little\|native\|unit\)\)*' contains=erlangComment
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
88
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
89 " Constants and Directives
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
90 syn match erlangUnknownAttribute '-\%(\s\|\n\|%.*\n\)*\l[[:alnum:]_@]*' contains=erlangComment
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
91 syn match erlangAttribute '-\%(\s\|\n\|%.*\n\)*\%(behaviou\=r\|compile\|export\|file\|import\|module\|author\|copyright\|doc\|vsn\|on_load\|export_type\)' contains=erlangComment
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
92 syn match erlangInclude '-\%(\s\|\n\|%.*\n\)*\%(include\|include_lib\)\>' contains=erlangComment
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
93 syn match erlangRecordDef '-\%(\s\|\n\|%.*\n\)*record\>' contains=erlangComment
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
94 syn match erlangDefine '-\%(\s\|\n\|%.*\n\)*\%(define\|undef\)\>' contains=erlangComment
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
95 syn match erlangPreCondit '-\%(\s\|\n\|%.*\n\)*\%(ifdef\|ifndef\|else\|endif\)\>' contains=erlangComment
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
96 syn match erlangType '-\%(\s\|\n\|%.*\n\)*\%(spec\|type\|opaque\|callback\)\>' contains=erlangComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
98 " Keywords
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
99 syn keyword erlangKeyword after begin case catch cond end fun if let of query
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
100 syn keyword erlangKeyword receive when try
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
102 " Build-in-functions (BIFs)
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
103 syn keyword erlangBIF abs alive apply atom_to_binary atom_to_list contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
104 syn keyword erlangBIF binary_part binary_to_atom contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
105 syn keyword erlangBIF binary_to_existing_atom binary_to_float contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
106 syn keyword erlangBIF binary_to_integer bitstring_to_list contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
107 syn keyword erlangBIF binary_to_list binary_to_term bit_size contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
108 syn keyword erlangBIF byte_size check_old_code check_process_code contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
109 syn keyword erlangBIF concat_binary date delete_module demonitor contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
110 syn keyword erlangBIF disconnect_node element erase error exit contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
111 syn keyword erlangBIF float float_to_binary float_to_list contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
112 syn keyword erlangBIF garbage_collect get get_keys group_leader contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
113 syn keyword erlangBIF halt hd integer_to_binary integer_to_list contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
114 syn keyword erlangBIF iolist_to_binary iolist_size is_alive contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
115 syn keyword erlangBIF is_atom is_binary is_bitstring is_boolean contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
116 syn keyword erlangBIF is_float is_function is_integer is_list contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
117 syn keyword erlangBIF is_number is_pid is_port is_process_alive contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
118 syn keyword erlangBIF is_record is_reference is_tuple length link contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
119 syn keyword erlangBIF list_to_atom list_to_binary contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
120 syn keyword erlangBIF list_to_bitstring list_to_existing_atom contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
121 syn keyword erlangBIF list_to_float list_to_integer list_to_pid contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
122 syn keyword erlangBIF list_to_tuple load_module make_ref max min contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
123 syn keyword erlangBIF module_loaded monitor monitor_node node contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
124 syn keyword erlangBIF nodes now open_port pid_to_list port_close contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
125 syn keyword erlangBIF port_command port_connect pre_loaded contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
126 syn keyword erlangBIF process_flag process_flag process_info contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
127 syn keyword erlangBIF process purge_module put register registered contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
128 syn keyword erlangBIF round self setelement size spawn spawn_link contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
129 syn keyword erlangBIF spawn_monitor spawn_opt split_binary contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
130 syn keyword erlangBIF statistics term_to_binary throw time tl contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
131 syn keyword erlangBIF trunc tuple_size tuple_to_list unlink contained
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
132 syn keyword erlangBIF unregister whereis contained
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
133
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
134 " Sync at the beginning of functions: if this is not used, multiline string
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
135 " are not always recognized, and the indentation script cannot use the
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
136 " "searchpair" (because it would not always skip strings and comments when
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
137 " looking for keywords and opening parens/brackets).
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
138 syn sync match erlangSync grouphere NONE "^[a-z]\s*("
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
139 let b:erlang_syntax_synced = 1
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
140
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
141 " Define the default highlighting. See ":help group-name" for the groups and
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
142 " their colors.
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
143
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
144 let s:old_style = (exists("g:erlang_old_style_highlight") && g:erlang_old_style_highlight == 1)
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
145
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
146 " For version 5.7 and earlier: only when not done already
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
147 " For version 5.8 and later: only when an item doesn't have highlighting yet
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
148 if version >= 508 || !exists("did_erlang_inits")
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
149 if version < 508
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
150 let did_erlang_inits = 1
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
151 command -nargs=+ HiLink hi link <args>
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
152 else
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
153 command -nargs=+ HiLink hi def link <args>
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
154 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
156 " Comments
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
157 HiLink erlangComment Comment
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
158 HiLink erlangCommentAnnotation Special
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
159 HiLink erlangTodo Todo
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
160 HiLink erlangShebang Comment
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
161
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
162 " Numbers
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
163 HiLink erlangNumberInteger Number
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
164 HiLink erlangNumberFloat Float
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
165
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
166 " Strings, atoms, characters
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
167 HiLink erlangString String
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
168
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
169 if s:old_style
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
170 HiLink erlangQuotedAtom Type
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
171 else
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
172 HiLink erlangQuotedAtom String
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
173 endif
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
174
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
175 HiLink erlangStringModifier Special
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
176 HiLink erlangQuotedAtomModifier Special
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
177 HiLink erlangModifier Special
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
179 " Operators, separators
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
180 HiLink erlangOperator Operator
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
181 HiLink erlangRightArrow Operator
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
182 if s:old_style
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
183 HiLink erlangBracket Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
184 HiLink erlangPipe Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
185 else
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
186 HiLink erlangBracket Delimiter
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
187 HiLink erlangPipe Delimiter
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
188 endif
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
189
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
190 " Atoms, functions, variables, macros
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
191 if s:old_style
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
192 HiLink erlangAtom Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
193 HiLink erlangLocalFuncCall Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
194 HiLink erlangLocalFuncRef Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
195 HiLink erlangGlobalFuncCall Function
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
196 HiLink erlangGlobalFuncRef Function
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
197 HiLink erlangVariable Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
198 HiLink erlangMacro Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
199 HiLink erlangRecord Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
200 else
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
201 HiLink erlangAtom String
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
202 HiLink erlangLocalFuncCall Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
203 HiLink erlangLocalFuncRef Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
204 HiLink erlangGlobalFuncCall Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
205 HiLink erlangGlobalFuncRef Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
206 HiLink erlangVariable Identifier
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
207 HiLink erlangMacro Macro
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
208 HiLink erlangRecord Structure
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
209 endif
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
210
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
211 " Bitstrings
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
212 if !s:old_style
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
213 HiLink erlangBitType Type
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
214 endif
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
215
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
216 " Constants and Directives
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
217 if s:old_style
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
218 HiLink erlangAttribute Type
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
219 HiLink erlangMacroDef Type
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
220 HiLink erlangUnknownAttribute Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
221 HiLink erlangInclude Type
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
222 HiLink erlangRecordDef Type
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
223 HiLink erlangDefine Type
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
224 HiLink erlangPreCondit Type
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
225 HiLink erlangType Type
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
226 else
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
227 HiLink erlangAttribute Keyword
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
228 HiLink erlangMacroDef Macro
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
229 HiLink erlangUnknownAttribute Normal
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
230 HiLink erlangInclude Include
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
231 HiLink erlangRecordDef Keyword
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
232 HiLink erlangDefine Define
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
233 HiLink erlangPreCondit PreCondit
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
234 HiLink erlangType Type
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
235 endif
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
236
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
237 " Keywords
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
238 HiLink erlangKeyword Keyword
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
239
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
240 " Build-in-functions (BIFs)
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
241 HiLink erlangBIF Function
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
242
4780
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
243 if s:old_style
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
244 HiLink erlangBoolean Statement
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
245 HiLink erlangExtra Statement
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
246 HiLink erlangSignal Statement
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
247 else
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
248 HiLink erlangBoolean Boolean
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
249 HiLink erlangExtra Statement
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
250 HiLink erlangSignal Statement
2b11ac90d9e9 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 4437
diff changeset
251 endif
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
252
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
253 delcommand HiLink
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 endif
4437
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
255
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
256 let b:current_syntax = "erlang"
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
257
eb6ab7e78925 Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3281
diff changeset
258 " vim: sw=2 et