127 Commits

Author SHA1 Message Date
Colomban Wendling
e38c7e3b67 Merge pull request #879 from b4n/c/cxx11-raw-strings
c++: Fix parsing of C++11 raw string literals.
2016-02-11 15:26:32 +01:00
Colomban Wendling
748137bd1d C, C++, C#, D: Improve return type and var type recognition
This is far from perfect and contains a lot of guessing.  It showed
good results based on our tests cases, fixing several issues and not
introducing any more issues (admittedly, after working around a subtle
one regarding D static ifs).

Closes #845.
2016-01-26 16:18:11 +01:00
Colomban Wendling
5a279f0bf6 c++: Fix parsing of prefixed C++11 raw string literals
See http://en.cppreference.com/w/cpp/language/string_literal
2016-01-24 17:33:32 +01:00
Colomban Wendling
a14aa908c5 c++: Fix parsing of C++11 raw string literals
See http://en.cppreference.com/w/cpp/language/string_literal

Closes #877.

---

This contains a pretty ugly hack to fetch the previous character, in
order not to get fooled by string concatenation hidden behind a macro,
like in `FOUR"five"`, which is not a raw string literal but simply the
identifier `FOUR` followed by the string `"five"`.

While this may sound uncommon, it is not and lead to complaints [2][3]
when Scintilla [1] broke this when they introduced C++11 raw string
literal support themselves.

The implementation here still contains a bug with line continuations: a
raw literal of the form:

```c
const char *str = R\
"xxx(...)xxx";
```

is not properly recognized as such, although it's perfectly valid (yet
probably very uncommon).  For the record, Scintilla has also suffers
from this but nobody complained about it yet.

[1] http://scintilla.org/
[2] https://sourceforge.net/p/scintilla/bugs/1207/
[3] https://sourceforge.net/p/scintilla/bugs/1454/
2016-01-23 21:52:40 +01:00
Colomban Wendling
1c4a9d8dd3 C++: Fix parsing of global scope qualifiers in base class lists
See also https://sourceforge.net/p/ctags/bugs/194/

I didn't use the exact upstream patch only altering the C++ code path,
because as far as I know no c.c language recognize two consecutive
colons separated by whitespace as a single token, so there's no point
in carrying on mistakes from the past.
2016-01-17 04:03:24 +01:00
Colomban Wendling
440a736018 C++, C#: Properly set scope on namespaces
Closes #871.
2016-01-17 03:30:06 +01:00
Ben Wiederhake
2df9f83bf2 Typos overlooked by codespell 2016-01-03 18:44:00 +01:00
Ben Wiederhake
29a6b9c003 Fix typos
All of these typos were found by codespell, so credits go the
the authors of this incredibly useful tool.

I manually confirmed and adapted all changes, which includes
reflowing over-long lines or filling up with spaces for alignment.

Some of these typos may need forwarding to their original authors.
codespell reported a lot words where I am unsure; I have not
included those corrections.
2016-01-03 18:33:25 +01:00
Colomban Wendling
b2879e9fca tagmanager: Fix handling of scopes starting with a non-ASCII character
Fix handling of scopes starting with a non-ASCII character.

Actually, just drop the check on the first byte of the scope, as it
doesn't seem to serve any purpose as it only checks the first byte (so
isn't any kind of real validation; and as it predates Geany it's
impossible to know the real reason behind this check), and breaks
support for non-ASCII scopes.
2015-10-12 19:20:02 +02:00
Pavel Sountsov
568787bc2f Change Rust tests to be in line with the ones in the universal-ctags tests. 2015-08-21 21:21:18 -07:00
Pavel Sountsov
91ee437640 Parse 'where' bounds correctly. 2015-08-21 21:19:47 -07:00
Pavel Sountsov
6814fc1a62 Update Rust keywords. 2015-08-21 21:17:59 -07:00
Colomban Wendling
96d5eec50f Merge pull request #544 from b4n/cxx11-override
c++: Properly parse C++11 overrides, finals and noexcepts
2015-07-08 18:04:05 +02:00
Enrico Tröger
4017442f86 Merge pull request #477 from eht16/ctags_powershell
Add PowerShell tag parser
2015-07-04 12:52:46 +02:00
Colomban Wendling
4476ed9c4b c++: Add a small test combining various C++14 things 2015-07-01 12:55:52 +02:00
Colomban Wendling
f60b31385e c++: Handle C++11 noexcept 2015-07-01 12:55:52 +02:00
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
Enrico Tröger
8a6fbd9786 Add PowerShell tag parser 2015-06-28 15:46:23 +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
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
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
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
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
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
3e6cea696a Update Erlang ctags test. 2015-03-27 11:03:17 +08:00
Colomban Wendling
9c829aeb3c make: Fix parsing of empty continuation lines 2015-03-16 14:55:50 +01:00
Beng Tan
9721faff62 Add (and fix) ctags unit tests for Erlang. 2015-03-15 15:55:45 +08: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
270e32327f json: Enable tag parser and adapt test case for Geany 2015-01-31 22:15:18 +01:00
Colomban Wendling
2ff1386d96 Add new parser for JSON 2015-01-31 22:14:50 +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
Colomban Wendling
29cc8b4d28 d: size_t and wchar_t aren't keywords in D 2014-12-25 16:46:55 +01:00
Colomban Wendling
43a8986d2c c: Add a test case for size_t and wchar_t handling 2014-12-25 16:45:35 +01:00
Colomban Wendling
f08af8046f Merge branch 'js-update'
Import back JavaScript parser changes from fishman/ctags.
2014-12-02 15:03:20 +01:00
Colomban Wendling
02bc3b3638 javascript: Improve string literals handling
1. Don't include the newline itself in a line continuation construct.
   This fixes generation of e.g. properties with embedded line
   continuations.
2. Don't continue parsing strings past an unescaped newline (as naked
   newlines are invalid inside strings).  This avoids parsing the whole
   remaining file as a string in case of broken input.  It is both
   useful to better support partly written files and to avoid loading a
   whole malformed file in memory while reading it as a string.

See section 7.8.4 "String Literals" of ECMA-262:
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
2014-12-02 15:02:39 +01:00
Colomban Wendling
94aa892c81 Merge pull request #373 from techee/go_ctags
Add a Go ctags parser.
2014-11-30 02:03:00 +01:00
Jiří Techet
ccb15a31be Add the go ctags parser
Make go one of the builtin filetypes, add the parser and update the related
source and config files. While there, remove Rust from [Groups] in
filetype_extensions.conf because it's already a builtin filetype as well.

The parser itself is stolen from the fishman/ctags repo.
2014-11-30 01:35:00 +01:00
Colomban Wendling
af7d63cdf2 Merge pull request #319 from b4n/better-txt2tags-parser
Better txt2tags parser
2014-11-29 23:40:58 +01:00
Colomban Wendling
55b4b867f3 javascript: Don't use invalid syntax in a test case
A regex is not a valid JavaScript property name, and the test case was
not meant to specifically check for handling of invalid syntax but
rather valid regex syntax with embedded quotes.
2014-11-24 03:50:00 +01:00
Colomban Wendling
5793694134 javascript: Add support for the let keyword
`let` is not yet part of the current ECMAScript standard but is part of
the ECMAScript 6 draft and is supported by Mozilla, and people already
use it in some contexts.

Also, the current ECMAScript standard marks `let` as a "considered
reserved word" (7.6.1.2), so it is already a reserved keyword in strict
mode.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let
2014-11-24 03:00:27 +01:00