[Geany-Devel] Interested making a patch to add QML support

Tory Gaurnier torygaurnier at xxxxx
Fri Sep 20 00:05:12 UTC 2013


On 09/19/2013 03:21 PM, Colomban Wendling wrote:
> Le 20/09/2013 00:07, Tory Gaurnier a écrit :
>> [...]
>>
>> So, the issue now is I can't really figure out how to build CTags, from
>> what I could figure out it seems I need to run the configure script to
>> add values to the Makefile.in, then run make -f Makefile.in, but that
>> doesn't seem to work, and there are no instructions that I can find on
>> building, I've checked the Readme
> It's in INSTALL, though a little too detailed (I guess this INSTALL file
> is just Autotool's one with slight modifications)
>
>> , and the FAQ. Have any of you guys
>> built CTags before and can point me in the right direction???
> You need to first generate the configure script using `autoreconf`, then
> run that configure script (`./configure [OPTIONS]`, which will generate
> Makefiles), and then run make:
>
> 	autoreconf -v && ./configure && make
>
> Regards,
> Colomban
> _______________________________________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Ok, so now when I build it, I'm getting some warning, I'm not sure if 
these are normal or if something needs to be configured, I'm getting 
these warnings on build:
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal
configure.ac:489: warning: underquoted definition of CHECK_PROTO
configure.ac:489:   run info '(automake)Extending aclocal'
configure.ac:489:   or see 
http://www.gnu.org/software/automake/manual/automake.html#Extending-aclocal
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
autoreconf: configure.ac: not using Automake
autoreconf: Leaving directory `.'
Exuberant Ctags, version 5.8
Linux 3.8.0-30-generic #44-Ubuntu SMP Thu Aug 22 20:52:24 UTC 2013 x86_64

Then the rest appears normal.

Then when I run, the program segfaults on freeParserResources () at 
parse.c:364
Which is this line of code: eFree (lang->name);
Which is being called from main.c:572

Now my findQMLTags function in my qml.c file is very closely following 
the awk.c function findAwkTags, so I don't see how it could be caused by 
this, but I may be wrong.




Here is what I have so far:

----CODE STARTS HERE----
#include "general.h"    /* always include first */

#include <string.h>     /* to declare strxxx() functions */

#include "parse.h"      /* always include */
#include "read.h"       /* to define file fileReadLine() */

typedef enum {
     QML_OBJECT,
     JS_FUNCTION
} QMLKind;

static kindOption QMLKinds [] = {
     { TRUE,    'o',    "object",    "objects"    },
     { TRUE, 'f',    "function",    "functions"    }
};

static void findQMLTags(void) {
     vString *name = vStringNew();
     const unsigned char *line;

     // If line is a function
     while((line = fileReadLine()) != NULL) {
         if(strncmp((const char*)line, "function", (size_t)8) == 0 && 
isspace((int)line[8])) {
             const unsigned char *cp = line + 8;

             while(isspace((int)*cp)) ++cp;
             while(isalnum((int)*cp)  ||  *cp == '_') {
                 vStringPut (name, (int)*cp);
                 ++cp;
             }

             vStringTerminate(name);

             while(isspace((int)*cp)) ++cp;
             if(*cp == '(') makeSimpleTag(name, QMLKinds, JS_FUNCTION);
             vStringClear(name);
             if(*cp != '\0') ++cp;
         }
     }

     vStringDelete (name);
}

extern parserDefinition *QMLParser(void) {
     parserDefinition* def = parserNew("QML");
     static const char *const extensions [] = { "QML", NULL };

     def->name = "QML";
     def->kinds = QMLKinds;
     def->kindCount = KIND_COUNT(QMLKinds);
     def->extensions = extensions;
     def->parser = findQMLTags;
     //def->parser2; // Not sure I will need this
     def->regex = FALSE;

     return def;
}
----CODE ENDS HERE----


More information about the Devel mailing list