580 Commits

Author SHA1 Message Date
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
Colomban Wendling
9b1890b605 PHP: add support for "<script language=php>" open and close tags
http://www.php.net/manual/en/language.basic-syntax.phptags.php
2013-07-03 19:26:23 +02:00
Colomban Wendling
e3fad4a745 Merge branch 'master' into wip/better-php-parser 2013-07-03 19:26:06 +02:00
Colomban Wendling
d1f2005738 Merge branch 'sql-parser-update' 2013-06-26 16:37:12 +02:00
Colomban Wendling
08fe915ce8 SQL: report scope as such, not as part of the tag name 2013-06-26 16:33:35 +02:00
Alexander Eberspächer
194ef6010d Tagmanger: recognize Fortran procedure pointers as variables
Add a keyword for procedure pointers and treat declarations such as
'procedure(subprogram_to_point_to), pointer :: my_pointer' just like
declarations of a real or integer variable.
2013-06-24 23:00:10 +02:00
Alexander Eberspächer
2f31f7477b Fix tag generation for Fortran with 'forall' blocks
* Add 'forall' as a keyword
* Add a check that allows 'forall' as a secondary keyword in
  'end' statements.
2013-06-24 22:50:11 +02:00
Colomban Wendling
8b11f9b0ef SQL: generalize support for SQL Server square brackets quoting
This fixes test case tests/ctags/bug1944150.sql.
2013-06-24 20:27:22 +02:00
Colomban Wendling
76a7d3c902 SQL: Update parser from upstream CTags 2013-06-24 18:04:46 +02:00
elextr
fa0f92def2 Prevent C++ static_assert from stopping parsing
For some conditions static_assert was stopping further parsing.
For example:
static_assert(a<1,"too small");
would stop all further parsing.  Now static_assert is recognised
and content of the parens is ignored.
2013-06-23 17:31:20 +10:00
Braden Walters
8c10f6a90d Parse Java annotations with parameters
Closes #924.
2013-06-08 03:29:40 +02:00
elextr
2fdcad6290 Allow Javascript new operator to apply to any object constructor
js.c only allowed keywords 'function' 'Function' or 'Object' after
'new' but js syntax allows any constructor function:

var name = new constructor_function( args );

ie an identifier where js.c allowed only keywords.
So changed js.c to allow any identifier as well as the keywords.
2013-06-06 13:10:06 +10:00
elextr
5c37ca87f0 Fix Asciidoc parser recognition of open block as underline
Asciidoc overloads lines of dash (-) for heading underline and
open block delimiting (--).  This made the parser recognise list
continuation blocks as headings.  Now requires more than two
underline characters for a heading.
2013-04-30 14:07:22 +10:00
Colomban Wendling
c986eeee99 PHP: show namespaces and traits in the symbol list 2013-04-17 17:07:47 +02:00
Colomban Wendling
8b3142ef4d PHP: use "::" as the scope separator 2013-04-17 17:07:18 +02:00
Colomban Wendling
33c84f739d PHP: parse traits
http://www.php.net/manual/en/language.oop5.traits.php
2013-04-15 19:17:57 +02:00
Colomban Wendling
77c45aa82b PHP: support non-ASCII characters in identifiers
http://www.php.net/manual/en/language.variables.basics.php
2013-04-15 19:17:57 +02:00