If package keyword and the package names were on separate lines, the
parser would read past the end of the line.
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@807 c5d04d22-be80-434c-894e-aa346cc9e8e8
This function no longer allocates memory and no unnecessary comparisons
are performed.
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@806 c5d04d22-be80-434c-894e-aa346cc9e8e8
Parse constants declared via hash reference, like this:
use constant {
A => 1,
B => 2,
};
The approach we take is simplistic, but it covers the vast majority of
cases well.
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@805 c5d04d22-be80-434c-894e-aa346cc9e8e8
"('adding '+a+' and ' +b);\ // separate string using "\"
Starts with a " and has a " at the end of the line, though that is part of a
comment and I assume the \ after the ; means it is a line continuation
indicator and the rest of the line should be ignored. So, I have updated
parseString() to do just that.
This correctly parses:
Test\jsFunc_tutorial.js
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@798 c5d04d22-be80-434c-894e-aa346cc9e8e8
Fix a questionable use of the "const" type qualifier resulting
mostly in improper lines numbers with some parsers (seen in the
JavaScript parser). Details in the patch, but basically the
compilers may "improperly" optimize the content of the File
global (seen with GCC and CLang when optimizing).
Set the tag's scope rather than including it in the tag name.
(Geany bug #3570192 [3])
Just an optimization actually -- but also somewhat works around
what 0002 above properly fixes: less calls means less room for
the values to be improperly cached.
Patch from an user, fixes generation of function tags inside
methods. (Geany bug #3571233 [4]).
Fix for unbraced if/else, and adds more tests to 1880687.js
(Geany bug #3568542 [5]).
Just to make the parseJfFile() code a little simpler.
Fix findCmdTerm() when it encounters an open curly.
Fix some more unterminated statements problems, still in
1880687.js.
Lowercase "object" isn't actually a JavaScript keyword.
(Geany bug #3036476 [6])
Properly handle properties values.
(Geany bug #3470609 [7])
Generate class tag for variables for which we generated
children tags.
This one includes the tests for
0005-JavaScript-Fix-recognizing-functions-inside-methods.patch
and also fixes the scope of the tags this patch added -- proof
that writing test cases is indeed better than simply testing
against existing code :)
NOTE: This following tests are broken with these changes.
Test\jsFunc_tutorial.js
D4 function breaks the parser.
Test\simple.js
var invalidInnerFunction = function(a,b) {}
A function tag was generated for this tag.
Actually there are quite a few differences with
simple.js, I am not certain whether the changes
are correct or not. My javascript knowledge is
not that complete.
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@797 c5d04d22-be80-434c-894e-aa346cc9e8e8
jscript.c: In function ‘parseStatement’:
jscript.c:1053:10: warning: variable ‘is_prototype’ set but not used [-Wunused-but-set-variable]
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@794 c5d04d22-be80-434c-894e-aa346cc9e8e8
searching for the initial token character, simply do that when we
finally found the token start.
Just an optimization actually -- but less calls means less room for
the values to be improperly cached.
Patch from Colomban.
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@792 c5d04d22-be80-434c-894e-aa346cc9e8e8
A new deployment archive format was created with a .vba extension.
These are Vimball Archives and must be parsed differently from
regular Vim files.
They follow this format:
" Vimball Archiver comment
UseVimball
finish
filename
line count (n) for filename
(n) lines
filename
line count (n) for filename
(n) lines
...
Parsing is easy, look for UseVimBall as the first line of uncommented code.
Grab the filename, followed by the # of lines, skip those lines and
look for the next filename.
Added a new Kind for these files:
{ TRUE, 'n', "filename", "vimball filename" },
So the full list is:
Vim
a autocommand groups
c user-defined commands
f function definitions
m maps
v variable definitions
n vimball filename
David Fishburn
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@786 c5d04d22-be80-434c-894e-aa346cc9e8e8
since the current support is a bit lacking. In particular:
- Colons are now allowed in identifiers; this is a common way of
separating parts in a label.
- LaTeX doesn't have a concept of strings like other languages, so
quotes shouldn't be handled specially, otherwise this can lead to
whole passages of text being ignored. This fixes bug #2886871.
- Sectioning commands now report the scope they're in, for example a
subsection will report the section it's in using a 'section:'
extension field. This allows for example the Tagbar Vim plugin to
display the sections in a properly nested way.
At the moment the scopes are separated by two double quotes ('""')
as that is a character sequence that shouldn't really appear in
normal LaTeX text, but if anyone has a better idea please tell me.
- Labels can now be output as an additional kind. They're not listed
in their respective scopes as that seems to be what other editors
do, too, and I think it makes more sense this way.
It's working fine for me (and another guy who tested it together with my
Tagbar plugin), but it's still possible that I overlooked something --
if so please tell me.
Cheers,
Jan Larres
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@785 c5d04d22-be80-434c-894e-aa346cc9e8e8
When checking for literal strings to ignore, consider also unicode, binary and raw strings.
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@777 c5d04d22-be80-434c-894e-aa346cc9e8e8
Apply patch from Colomban Wendling to parse Python lambda functions
(thanks) - modified to only parse toplevel or class member lambdas.
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@776 c5d04d22-be80-434c-894e-aa346cc9e8e8
var x = 1;
var y = [];
var z = {};
Only x and y are detected - z is ignored,
despite this being perfectly valid syntax
(and quite common, when initialising
a variable for use as a hash table).
[It's equivalent to z = new Object(), in a
similar fashion to y = [] being equivalent
to y = new Array() ].
As far as I can tell, the cause seems to be that
object literals are not being considered as valid
for the right hand side of an assignment.
Now, global variables for z is generated for the release after 5.8.
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@763 c5d04d22-be80-434c-894e-aa346cc9e8e8
Vim parser did not handle an invalid 'command' format and hung".
Now it handles and checks for these formats:
command.
command!.
comma!.
comma! ThisIsValid
git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@762 c5d04d22-be80-434c-894e-aa346cc9e8e8