11c38aecfSMasatake YAMATO# 21c38aecfSMasatake YAMATO# This is free and unencumbered software released into the public domain. 31c38aecfSMasatake YAMATO# 41c38aecfSMasatake YAMATO# Anyone is free to copy, modify, publish, use, compile, sell, or 51c38aecfSMasatake YAMATO# distribute this software, either in source code form or as a compiled 61c38aecfSMasatake YAMATO# binary, for any purpose, commercial or non-commercial, and by any 71c38aecfSMasatake YAMATO# means. 81c38aecfSMasatake YAMATO# 91c38aecfSMasatake YAMATO# In jurisdictions that recognize copyright laws, the author or authors 101c38aecfSMasatake YAMATO# of this software dedicate any and all copyright interest in the 111c38aecfSMasatake YAMATO# software to the public domain. We make this dedication for the benefit 121c38aecfSMasatake YAMATO# of the public at large and to the detriment of our heirs and 131c38aecfSMasatake YAMATO# successors. We intend this dedication to be an overt act of 141c38aecfSMasatake YAMATO# relinquishment in perpetuity of all present and future rights to this 151c38aecfSMasatake YAMATO# software under copyright law. 161c38aecfSMasatake YAMATO# 171c38aecfSMasatake YAMATO# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 181c38aecfSMasatake YAMATO# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 191c38aecfSMasatake YAMATO# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 201c38aecfSMasatake YAMATO# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 211c38aecfSMasatake YAMATO# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 221c38aecfSMasatake YAMATO# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 231c38aecfSMasatake YAMATO# OTHER DEALINGS IN THE SOFTWARE. 241c38aecfSMasatake YAMATO# 251c38aecfSMasatake YAMATO# For more information, please refer to <http://unlicense.org> 261c38aecfSMasatake YAMATO# 271c38aecfSMasatake YAMATO 281c38aecfSMasatake YAMATO# 291c38aecfSMasatake YAMATO# WHEN FIXING A BUG OF THIS PARSER, WORK WITH THE UPSTREAM PROJECT. 301c38aecfSMasatake YAMATO# 311c38aecfSMasatake YAMATO 321c38aecfSMasatake YAMATO# 331c38aecfSMasatake YAMATO# This file is imported from https://github.com/mmorearty/elixir-ctags 341c38aecfSMasatake YAMATO# by Masatake YAMATO <yamato@redhat.com> with some modifications. 351c38aecfSMasatake YAMATO# See https://github.com/mmorearty/elixir-ctags/issues/5 and 361c38aecfSMasatake YAMATO# https://github.com/universal-ctags/ctags/issues/1758#issuecomment-391692762. 371c38aecfSMasatake YAMATO# @dylan-chong and @FredrikAugust realized this u-ctags integration. 381c38aecfSMasatake YAMATO# 391c38aecfSMasatake YAMATO 401c38aecfSMasatake YAMATO# 411c38aecfSMasatake YAMATO# * Put the original LICENSE file as the header of the .ctags. 421c38aecfSMasatake YAMATO# * Use --map= option instead of --langmap because optlib2c doesn't handle 431c38aecfSMasatake YAMATO# --langmap option. 441c38aecfSMasatake YAMATO# * Define kinds explicitly with --kinddef-<LANG> option. 451c38aecfSMasatake YAMATO# * Remove backslashes before double quotes chars in the regex pattern for 461c38aecfSMasatake YAMATO# "test". 471c38aecfSMasatake YAMATO# * Use singular forms for kind names. 481c38aecfSMasatake YAMATO# 491c38aecfSMasatake YAMATO 501c38aecfSMasatake YAMATO--langdef=Elixir 511c38aecfSMasatake YAMATO 521c38aecfSMasatake YAMATO--map-Elixir=+.ex 531c38aecfSMasatake YAMATO--map-Elixir=+.exs 541c38aecfSMasatake YAMATO 552c46f6d4SBryan Enders--kinddef-Elixir=p,protocol,protocols (defprotocol...) 56443b88f2SBryan Enders--kinddef-Elixir=m,module,modules (defmodule ...) 571c38aecfSMasatake YAMATO--kinddef-Elixir=f,function,functions (def ...) 581c38aecfSMasatake YAMATO--kinddef-Elixir=c,callback,callbacks (defcallback ...) 591c38aecfSMasatake YAMATO--kinddef-Elixir=d,delegate,delegates (defdelegate ...) 601c38aecfSMasatake YAMATO--kinddef-Elixir=e,exception,exceptions (defexception ...) 61943eb288SIvan Gonzalez Polanco--kinddef-Elixir=g,guard,guards (defguard ...) 621c38aecfSMasatake YAMATO--kinddef-Elixir=i,implementation,implementations (defimpl ...) 631c38aecfSMasatake YAMATO--kinddef-Elixir=a,macro,macros (defmacro ...) 641c38aecfSMasatake YAMATO--kinddef-Elixir=o,operator,operators (e.g. "defmacro a <<< b") 651c38aecfSMasatake YAMATO--kinddef-Elixir=r,record,records (defrecord...) 661c38aecfSMasatake YAMATO--kinddef-Elixir=t,test,tests (test ...) 675b3505b0SBryan Enders--kinddef-Elixir=y,type,types (@type ...) 681c38aecfSMasatake YAMATO 692c46f6d4SBryan Enders--regex-Elixir=/^[ \t]*defprotocol[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/p/{scope=set} 70443b88f2SBryan Enders--regex-Elixir=/^[ \t]*defmodule[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/m/{scope=set} 71bb84aac2SMasatake YAMATO--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} 720da42576SMasatake YAMATO--regex-Elixir=/^[ \t]*def[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/f/{scope=ref}{{. (public) access:}} 730da42576SMasatake YAMATO--regex-Elixir=/^[ \t]*defp[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/f/{scope=ref}{{. (private) access:}} 74443b88f2SBryan Enders--regex-Elixir=/^[ \t]*(@|def)callback[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\2/c/{scope=ref} 75443b88f2SBryan Enders--regex-Elixir=/^[ \t]*defdelegate[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/d/{scope=ref} 76*bd186360SMasatake YAMATO--regex-Elixir=/^[ \t]*defexception[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/e/{scope=ref}{exclusive} 77*bd186360SMasatake YAMATO--regex-Elixir=/^[ \t]*defexception[ \t]+//{exclusive}{{ 78*bd186360SMasatake YAMATO _scopetop { 79*bd186360SMasatake YAMATO dup :kind /module eq { 80*bd186360SMasatake YAMATO dup 81*bd186360SMasatake YAMATO :name /exception _tag _commit exch scope: 82*bd186360SMasatake YAMATO } if 83*bd186360SMasatake YAMATO } if 84*bd186360SMasatake YAMATO}} 850da42576SMasatake YAMATO--regex-Elixir=/^[ \t]*defguard[ \t]+(is_[a-zA-Z0-9_?!]+)/\1/g/{scope=ref}{{. (public) access:}} 860da42576SMasatake YAMATO--regex-Elixir=/^[ \t]*defguardp[ \t]+(is_[a-zA-Z0-9_?!]+)/\1/g/{scope=ref}{{. (private) access:}} 87443b88f2SBryan Enders--regex-Elixir=/^[ \t]*defimpl[ \t]+([A-Z][a-zA-Z0-9_]*\.)*([A-Z][a-zA-Z0-9_?!]*)/\2/i/{scope=ref} 880da42576SMasatake YAMATO--regex-Elixir=/^[ \t]*defmacro[ \t]+([a-z_][a-zA-Z0-9_?!]*)(.[^\|\^\/&<>~.=!*+-]+)/\1/a/{scope=ref}{{. (public) access:}} 890da42576SMasatake YAMATO--regex-Elixir=/^[ \t]*defmacrop[ \t]+([a-z_][a-zA-Z0-9_?!]*)(.[^\|\^\/&<>~.=!*+-]+)/\1/a/{scope=ref}{{. (private) access:}} 900da42576SMasatake YAMATO--regex-Elixir=/^[ \t]*Record\.defrecord[ \t(]+:([a-zA-Z0-9_]+)(\)?)/\1/r/{scope=ref}{{. (public) access:}} 910da42576SMasatake YAMATO--regex-Elixir=/^[ \t]*Record\.defrecordp[ \t(]+:([a-zA-Z0-9_]+)(\)?)/\1/r/{scope=ref}{{. (private) access:}} 92443b88f2SBryan Enders--regex-Elixir=/^[ \t]*test[ \t(]+"([a-z_][a-zA-Z0-9_?! ]*)"*(\)?)[ \t]*do/\1/t/{scope=ref} 930da42576SMasatake YAMATO--regex-Elixir=/^[ \t]*@(type|opaque)[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\2/y/{scope=ref}{{. (public) access:}} 940da42576SMasatake YAMATO--regex-Elixir=/^[ \t]*@typep[ \t]+([a-z_][a-zA-Z0-9_?!]*)/\1/y/{scope=ref}{{. (private) access:}} 95