496 Commits

Author SHA1 Message Date
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
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
Colomban Wendling
dd7c20a194 python: Improve access reporting
See:
* http://www.python.org/dev/peps/pep-0008/#method-names-and-instance-variables
* http://www.python.org/dev/peps/pep-0008/#designing-for-inheritance
2014-01-09 15:50:25 +01:00
Colomban Wendling
5412f73d02 python: Don't duplicate the kind names 2014-01-09 02:12:44 +01:00
Colomban Wendling
a7884ee2f8 JavaScript: fix parsing of files starting with a shebang
Closes #1016.
2013-12-24 19:30:04 +01:00
Colomban Wendling
10893c4ada R: fix invalid memory access in the tag parser 2013-11-20 18:40:22 +01:00
Colomban Wendling
cebc20a47c Use proper argument list 2013-11-11 18:54:08 +01:00
Colomban Wendling
bbc0fa3b69 Don't depend on an implementation detail of S_ISREG and S_ISDIR 2013-11-11 18:52:45 +01:00
Colomban Wendling
1f2279aefe Always use proper functions argument lists 2013-11-10 01:43:10 +01:00
Colomban Wendling
6e46cca735 Fix mismatching allocation and deallocation
When allocation with g_malloc(), the memory should be freed using
g_free(), not plain free().

Also, use g_try_malloc() instead of g_malloc() where the code carefully
handles allocation failures itself.
2013-11-03 01:52:27 +01:00
Enrico Tröger
3443e288fe Add flag to tm_tags_find() to indicate the tags array may not be sorted
tm_tags_find() relies on a sorted tags array to be passed in but in
tm_source_file_set_tag_arglist() we don't have a sorted array yet and
sorting it on demand seems more heavy than the alternative:
make tm_tags_find() search the array linear if the new flag is set.

This fixes a bug in the Python parser when assigning the argument list
of __init__() methods to their class' argument list which annoyed me
for years already.

Also add a test case for this.
2013-10-13 18:52:56 +02:00
Colomban Wendling
8f11c62dc9 Fix some module-specific globals not declared static
This prevents the symbol to be exported and possibly conflict with
another one.
2013-09-24 16:26:57 +02:00
Colomban Wendling
32b971cf1c JavaScript: fix parsing of regular expressions in a return statement 2013-09-23 16:52:55 +02:00
Colomban Wendling
6063e077c3 PHP: Recognize vertical tab (\v) and form-feed (\f) as whitespaces
Even though PHP doesn't handle those very well (it emits warnings about
"unexpected character"), it still counts them as whitespaces, so
properly handle them as such.
2013-08-15 14:51:28 +02:00
Nick Treleaven
0998f1c19c Make code more readable by renaming poorly named macros NZV and NVL
Closes #159
2013-08-14 21:54:20 -07:00
Nick Treleaven
cba7fcfe95 Fix full hashing on 64-bit platforms 2013-08-12 15:18:20 +01:00
Nick Treleaven
0c7cf8df10 Fix gcc warning 'cast to pointer from integer of different size' 2013-08-11 14:31:30 +01:00
Colomban Wendling
cc9e56e9bc PHP: Fix parsing of anonymous functions using the "use" keyword
http://www.php.net/manual/en/language.namespaces.php#104136
2013-08-08 17:27:25 +02:00
Colomban Wendling
fb7bd34592 PHP: Fix parsing of anonymous functions returning a reference 2013-08-08 17:27:25 +02:00
Colomban Wendling
e0ef859c7f Verilog: Fix parsing initializers
Import upstream CTags fix for parsing Verilog initalizers
(fixes parsing of test bug2747828.v).
2013-07-19 17:17:55 +02:00
Colomban Wendling
c7e0fba6ca ObjectiveC: Fix re-parsing
Import upstream CTags fix for proper reinitialization of the ObjectiveC
parser, fixing parsing after the first call.
2013-07-19 17:17:55 +02:00
Colomban Wendling
b016e132fd Java: Report enums and fix parsing them 2013-07-15 17:42:00 +02:00
Alexander Eberspächer
e6878e5cbf Fix ctags for complex Cython type declarations
Cython allows the use NumPy arrays on a C level. In that context, a
typical return type declaration could be e.g. "cpdef
numpy.ndarray[dtype=double, ndim=1] name". This now generates a tag for
the function. Previously, the equal sign prevented that.
2013-07-15 10:06:37 +02:00
Colomban Wendling
66396e7ca7 PHP: Fix infinite loop reading an identifier ending at EOF
Bit-wise operation is inappropriate here because `c` might be negative,
since EOF is generally represented as -1.  Since -1 is stored as all
bits at 1 on most common architectures, the test will evaluate to true,
hence entering an infinite loop.
2013-07-15 00:59:56 +02:00
Colomban Wendling
b39f90c94d C++11, C#: Fix parsing of enums with a base type inside classes 2013-07-14 20:34:44 +02:00
Colomban Wendling
af5dfba9d8 C#: Correctly parse enums with a base type specifier
See CSharp Language Specification 14.1.
2013-07-14 03:12:22 +02:00
Colomban Wendling
ad37ced1c2 PHP: recognize PHP 5.5 keywords finally and yield as such 2013-07-03 19:26:23 +02:00