510 Commits

Author SHA1 Message Date
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
Colomban Wendling
38c5616200 PHP: leave PHP mode inside single line comments
If "?>" appears in a single-line PHP comment it leaves PHP mode.
http://www.php.net/manual/en/language.basic-syntax.comments.php
2013-04-15 19:17:57 +02:00
Colomban Wendling
387d6e1909 PHP: don't include the leading "$" in variable names 2013-04-15 19:17:57 +02:00
Colomban Wendling
b5cd5343fa PHP: fix parsing functions arguments list containing comment or strings
Instead of hand-parsing the argument list and possibly choking inside
comments, strings, heredoc, etc., use the normal token mechanism and
simply convert the tokens to a string representation as the argument
list.  This technique might perhaps lead to some missing characters in
the argument list representation in the (unlikely) case a token
appearing in the argument list is reported as a generic type for which
it is impossible to know the correct string representation, but this
could always be fixed by adding a specific token type and is anyway
less problematic than maybe breaking further parsing of the document.
2013-04-15 19:17:57 +02:00
Colomban Wendling
444745f71e Added new macro for reading last character of vString.
Import of CTags revision 719.
2013-04-15 19:17:57 +02:00
Colomban Wendling
8086129c9c PHP: parse namespaces
PHP namespaces don't work anything like a block, so the implementation
is specific and not combined with scope management.  Namespaces cannot
be nested, and they may apply either to the rest of the file (until the
next namespace declaration, if any) or to a specific block.

Namespaces applying to the rest of the file:

	namespace Foo;
	/* code in namespace Foo */
	namespace Bar\Baz;
	/* code in namespace Bar\Baz */

Namespaces applying to blocks:

	namespace Foo {
		/* code in namespace Foo */
	}
	namespace Bar\Baz {
		/* code in namespace Bar\Baz */
	}
	namespace {
		/* code in root namespace */
	}
2013-04-15 18:55:52 +02:00
Colomban Wendling
c2e4111aaf PHP: parse HereDoc and NowDoc strings 2013-04-15 18:55:14 +02:00
Colomban Wendling
258c4fa65d PHP: generate tags for local variables (disabled by default) 2013-04-15 18:54:42 +02:00
Colomban Wendling
1c3fd55818 PHP: fix generating variable tags for rvalues
Only generate tags for variable declarations without assignments inside
classes and interfaces not to get fooled by rvalues.

This prevents generation of a "$bar" tag for something like:

	$foo = $bar;

while still generating "$bar" tag for:

	class Foo {
		var $bar;
	}
2013-04-15 18:53:59 +02:00
Colomban Wendling
af47ccf98d PHP: report anonymous functions as functions rather than variables
Generate a full function tag for anonymous functions:

	$anon = function($arg1, $arg2) {
		/* ... */
	};
2013-04-15 18:53:07 +02:00
Colomban Wendling
5798f47ea0 PHP: make some arguments const 2013-04-15 18:52:14 +02:00
Colomban Wendling
bdb98f0132 PHP: fix parsing of functions returning a reference
Fix parsing of functions declarations with a leading ampersand (&),
used to make the function return a reference:

	function &foo($arg1, $arg2) {
		/* ... */
	}
2013-04-15 18:51:26 +02:00
Colomban Wendling
d283eb243c PHP: parse and report interfaces 2013-04-15 18:47:54 +02:00
Colomban Wendling
23339dd509 PHP: report class inheritance 2013-04-15 18:43:22 +02:00
Colomban Wendling
f5d315809d PHP: report visibility and implementation type
Report visibility (private/protected/public) and implementation
(abstract or not) for every tag for which it makes sense.
2013-04-15 18:42:08 +02:00
Colomban Wendling
be07870e97 Rewrite the PHP parser as a non-regex parser
Rewrite the PHP parser as a real parser, not using regexes.  This is
more complex but allows for better parsing.

Visible changes:
* Scope reporting;
* Variables inside functions are no longer reported (this is a
  deliberate choice, but can be easily changed);
* Only the PHP part is parsed (e.g. it doesn't report JavaScript
  functions anymore);
* Function arguments spanning several lines are properly reported;
* Interfaces are not yet parsed.

Otherwise the new parser should behave like the old one, at least
where it used to be right.  Parsing of more constructs and reporting
more details is planned.
2013-04-15 18:36:24 +02:00
Colomban Wendling
d453fe33fe Add support for loading Vi and CTags tag files
This allows to load tag files in the CTags format, which is compatible
with Vi format.

References:
 * http://ctags.sourceforge.net/FORMAT
 * http://ctags.sourceforge.net/ctags.html#TAG%20FILE%20FORMAT
2013-04-03 22:10:33 +02:00
Colomban Wendling
11acb59980 Add code for TMTag reference debugging
This code is disabled by default, and is enabled if the DEBUG_TAG_REFS
C preprocessor macro is defined.
2013-03-17 17:31:36 +01:00
Colomban Wendling
1646504a46 Fix build with bleeding edge GLib
CTags defines __unused__ and __printf__, which not only are reserved
identifiers, but actually are used by GNUC as arguments of the
__attribute__() extension.  This used to work because no code seeing
those definitions was trying to use them as __attribute__() argument,
but a recent change in GLib made it use it in atomic operation, which
are used by the tagmanager, which itself includes the CTags header
defining those, leading to a weird build failure -- since __unused__
expanded to an unexpected value.

To fix this, rename CTag's __ununsed__ to UNUSED and __printf__ to
PRINTF.
2013-02-13 00:22:16 +01:00
Baptiste Pierrat
d4e61bf093 Add support for Abaqus files
Support for Abaqus (.inp) files, including scintilla lexer and tag
parser.

Signed-off-by: Baptiste Pierrat <baptiste.pierrat@gmail.com>
2013-02-12 14:56:38 +01:00
Lex
bd7b56a80f Comment future fixes/additions
Note where Asciidoc features need to be supported that would
prevent code sharing with other markup parsers.
2013-01-17 15:50:40 +11:00