forked from universal-ctags/ctags
-
Notifications
You must be signed in to change notification settings - Fork 0
/
elixir.ctags
94 lines (87 loc) · 4.76 KB
/
elixir.ctags
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
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# For more information, please refer to <http://unlicense.org>
#
#
# WHEN FIXING A BUG OF THIS PARSER, WORK WITH THE UPSTREAM PROJECT.
#
#
# This file is imported from https://github.com/mmorearty/elixir-ctags
# by Masatake YAMATO <yamato@redhat.com> with some modifications.
# See https://github.com/mmorearty/elixir-ctags/issues/5 and
# https://github.com/universal-ctags/ctags/issues/1758#issuecomment-391692762.
# @dylan-chong and @FredrikAugust realized this u-ctags integration.
#
#
# * Put the original LICENSE file as the header of the .ctags.
# * Use --map= option instead of --langmap because optlib2c doesn't handle
# --langmap option.
# * Define kinds explicitly with --kinddef-<LANG> option.
# * Remove backslashes before double quotes chars in the regex pattern for
# "test".
# * Use singular forms for kind names.
#
--langdef=Elixir
--map-Elixir=+.ex
--map-Elixir=+.exs
--kinddef-Elixir=p,protocol,protocols (defprotocol...)
--kinddef-Elixir=m,module,modules (defmodule ...)
--kinddef-Elixir=f,function,functions (def ...)
--kinddef-Elixir=c,callback,callbacks (defcallback ...)
--kinddef-Elixir=d,delegate,delegates (defdelegate ...)
--kinddef-Elixir=e,exception,exceptions (defexception ...)
--kinddef-Elixir=g,guard,guards (defguard ...)
--kinddef-Elixir=i,implementation,implementations (defimpl ...)
--kinddef-Elixir=a,macro,macros (defmacro ...)
--kinddef-Elixir=o,operator,operators (e.g. "defmacro a <<< b")
--kinddef-Elixir=r,record,records (defrecord...)
--kinddef-Elixir=t,test,tests (test ...)
--kinddef-Elixir=y,type,types (@type ...)
--regex-Elixir=/^[ \t]*defprotocol[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/p/{scope=set}
--regex-Elixir=/^[ \t]*defmodule[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/m/{scope=set}
--regex-Elixir=/^[ \t]*def((p?)|macro(p?))[ \t]+([a-zA-Z0-9_?!]+)[ \t]+([\|\^\/&<>~.=!*+-]{1,3}|and|or|in|(not( +in)?)|when)[ \t]+[a-zA-Z0-9_?!]/\5/o/{scope=ref}{exclusive}
--regex-Elixir=/^[ \t]*def[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/f/{scope=ref}{{. (public) access:}}
--regex-Elixir=/^[ \t]*defp[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/f/{scope=ref}{{. (private) access:}}
--regex-Elixir=/^[ \t]*(@|def)callback[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\2/c/{scope=ref}
--regex-Elixir=/^[ \t]*defdelegate[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/d/{scope=ref}
--regex-Elixir=/^[ \t]*defexception[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/e/{scope=ref}{exclusive}
--regex-Elixir=/^[ \t]*defexception[ \t]+//{exclusive}{{
_scopetop {
dup :kind /module eq {
dup
:name /exception _tag _commit exch scope:
} if
} if
}}
--regex-Elixir=/^[ \t]*defguard[ \t]+(is_[a-zA-Z0-9_?!]+)/\1/g/{scope=ref}{{. (public) access:}}
--regex-Elixir=/^[ \t]*defguardp[ \t]+(is_[a-zA-Z0-9_?!]+)/\1/g/{scope=ref}{{. (private) access:}}
--regex-Elixir=/^[ \t]*defimpl[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/i/{scope=ref}
--regex-Elixir=/^[ \t]*defmacro[ \t]+([a-z_][a-zA-Z0-9_?!]*)(.[^\|\^\/&<>~.=!*+-]+)/\1/a/{scope=ref}{{. (public) access:}}
--regex-Elixir=/^[ \t]*defmacrop[ \t]+([a-z_][a-zA-Z0-9_?!]*)(.[^\|\^\/&<>~.=!*+-]+)/\1/a/{scope=ref}{{. (private) access:}}
--regex-Elixir=/^[ \t]*Record\.defrecord[ \t(]+:([a-zA-Z0-9_]+)(\)?)/\1/r/{scope=ref}{{. (public) access:}}
--regex-Elixir=/^[ \t]*Record\.defrecordp[ \t(]+:([a-zA-Z0-9_]+)(\)?)/\1/r/{scope=ref}{{. (private) access:}}
--regex-Elixir=/^[ \t]*test[ \t(]+"([a-z_][a-zA-Z0-9_?! ]*)"*(\)?)[ \t]*do/\1/t/{scope=ref}
--regex-Elixir=/^[ \t]*@(type|opaque)[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\2/y/{scope=ref}{{. (public) access:}}
--regex-Elixir=/^[ \t]*@typep[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/y/{scope=ref}{{. (private) access:}}