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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.