In uctags File is made private and mio gets inaccessible. At the moment
it's used by c.c and lcpp.c to get the parameter list. The C parser
"marks" the position where the argument list starts and once the right
")" is reached, string corresponding to this range is read from MIO,
filtered and used for parameter list.
For macro parameters the end of parameter list is handled in a slightly
obfuscated way - since the code from read.c reads the code by lines,
getInputFilePosition() returns the position of EOL so the parameter list
is read between '(' and EOL.
The code had to be modified to collect the potential parameter string
on the way - vString *signature has been added to lcpp.c and every
getcFromInputFile() and ungetcToInputFile() has been converted to
getcAndCollect() and ungetcAndCollect(), respectively, which in addition
perform the parameter collection when needed. Unfortunately this involves
many places in lcpp.c and we must be careful to always use these instead
of the standard ones from read.c.
We cannot rely on the implicit reading of whole lines and must add such
a code ourselves: just plain reading and collecting is enough. In addition
I added handling of multi-line signatures which was missing before.
In tests "bug1585745.cpp" and "cpp_destructor.cpp" the new code fixes
missing () in destructors when there's a space between tilde and name.
In "simple.d" test it fixes wrong function prototype.
The output of test "bug507864.c" seems to be worse than before but it was
already broken before and apparently the compiler is confused by it.
Add access functions and use them outside entry.c. In addition to functions
defined in uctags setMaxTagsLine() had to be added because it is needed
in parser.c (at the moment, will be probably gone in some of the next
commits).
Sync things which are possible to sync from lcpp.c/h. This file is heavily
dependent on c.c and since our c.c differs quite significantly, it's
not possible to use the universal-ctags implementation right now.
This commit started innocently as an attempt to grab options.c/h from
uctags. However it started referencing other files (which started
referencing other files) so the result is lots of new files are added.
When trying to make it compile, I run into many differences of existing
code which would have to be resolved. As all the added code is more or
less garbage for Geany, I just simply commented-out various function
bodies so it compiles without additional modifications. Should get fixed
once more files get synced with uctags.
Added e_msoft.h, changed configure.ac to make more checks for header files
so we have corresponding macros defined, drop HAVE_REGEX macro check which
isn't defined any more, drop debugging function from lua parser (complains
about missing definition of errout).
Tested only on Linux (TODO: Windows, OS X)
Also move eStrdup() to the correct position in the header.
In addition add the same includes into debug.h as those in uctags (the
removal of vstring inclusion inside routines.h causes compilation errors -
it would be best to explicitly include all needed files in every source to
avoid problems like this but let's do just syncing the two implementations
for now).
keyword.c/h contains only changes made by me. To make the sync complete,
add type.h with type declarations (and remove the added declarations from
their original locations).
Except missing mio_free() in stringListNewFromFile() which has been ported
to uctags.
Except the use of ptrarray for strlist implementation, there's nothing
interesting in the Geany version which would be worth preserving.
Also get the error() implementation from error.c/h (modified slightly to
make sure exit() isn't called and which doesn't call errorPrinter() as
this one should be set somewhere else in the code and it doesn't happen
now).
Convert g_stat() to stat() and introduce eStat() to routines.c/h and use
it instead of getFileSize() and isExecutable().
On the way grab implementations of isSameFile() and tempFile() from
universal-ctags (I haven't checked in detail if all the ifdef cases do the
right thing but these functions aren't probably called in Geany so
we don't have to worry much). Also drop unused setCurrentDirectory().
All the changes in the first half of .c/.h were introduced by me in uctags
(and thus they are guaranteed to be great ;-).
The following functions were missing in our ctags implementation and are
added by this commit (currently unused):
extern vString *vStringNewOrClear (vString *const string);
extern char *vStringDeleteUnwrap (vString *const string);
extern void vStringCatSWithEscaping (vString* b, const char *s);
extern void vStringCatSWithEscapingAsPattern (vString *output, const char* input);
read.c has been updated to use vStringResize() instead of
vStringAutoResize().
Since Geany requires C99 parser, the patch just simply includes stdbool.h
in general.h and drops the TRUE, FALSE definitions inside the same file.
The rest is purely mechanical
boolean -> bool
TRUE -> true
FALSE -> false
plus some alignment fixes.
This patch corresponds to universal-ctags commit ce990805a0a0269c.
2499b96ea1d1eb523733c95e7ec73af827b6032e fixed missing escaping of
markup text, but failed to remove explicit escaping from
ui_label_new_bold(), leading to dual escaping of bold labels.
It is very hard to debug if the proxy plugin happens to give
extensions starting with a dot. If they do, detect this case, warn
in the debug messages, and fix the extension. It seems unlikely
that files with two dot extensions will be desired, so it should
case no harm.
* Add GEANY_ prefix to enumerators.
* Use a discrete set of enumerators so the proxy doesn't have to
worry about flag bitmasks, which isn't required.
* Update documentation.
* Use the new enumerators in Geany.
* Improve debug output for bogus values a bit.
Expect [1] scripts filenames generally end in .exp, although the code
itself is actually in Tcl. I find my self manually selecting Tcl quite
often, so I think it would be nice if Geany would recognize it direcly
as Tcl.
[1] http://expect.sourceforge.net/
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>