671 Commits

Author SHA1 Message Date
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
Colomban Wendling
29336ffed0 Fortran: display components 2014-02-18 19:11:47 +01:00
Colomban Wendling
362a5cc654 Fortran: properly report scope for programs, subroutines and types
To do this we change the internal types to only use types matched by
symbols_get_current_scope().  This is a bit of a hack, but the tag
types were already questionable and simply mapped to ones the
TagManager know.

This however merges Functions and Subroutines under the same top-level
item in the symbol list.
2014-02-18 19:04:37 +01:00
Colomban Wendling
7d76063282 Fortran: fix handling of pointer association operator
Test case contributed by Adam Hirst, thanks.

Closes #1030.
2014-02-17 23:17:35 +01:00
Adam Hirst
1c0fa99e1d Support F2003 array syntax and F2008 coarrays
Fortran 2003 allows '[' and ']' as array constructors in addition to
the legacy '(/' and '/)'. Fortran 2008 allows '[]' as part of a
CODIMENSION specifier, which can either be `codimension[]` in
the type-spec; or as either `variable[]` or `variable()[]` in
the entry-spec.

Credit to Colomban Wendling for the skipOverSquares logic, and
treating `codimension` as a special-case.

Last part of bug #1023.
2014-02-15 15:48:31 +01:00
Colomban Wendling
497bfaed46 Fortran: fix line continuation inside comments
Fix improperly handling '&' at the end of the first comment line after
a non-comment line as a line continuation.

Part of bug #1023.
2014-02-15 00:33:05 +01:00
Adam Hirst
2085e8a57c Symbol browser breaks with END ASSOCIATE
Related to bug #1023.
2014-02-14 19:30:24 +01:00
Enrico Tröger
3d9908df8c Set tag kind for Python imports to externvar and map them in the symbol list.
This fixes 'Go to Tag definition' for parsed Python imports as before the import
statement was chosen as the definition while we prefer the class definition as
target.
2014-02-08 10:26:08 +01:00
Colomban Wendling
6a85a50d21 Replace bare CTags parser ID numbers with an enumeration
Avoid using magic numbers in the source for better readability and
easier maintenance.
2014-01-29 01:34:26 +01:00
Colomban Wendling
d40932ce4d C++: mitigate matching error on generics containing an expression
Mitigate parse error with generics like `foo<X<Y> x;` by avoiding
matching past a semicolon (";") or open curly brace ("{"), which
can't be part of the generic.  This isn't a proper fix, but mitigates
the impact of such constructs.
2014-01-23 14:17:43 +01:00
elextr
f227076dc4 Improve Asciidoc title parsing
1) Prevent parsing titles inside delimited blocks
2) Always detect -- lines as open block delimiters not titles
3) Support single line titles
2014-01-23 21:07:37 +11:00
SiegeLord
3d7ade4e02 Integrate the Rust lexer with the rest of Geany's functionality 2014-01-14 12:50:38 -05:00
Colomban Wendling
ad59468f3e rust: Don't use fileEOF() as it behaves unexpectedly
fileEOF() actually returns TRUE anywhere after the last newline when
using the file*() API, which includes a last line without newline.
This is an implementation detail which makes this function not usable
with the rest of the file*() API.  fileEOF() should actually probably
be called iFileEOF(), but that's outside the scope of this parser.

However, even if fileEOF() did work properly with fileGetc(), the very
last byte in the input would have been omitted because we actually
read ahead by one byte, which means the actual read reaches EOF one
byte before our "current byte" does.

Checking whether we reached EOF by checking whether our current byte
isn't equal to `EOF` fixes it, and isn't worse since it's actually how
fileEOF() is implemented anyway.
2014-01-14 12:50:37 -05:00
SiegeLord
c84eb2c1c9 Add a Rust ctags generator.
Thanks to Colomban Wendling for reviewing and finding and fixing many issues.
2014-01-14 12:50:15 -05:00