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.
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.
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 */
}