634 Commits

Author SHA1 Message Date
Jiří Techet
0f9b778ae5 Fix division by 0 2014-10-18 21:40:10 +02:00
Jiří Techet
9eefdb0efc Where possible, convert functions to static in TM 2014-10-18 21:40:10 +02:00
Jiří Techet
034ef6d79d Remove the unused (and misleading) tm_tag_free()
It just calls unref() which might not actually free the tag if the refnum
is more than 1.
2014-10-18 21:40:10 +02:00
Jiří Techet
344eca0204 Add #if 0 around unused TM functions and move them to the end of the file
Similarly, add #if TM_DEBUG around various unused debugging functions.

The #if 0 surrounded functions are good candidate for future removal
if decided they are not needed any more.
2014-10-18 21:40:10 +02:00
Jiří Techet
2c09333b6a Remove unused tm_tags_custom_sort() and tm_tags_custom_dedup() and friends 2014-10-18 21:40:10 +02:00
Jiří Techet
4e98021689 Swap the merge arguments if len(small_array) > len(big_array) 2014-10-18 21:40:10 +02:00
Jiří Techet
fe98ea6156 Use the new merge implementation also for global tags 2014-10-18 21:40:10 +02:00
Jiří Techet
0470f45e0c TM: move function descriptions from headers to sources
To make it consistent with the rest of Geany.
2014-10-18 21:40:10 +02:00
Jiří Techet
4903d79dcc TM: use the same format of docstrings as in the rest of Geany 2014-10-18 21:40:10 +02:00
Jiří Techet
74706374eb Remove the unused inactive flag in TM
It is set only when read from a file but it never gets written to the file
with the TRUE value.
2014-10-18 21:40:10 +02:00
Jiří Techet
d686674eca On single file update only merge the file's tags into workspace tags
Since both the file tags and workspace tags are sorted, it is unnecessary
to completely resort the tags for the workspace - instead, remove the
tags belonging to the file from the workspace tags and merge the updated
file's tags into the workspace tags.

The merge is optimized for merging small number of tags into a large array.
For instance, the total number of tags in linux kernel is about 2300000
while the average number of tags per file is about 65 (35000 source files).
Most of the time merge won't be performed so we can avoid expensive
string comparisons and try to make bigger jumps to see if some merge is
needed or not (more details in the source file comments).
2014-10-18 21:40:10 +02:00
Jiří Techet
8c25ff871c Make tm_workspace_update() public 2014-10-18 21:40:10 +02:00
Jiří Techet
52076d19e8 Remove unused tm_file_entry.[ch] 2014-10-18 21:40:10 +02:00
Jiří Techet
26587454b0 Remove TmWorkObject and all the OO related stuff
In addition, rename all functions, parameters, comments etc. mentioning
work_object and remove unnecessary parameters of various functions.
Delete dead code paths.

Also move common functions like tm_get_real_path() from tm_work_object to
tm_source_file.
2014-10-18 21:40:10 +02:00
Jiří Techet
6242d19471 Add all headers to libtagmanager_a_SOURCES in tag manager makefile
So they become part of tarball.
2014-10-12 23:49:52 +02:00
Jiří Techet
dbcf67d449 Define the GEANY_PRIVATE macro for tag manager in makefile.win32 2014-10-12 23:37:00 +02:00
Jiří Techet
6d6dd7444b Fix doxygen warnings
Make documents_array public and accessible by doxygen and describe all
parameters of tm_source_file_new().
2014-10-12 23:33:51 +02:00
Jiří Techet
10a28b4191 Protect private definitions by the GEANY_PRIVATE macro in headers
In addition, this patch defines the GEANY_PRIVATE macro for the tag
manager library where it wasn't defined before, removes 2 tag manager
headers from distribution as they are not needed by plugins and
in the tag manager changes the docstrings to ordinary comments for
private definitions.
2014-10-09 20:51:32 +02:00
Nick Treleaven
c0a8a1a943 Fix Windows build 2014-10-07 14:50:07 +01:00
Jiří Techet
ce46f8f0b4 Remove unused tm_tagmanager.c 2014-10-05 22:40:15 +02:00
Jiří Techet
4646323878 Remove unused tm_symbol 2014-10-05 22:40:15 +02:00
Jiří Techet
b512aa0368 Remove unused tm_project and all its references in docstrings 2014-10-05 22:40:15 +02:00
Colomban Wendling
b7b34ec451 Rewrite the Txt2tags parser for better conformance and features
This fixes parsing indented titles and titles with embedded delimiter
characters, and adds support for title nesting information.

Syntax: http://txt2tags.org/rules.html

