646 Commits

Author SHA1 Message Date
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
Lex
8294ea2c2e Add Asciidoc filetype
Add a filetype for Asciidoc with symbol parser, but not styling.
2013-01-17 15:43:24 +11:00
Lex
76aec0852a Revert incomplete Asciidoc filetype commit.
This reverts commit da78a44a1cfeb753e0d06d7175e882f508ad9788.
2013-01-17 15:27:39 +11:00
Colomban Wendling
288adaffd7 Python tag parser: fix detection of keywords followed by a tab (\t)
The Python tag parser used to require a space, and a space only, as the
character following a keyword.  Fix this so it allows any whitespace.
2012-12-06 19:41:14 +01:00
Nick Treleaven
48f7efaa68 Ignore D angle brackets e.g. Foo!(x < 2) 2012-11-27 13:35:50 +00:00
Lex
da78a44a1c Add Asciidoc filetype with symbol parser
Add an Asciidoc filetype and a basic symbol parser based on ReST.
See the FIXMEs for ReST to Asciidoc changes still to be done.
2012-11-17 19:19:27 +11:00
Nick Treleaven
e9e41ee47b Move D, Vala unique keyword aliases out of keywordTable
Instead put them in initialize*Parser().
2012-11-15 13:39:53 +00:00
Nick Treleaven
a742ff3546 Parse scope for D nested template blocks (#3582833) 2012-11-05 16:18:43 +00:00
Nick Treleaven
7d4ffb1e45 Fix parsing D 'static assert' (#3582833) 2012-11-03 16:08:35 +00:00
Colomban Wendling
2109677781 JavaScript parser: fix scope of functions nested inside methods 2012-10-28 18:55:48 +01:00
Colomban Wendling
4dafe0d8d3 JavaScript parser: properly parse regular expression literals
This prevents a regex pattern from fooling the parser if it contains
some recognized constructs, like comment or string literal starts.

Closes #2992393 and #3398636.
2012-10-26 16:59:21 +02:00
Nick Treleaven
d7e285d00e Fix parsing colons in D (#3577788) 2012-10-25 13:54:52 +01:00
Colomban Wendling
8855c146cc Fix a use of non-const variable to hold a string literal 2012-10-22 22:40:19 +02:00
Colomban Wendling
6c7f69578d Parse C++11 classed enums
Part of #3578557.
2012-10-22 22:39:04 +02:00
Colomban Wendling
f2f22d34ab Parse C++11 enums with type specifier
Part of #3578557.
2012-10-22 22:38:12 +02:00