638 Commits

Author SHA1 Message Date
Colomban Wendling
95a0d4db7e c++: Properly parse C++11 override and final members
As `override` and `final` aren't real keywords, handle them manually
not to break identifiers of those names.
2015-07-01 12:55:29 +02:00
Colomban Wendling
641863c264 c++: Fix handling of the final contextual keyword
`final` is not a normal keyword, as it only have a special meaning in
some specific context.  So, use a special case instead of a keyword not
to break identifiers of that name.
2015-06-30 23:22:08 +02:00
Colomban Wendling
46a123d6fe python: Fix handling of inline comments
If there was two hashes (#) in an inline comment, only the content
between the two was considered a comment.

X-Universal-CTags-Commit-ID: ee93f5b9f393e76a850cf8c894cc748a62981156
2015-06-25 22:47:32 +02:00
Jiří Techet
6781ab30c5 python: optimize skipEverything()
Most of the time there's no start of a string which means all the 10
strcmp()s are done for every character of the input. This is very expensive:
before this patch this function alone takes 55% of the parser time.
When comparing by character (and avoiding further comparison if the first
character doesn't match), this function takes only 11% of the parser time
so the performance of the parser nearly doubles.

In addition check for the "rb" prefix which is possible in Python 3.

Ported from universal-ctags.
2015-06-25 22:10:32 +02:00
Colomban Wendling
6f60de3656 Merge pull request #514 from techee/linear_tag_remove
Add linear tag remove path for cases where not many files are open
2015-06-15 14:56:07 +02:00
Colomban Wendling
882687ec37 C#: Don't ignore the character following an '@'
The character following an '@' was dropped if it didn't start a string
literal.

This could lead to unexpected problems if '@' was valid in other
situations.

X-Universal-CTags-Commit-ID: 2e62f475af1db08850447de46f56db14ce99d2eb
2015-06-14 18:27:17 +02:00
Colomban Wendling
dbbc042786 c family: Add support for digraphs
See http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf 6.4.6§3.

Note: This is not exactly the upstream Universal CTags commit because
it depends on another change for adding the `enter` label, which was
then included here.

X-Universal-CTags-Commit-ID: 3b3b60c7664a321a31ec87de336fc6bda90c405e
2015-06-14 18:25:38 +02:00
Colomban Wendling
b737f031ca c family: Fix trigraph handling
X-Universal-CTags-Commit-ID: d6d1a0f2b90a600bdec9cd6ba964ee69382743e4
2015-06-14 18:23:29 +02:00
Colomban Wendling
b975c2652d read: Allow to unget up to 3 characters
Some parsers need to unget more than one characters, so add support for
this.

X-Universal-CTags-Commit-ID: 956af0555d3a8ef33304c5ae6ed873f22b4e4284
2015-06-14 17:57:18 +02:00
Jiří Techet
e26c9ba2ce Add linear tag remove path for cases where not many files are open
When tested with 200000 LOC python file (created by making many copies
of scripts/create_py_tags.py), the tm_tags_remove_file_tags() function
takes about 50% of the CPU time when only this file is open. After adding
the linear path to tm_tags_remove_file_tags() it takes just about 2%. See
the comment in the patch for more details.
2015-06-14 17:52:24 +02:00
Colomban Wendling
944bffb967 json: Fix handling of tags containing a dot
X-Universal-CTags-Commit-ID: 7ae28a3d8a7ad5f8a9d6399a4e357fcf19ad2b2e
2015-06-14 17:29:04 +02:00
Colomban Wendling
f30b72d91e vstring: Add vStringTruncate()
Add API to truncate a vString to a certain length. This doesn't support
growing the string, only shrinking it.

X-Universal-CTags-Commit-ID: 4e3d9edf2e7a8a476ff97bc678e71c3919b960f9
2015-06-14 17:25:33 +02:00
Colomban Wendling
d75598cc48 python: Fix resetting scope on anonymous blocks
The previous fix, coming from [CTags bug #1988026], was incorrect if
the parent was not a root-level element, as it checked the level name
(unqualified) against the parent name (qualified).

However, there is no need to check the level name, all what counts is
the indentation level itself: if it's smaller than an existing level,
it ends it.

This fixes [CTags bug #356].

[CTags bug #1988026]: https://sourceforge.net/p/ctags/bugs/227/
[CTags bug #356]: https://sourceforge.net/p/ctags/bugs/356/

X-Universal-CTags-Commit-ID: ab91e6e1ae84b80870a1e8712fc7f3133e4b5542
2015-06-14 17:13:46 +02:00
Jiří Techet
206379a272 Parse return value of go functions
Unfortunately varType is Geany-only so this patch cannot be ported to ctags.

The removal of the extra { read is not the most elegant thing but making
skipType() aware of the argList collection complicates things too much.
2015-05-28 16:27:23 +02:00
Jiří Techet
e433490672 Sync go parser with fishman-ctags
New features include:
* struct/interface detection
* struct member parsing
* function prototype parsing
2015-05-28 16:22:54 +02:00
Jiří Techet
81fb120f50 Fix language check in tm_workspace_find()
The tags_lang variable is set from the first tag in the found array but
the array may actually contain tags from several languages. This may
lead to two things:

1. Goto tag definition goes to a tag from a different filetype
2. Worse, the first tag is from a different language than the current file
and we get a message that no tag was found

Get lang for every tag in the array and rename tags_lang to tag_lang.
2015-05-06 18:37:46 +02:00
Jiří Techet
35bde6c5ad Reload a tag in the sidebar only when it differs from the existing tag
gtk_tree_store_set() becomes very slow when the tree gets bigger
because internally it calls gtk_tree_store_get_path() which counts
all the entries in a linked list of elements at the same tree level
to get the tree path.

Avoid the call of this function when not needed.
2015-05-03 19:36:26 +02:00
Colomban Wendling
04c721c3b4 make: Avoid reading an uninitialized value on empty target names
Fixing this is however only theoretically useful, as:
* no actual code paths can currently lead to it;
* even if the code actually ended up reading the uninitialized value,
  it would still have a fully defined behavior as the result of the
  check is irrelevant in the only case the uninitialized read can
  happen.

Anyway, fix this to avoid any possible bad surprises in the future.
2015-04-20 20:01:18 +02:00
Colomban Wendling
39f359b09a make: Add support for GNU make pattern rules 2015-04-20 19:59:06 +02:00
Colomban Wendling
a11d67bb0b make: Fix handling comments inside rules
A line consisting only of blanks or comments should not end a rule,
even if it doesn't start with a tabulation character.
2015-04-20 19:53:28 +02:00
Colomban Wendling
2d31d8f836 make: Support for combined targets 2015-04-20 19:48:30 +02:00
Colomban Wendling
5bed3b58f3 make: Support for variable expansions in target names 2015-04-20 19:42:38 +02:00
Colomban Wendling
0d60359428 make: Fix incorrectly generating tags for rules content 2015-04-20 19:29:24 +02:00
Enrico Tröger
26a417d04d Fix typo 2015-04-19 16:09:09 +02:00
Colomban Wendling
f3078ebbc6 Merge branch 'kugel-/linkage-cleanup_rebase-for-merge'
This merges PR#429 with only small history cleanup (no code changes),
and ABI bump.

Closes #355, #358 and #429.
2015-04-10 16:54:30 +02:00
Thomas Martitz
1c27e41bfa The mkstemps special case for windows is not necessary 2015-04-10 16:16:19 +02:00
Colomban Wendling
9644fb0ae2 Define GEANY_{EXPORT,API}_SYMBOL from the build system
This makes it easier to define it consistently to what the compiler
and platform supports, and avoids having to include a special header
everywhere, which is some kind of a problem for separate libraries
like TagManager and especially Scintilla.

As we only use these macros from the source and not the headers, it
is fine for it to be defined to a configure-time check from the build
system.

Warning: Although Waf and Windows makefiles are updated they are not
         tested an will probably required tuning.
2015-04-10 16:08:08 +02:00
Colomban Wendling
1bed458ab9 Merge pull request #270 from b4n/zephir-filetype
Zephir filetype
2015-04-09 01:06:57 +02:00
Colomban Wendling
ca02c593e7 Merge pull request #445 from bengtan/erlang-fishman-ctags
Implement Erlang ctags
2015-03-27 14:44:55 +01:00
Beng Tan
36d1db4bc7 Change kind names for Erlang ctags parser
... so the tags will appear in Geany.
2015-03-27 10:56:25 +08:00
Colomban Wendling
9c829aeb3c make: Fix parsing of empty continuation lines 2015-03-16 14:55:50 +01:00
Beng Tan
b0c5d221a5 Implement Erlang ctags.
Using erlang.c from fishman/ctags.
2015-03-15 13:41:23 +08:00
Colomban Wendling
bc013ae9fe Rename LIBGEANY_LIBS to LIBGEANY_LDFLAGS and only use it on libgeany.la
The flags in this variables are used to tune the linker behavior on the
final libgeany (currently set the version information), so should only
used on really linked libraries, not Libtool helper libraries.
2015-03-10 23:16:49 +01:00
Matthew Brush
eb36500ac4 Improve Autotools build system for libgeany
Checks if the compiler supports -fvisibility and the linker supports
-dynamic-list arguments and use them instead of hardcoding. The new
geany-lib.m4 also accomodates future use of Libtool versioning.
2015-03-10 23:10:06 +01:00
Matthew Brush
d33758da92 Move Geany's core into a library (libgeany)
This will allow plugins to link against the core when accessing API
functions, now that the macro/struct/funcptr stuff is gone.

Also convert the helper libraries into Libtool helper libraries as
linking a shared library against static libraries is (apparently) not
portable.
2015-03-10 23:09:46 +01:00
Matthew Brush
2f08670763 Mark all plugin API functions to have "default" (public) visibility
Adds a new header `pluginexport.h` to put the macros in, could be
moved into an existing header (support.h?) by I didn't want to drag
a bunch of existing stuff into the source files for this one macro.

TagManager has relative include, this could be fixed by changing the
include directories for it if it's a problem. Mark the Scintilla
functions exported by re-declaring them in sciwrappers.c with the
attribute to avoid changing upstream Scintilla code.
2015-03-10 22:06:47 +01:00
Colomban Wendling
a8a2d14711 Merge pull request #415 from b4n/json
Add JSON filetype (with tag parser)
2015-02-24 18:08:46 +01:00
Markus Heidelberg
be2b280377 python: do not ignore the character after a skipped string
Regression for the triple start string issue has been introduced in SVN
revision 669 (fishman git a314e11158307db84c0dadb758846b2302fe69cd) on
2008-06-11. In ctags 5.7 it did work, in 5.8 not anymore.
See also http://sourceforge.net/p/ctags/bugs/229/ for the original bug,
which led to the old fix.

The other issue with normal strings in skipEverything() is even older.
2015-02-11 18:28:59 +01:00
Colomban Wendling
99a509de7e python: Fix out of bounds access on unmatched Cython array declaration 2015-02-11 18:22:55 +01:00
Colomban Wendling
0a97439701 python: Improve and generalize access reporting
Anything at the module/file level:
 * _... is protected
 * rest is public
Anything at the class level:
 * __...__ is public (magic method)
 * __... is private
 * _... is protected
 * rest is public
Anything at the function/method level:
 * everything is private

Closes https://github.com/fishman/ctags/issues/216.
2015-02-11 18:21:14 +01:00
Colomban Wendling
270e32327f json: Enable tag parser and adapt test case for Geany 2015-01-31 22:15:18 +01:00
Colomban Wendling
0bd9585704 json: Optimize memory usage by not collecting string values
When a string is not used as an object property the parser doesn't
need to know its value.  Not collecting it into memory lowers memory
consumption and avoids high memory consumption with huge string values.
2015-01-31 22:14:50 +01:00
Colomban Wendling
2ff1386d96 Add new parser for JSON 2015-01-31 22:14:50 +01:00
Jiří Techet
558d21f2f2 Fix clang warning regarding mismatching types
The Option initialization didn't match the struct - there was
an extra initialization of -e parameter and missing initialization
of --etags-include a bit later. This means the initializations of
the fields were shifted by one between these two.
2015-01-20 19:33:06 +01:00
Nick Treleaven
657c7e73be Parse D enum base type & refactor
Merge and extend fishman/ctags enum inheritance parsing for C++, D,
and add simple.d.t/input.d test.
2015-01-14 17:03:26 +00:00
Jiří Techet
c131466a00 Revert "Microoptimization in merge"
This reverts commit cb9e4bbf7446e45365cad2242087f2a766662f20.
2014-12-30 17:09:18 +01:00
Colomban Wendling
29cc8b4d28 d: size_t and wchar_t aren't keywords in D 2014-12-25 16:46:55 +01:00
Colomban Wendling
371301a84d c: Don't parse wchar_t as a keyword 2014-12-25 01:36:27 +01:00
Colomban Wendling
e091a56a18 c, c++: Don't parse size_t as a keyword
This fixes handling of typedefs defining this name.
2014-12-25 01:35:28 +01:00
Jiří Techet
7c22ceacf9 Update the go parser to the latest version from ctags 2014-12-07 22:25:13 +01:00