153 Commits

Author SHA1 Message Date
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
Colomban Wendling
ef8c40f1e4 javascript: Add support for the const keyword
`const` is not yet part of the current ECMAScript standard but is
part of the ECMAScript 6 draft and is supported by popular engines
including Mozilla and WebKit, and people already use it.

See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const
2014-11-24 02:59:08 +01:00
Colomban Wendling
b85d754610 javascript: Improve support for unterminated statements
Add support for implicit semicolons so many unterminated statements'
end are properly recognized.

The implementation doesn't follow the ECMAScript standard because doing
so requires to recognize precise grammar of all constructs, and the
parser doesn't currently work this way.  So instead it uses some
heuristics that should work most of the time and only consider implicit
semicolons where they would be explicitly relevant to avoid most false-
positives.  See the extensive comment in `readTokenFull()` for details.

In practice, this mostly fixes handling of files using unterminated
variable assignations like the following:

    var v1 = 0
    var v2 = 1
    // ...
    function f1() {
        // ...
    }

In such situations the parser used not to be able to really tell where
the variable assignation would end and would not recognize any
statement before the next semicolon or closing curly brace at the same
level.  In practice, it wouldn't have emitted any tag for this example,
not even `v1` as it generates tags when reaching the statement's end.
2014-11-24 02:57:38 +01:00
Colomban Wendling
f2b368e2cc javascript: Report function signature 2014-11-24 02:55:44 +01:00
Colomban Wendling
f65dec49e7 javascript: Fix more handling of class-related unterminated statements 2014-11-24 02:48:55 +01:00
Colomban Wendling
9c84a91bb3 javascript: Fix scope inside nested blocks (if/else/while/for/etc.) 2014-11-24 02:45:22 +01:00
Colomban Wendling
7e6215661e javascript: Fix handling some class-related unterminated statements 2014-11-24 02:43:29 +01:00
Colomban Wendling
5a1a22d930 javascript: Properly handle nested unknown blocks
Properly match open curly braces when parsing a statement not to
possibly get fooled by unexpected nested blocks, e.g. after a
`switch`'s `case` or a label.

This mostly reverts c54c3ad5e815d16e3b48f3c477465627808aadee and
replaces it with a more correct and complete solution.
2014-11-24 02:41:57 +01:00
Colomban Wendling
f158f5d362 javascript: Fix scope after some constructs 2014-11-24 02:41:17 +01:00
dfishburn
c54c3ad5e8 Added new method findMatchingToken() to skip over blocks of code. Updated parseSwitch() to use the new method.
Updated tests/ctags/ui5.ui.controller.js with code that broke the switch statement.

git-svn-id: https://svn.code.sf.net/p/ctags/code/trunk@809 c5d04d22-be80-434c-894e-aa346cc9e8e8
2014-11-24 01:48:04 +01:00
dfishburn
52d2d73527 Udated jscript to be able to parse SAPUI5 controller and view files.
Added test case tests/ctags/ui5.controller.js

git-svn-id: https://svn.code.sf.net/p/ctags/code/trunk@808 c5d04d22-be80-434c-894e-aa346cc9e8e8
2014-11-24 01:39:36 +01:00
Colomban Wendling
f765463af0 Import new CSS parser from fishman-ctags
Some highlights:
* Fixes handling of comments
* Adds support for attribute and namespace selectors
* Adds support for @supports blocks
* Fixes tag type for many selectors
* Adds support for pseudo-classes with arguments
2014-11-11 02:01:41 +01:00
Colomban Wendling
2072797283 Import CSS test cases from fishman-ctags 2014-11-11 01:59:12 +01:00
Colomban Wendling
0ed236db30 TM: Fix some test results after sort changes from 90944c77 2014-11-08 18:13:13 +01:00
Colomban Wendling
72897bac7d Add a Txt2tags test case for titles
This is simply extracted from the rules.t2t test, but with unique title
content as the tagmanager removes duplicate tags in tags files.
2014-08-19 16:46:20 +02:00
Colomban Wendling
a1466f656f Add a Txt2tags test case
From the official docs:
https://txt2tags.googlecode.com/svn/trunk/samples/sample.t2t
2014-08-19 16:34:21 +02:00
Colomban Wendling
e587038dea Add a Txt2tags test case
From the official docs:
https://txt2tags.googlecode.com/svn/trunk/doc/English/rules.t2t
2014-08-19 16:24:48 +02:00
Colomban Wendling
8341228ffa JavaScript: fix handling of parentheses around an rvalue
Properly skip parentheses around an rvalue, and then properly recognize
the surrounded value.  This allows to properly recognize e.g. rvalue
`({...})` as an object, or `(function(){})` as a function.  As the
implementation is tolerant regarding garbage after the statement,
function expressions called straight away (`(function(){})()`) are
implicitly supported.

This however removes support for the following invalid JavaScript
syntax that was previously supported as a function/method declaration:

	var func = () {}

This syntax is not present in the ECMA standard nor is supported by
popular JavaScript engines.

See:
 * http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
   section 13, "Function Definition"
 * http://ecma262-5.com/ELS5_HTML.htm#Section_13
 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions_and_function_scope#Defining_functions
2014-08-04 00:23:13 +02:00
Colomban Wendling
35e8fbbe28 JavaScript: fix handling of various missing semicolons in loops 2014-08-03 23:24:33 +02:00
Colomban Wendling
3ff01aeeb3 JavaScript: recognize assignation to a parenthesized expression 2014-08-03 19:07:59 +02:00
Colomban Wendling
b596aa14e8 JavaScript: don't choke when returning object literals 2014-08-03 16:57:26 +02:00
Colomban Wendling
bc9b2fa444 JavaScript: don't choke on array lists 2014-08-03 16:52:11 +02:00
SiegeLord
58f0a20bcc Rust: Update test sources to be valid Rust code. 2014-07-29 11:20:56 -04:00
SiegeLord
d9e569398a Rust: Add new comment handling test. 2014-07-29 11:14:34 -04:00
SiegeLord
cf9385c6d4 Rust: Add test for character literals. 2014-07-29 10:55:15 -04:00