Closes [feature-requests:#690].
2014-08-19 16:11:23 +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
Colomban Wendling
4cfe71a487 Merge branch 'tm/faster-current-tag'
This makes tm_get_current_tag() roughly 4.5 times faster.
2014-08-01 17:34:24 +02:00
Colomban Wendling
257de6597c fortran: Make sure not to index kinds out of bounds
This also makes recent GCC shut up about indexing below the bounds as
it detected the code checked for a negative index yet didn't guard the
actual access.  For now GCC doesn't understand the more comprehensive
check, but it might come back if GCC becomes smart enough.

Anyway, this makes the Assert() more correct, and addition of the
explicit kinds array size makes sure any future kind addition won't
miss its entry.
2014-08-01 16:05:09 +02:00
SiegeLord
5e469dc5ae Rust: Update comment parsing.
Rust now allows CRLF line endings in source files, which doesn't actually
change any lexing here but the comment was wrong.

Also, the hashbang initial comment has a special case where #![ doesn't count
as a comment (but instead an inner attribute that just happens to be on the
first line).
2014-07-29 11:10:14 -04:00
SiegeLord
756344d901 Rust: Parse character literals.
These were omitted by mistake. Caused bugs like '"' being interpreted as a
start/end of a string, '}' as the end of a block etc.
2014-07-29 10:51:36 -04:00
SiegeLord
d96a314a68 Rust: Change/simplify how the string tokens are handled.
Previously, only the string contents were stored in lexerState::token_str (i.e.
not including the delimeters). Now, the delimeters are stored as well, thus
preserving them. This also simplifies the code a bit.

A new function is added to handle the character storage, which is also now
applied for normal identifiers. To that end, the MAX_STRING_LENGTH was boosted
to 256 so that all reasonably sized identifiers may fit.
2014-07-29 09:23:42 -04:00
Colomban Wendling
f6068d0e86 Add a Zephir tag parser
This Zephir parser uses the PHP parser with minor tweaking not to
require the initial PHP open tag and skip function return type hints.
2014-05-15 16:58:04 +02:00
Colomban Wendling
d8aaa59f9a Python: fix parsing of variables assigned to triple quoted strings
Fixes #262.
2014-05-12 21:52:03 +02:00
Colomban Wendling
0e5d699a13 Python: remove a redundant macro 2014-05-12 21:51:59 +02:00
Nick Treleaven
c67caf03a5 Fix unsigned >= 0 comparison warning 2014-04-27 16:39:08 +01:00
SiegeLord
530d047c9d Rust: Skip 'pub' keyword in front of struct fields. 2014-04-01 21:37:03 -04:00
SiegeLord
478534e635 Rust: Allow [] delimeters for macros.
New Rust syntax.
2014-04-01 21:37:03 -04:00
SiegeLord
2bde26b202 Rust: Fix parsing of attributes in structs/enums.
Previously, things like:

struct Foo
{
    #[bar]
    baz: int
}

or

struct Foo
{
    #![bar]
    baz: int
}

would horribly confuse the parser and prevent proper parsing of the rest of the
file.
2014-04-01 21:37:03 -04:00
SiegeLord
52a179dce1 Rust: Fix parsing of function pointer struct fields.
Previously, skipUntil was confused by the -> token.
2014-04-01 21:37:03 -04:00
Colomban Wendling
d8954bbf67 Fortran: add support for "len" and "kind" qualifiers
Test cases contributed by Adam Hirst, thanks.
2014-02-23 20:13:36 +01:00
Colomban Wendling
ed1dc50062 Fortran: allow keywords as names
Allow keywords for names of modules, programs, types, interfaces,
structures and enums.

Test case contributed by Adam Hirst, thanks.
2014-02-23 20:11:00 +01:00
Colomban Wendling
e47d45eb28 Fortran: fix handling of preprocessor directives on the first line
Fix a race initialization leading to incorrect handling of preprocessor
directives on the first input line.

Test case contributed by Adam Hirst, thanks.
2014-02-23 20:10:35 +01:00
Colomban Wendling
ef4c72501e Fortran: generate fake tags for anonymous structures, interfaces and enums
This allows both to show those anonymous elements, as well as giving a
parent to their children, fixing display in the symbols tree.
2014-02-23 20:02:55 +01:00
Colomban Wendling
9520e7f7d7 Fortran: parse Fortran 2003 enums
Allow for not-yet-standard enum naming using `:: name` syntax, see
http://docs.cray.com/books/S-3692-51/html-S-3692-51/z970507905n9123.html

Test cases contributed by Adam Hirst, thanks.
2014-02-23 20:01:30 +01:00
Colomban Wendling
329b2cb401 Fortran: don't generate tags for interface content 2014-02-23 19:38:34 +01:00
Colomban Wendling
f1ce9afadd TM: don't needlessly duplicate array when searching for current tag 2014-02-19 01:10:07 +01:00
Colomban Wendling
c078a13019 TM: simplify match test for current tag 2014-02-19 01:05:37 +01:00
Colomban Wendling
5a67a4f64c Fortran: report interfaces 2014-02-18 19:33:39 +01:00