Skip to content

Conversation

masatake
Copy link
Member

@masatake masatake commented Mar 7, 2019

Rearranged-before-merge PR for #2024.
Some commits are reordered and squashed to make all commits pass "make units".
As a result, the commits don't introduce noise to future git-bisects we will run.

masatake and others added 9 commits March 8, 2019 00:56
Imported from https://github.com/mmorearty/elixir-ctags.
Close universal-ctags#1758.
See also mmorearty/elixir-ctags#5.

The change from the original .ctags.

* 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.

TODO: Test cases for above kinds are needed.

    c  callbacks (defcallback ...)
    d  delegates (defdelegate ...)
    e  exceptions (defexception ...)
    i  implementations (defimpl ...)
    a  macros (defmacro ...)
    o  operators (e.g. "defmacro a <<< b")
    p  protocols (defprotocol...)
    r  records (defrecord...)
I already made a pull request with *detailed commits* to the upstream of
the elixir.ctags parser. Said pull request and commits can be found in
mmorearty/elixir-ctags#8

This parser is missing basically two things which are annotated in the
input.ex test with a TODO keyword, plus an explanation of _why_ they're
missing.  Said missing features are listed bellow:

* exceptions: I don't know how to identificate or differenciate
exceptions from one another because they do not have a name. Instead,
they resemble an struct. For example, if I have:

```
defmodule MyAppError1 do
  defexception [:message]
  # code
end

defmodule MyAppError2 do
  defexception [:message]
  # code
end
```

How would/should ctags differenciate between these two exceptions?

* word-defined logical operators (`and, or, not`): The elixir parser in
this commit already has the regex atom including these logical
operators, but since the regex engine used by universal-ctags does not
have lookahead, I couldn't think of a way to add them or negate them.

The test for them is commented in, for the time someone is brave enough
to add them.
(The commit log is edited by @masatake.)
More info on the bugs can be found in the test cases' `README.md`.
Moved that comment to the README.md of a bugged test case in the Elixir
directory.
Fixes the bug where the parser wouldn't correctly generate tags for the
'word' operators (and, or, not, etc...)
@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 85.243% when pulling ec91b0d on masatake:dreamtigers-elixir-optlib+masatake into 6cecfb9 on universal-ctags:master.

@masatake masatake merged commit 6365358 into universal-ctags:master Mar 7, 2019
This was referenced Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants