614 Commits

Author SHA1 Message Date
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
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
69a15cf2c1 javascript: Stop using longjmp() and friends
Fixes some memory leaks with malformed or partial files.
2014-12-02 15:02:13 +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
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
e01ae923a1 javascript: Cleanup findCmdTerm() callers a bit
Move the check for unterminated inside `findCmdTerm()` itself and
return it rather than having each caller do it itself.
2014-11-24 02:43:44 +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
f886f7084a Javascript parser: Removed warning of unused variable is_inside_class and cleanUp
git-svn-id: https://svn.code.sf.net/p/ctags/code/trunk@815 c5d04d22-be80-434c-894e-aa346cc9e8e8
2014-11-24 02:00:24 +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
6a0673f4ae TM: Don't allow passing NULL to tm_workspace API 2014-11-08 18:32:41 +01:00
Colomban Wendling
b38f1f99d5 TM: Use gsize everywhere for the memory buffer size 2014-11-08 18:13:13 +01:00
Jiří Techet
f441a121d3 Parse file from buffer only if the file isn't too big
By loading e.g. a huge DB dump into memory we could run out of memory.
Check the size of the file and determine whether to use file parsing
or buffer parsing.

Give up early if LANG_IGNORE set - there's no need to read the file in
this case.
2014-11-06 11:39:40 +01:00
Jiří Techet
0ad85aee04 Fix comment wording 2014-11-05 21:50:07 +01:00