Hi,

I took a look at the tagmanager in an attempt to make it work in-memory,
since it is not yet completely the case.
I found why and how to fix the (C?) function arguments (attached patch),
and it seems to work pretty well for C (and Python and PHP, though I did
only a few tests with them).

For now the only defect I saw (with C) is with anonymous enumerations
and so (that are named anon_enum_NUM) with which the NUM increases at
each re-parsing (I use document_update_tag_list(doc, TRUE) to re-parse);
but I suppose it wouldn't it too difficult to fix, would it?.

Then, I would like to know what else didn't work, what need to be fixed,
etc.; because I'd really love to have it working.

Enrico Tröger wrote: (on thread Function Definition)
> Some time ago, I started working on this but it never really worked and
> additionally, it could work currently only for a few parsers (some of
> those are C, Fortran, SQL IIRC). To get it working reliably, some more
> work is needed and we would have to adjust *all* existing parsers which
> is by no means an easy task.
Do you know which parsers would *not* work? And hum, if each and every
parser must care about buffer VS file, wouldn't it be good to abstract
this a little more? (with e.g. a little I/O layer - I already started a
small library to check if it would be easy to emulate file I/O on
buffer, and it seems not to be too hard)

Regards,
Colomban
Index: tagmanager/read.c
===================================================================
--- tagmanager/read.c	(révision 4823)
+++ tagmanager/read.c	(copie de travail)
@@ -323,6 +323,7 @@
     bufferStartOfLine = 0;
     File.fpBufferPosition = 0;
     File.fpBufferSize = buffer_size;
+    File.bufferPosition = 0;
     File.currentLine  = NULL;
     File.language     = language;
     File.lineNumber   = 0L;
@@ -375,6 +376,7 @@
  */
 static void fileNewline (void)
 {
+    File.bufferPosition = bufferStartOfLine;
     File.filePosition = StartOfLine;
     File.newLine = FALSE;
     File.lineNumber++;
Index: tagmanager/read.h
===================================================================
--- tagmanager/read.h	(révision 4823)
+++ tagmanager/read.h	(copie de travail)
@@ -33,7 +33,7 @@
 #define getInputLineNumber()	File.lineNumber
 #define getInputFileName()	vStringValue (File.source.name)
 #define getInputFilePosition()	File.filePosition
-#define getInputBufferPosition()	File.fpBufferPosition
+#define getInputBufferPosition()	File.bufferPosition
 #define getSourceFileName()	vStringValue (File.source.name)
 #define getSourceFileTagPath()	File.source.tagPath
 #define getSourceLanguage()	File.source.language
@@ -80,6 +80,7 @@
     int fpBufferPosition;	/* pointer to the current position in buffer */
     unsigned long lineNumber;	/* line number in the input file */
     fpos_t	filePosition;	/* file position of current line */
+    int	bufferPosition;	/* buffer position of current line */
     int		ungetch;	/* a single character that was ungotten */
     boolean	eof;		/* have we reached the end of file? */
     boolean	newLine;	/* will the next character begin a new line? */
_______________________________________________
Geany-devel mailing list
[email protected]
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

Reply via email to