[Github-comments] [geany/geany] Add AutoIt (*.au3) Lexer to Geany (#967)

Skif-off notifications at xxxxx
Mon Oct 30 21:30:57 UTC 2017


I added ```ctags/parsers/autoit.c```
```c
/*
*   Copyright (c) 2000-2006, Darren Hiebert, Elias Pschernig
*
*   This source code is released for free distribution under the terms of the
*   GNU General Public License version 2 or (at your option) any later version.
*
*   This module contains functions for generating tags for AutoIt functions.
*/

/*
*   INCLUDE FILES
*/
#include "general.h"  /* must always come first */

#include <string.h>

#include "parse.h"
#include "read.h"
#include "routines.h"
#include "vstring.h"

/*
*   DATA DEFINITIONS
*/
typedef enum {
	K_FUNCTION
} AutoItKind;

static kindOption AutoItKinds[] = {
	{ true, 'f', "func", "functions" }
};

/*
*   FUNCTION DEFINITIONS
*/
static void findAutoItTags (void)
{
	vString *name = vStringNew ();
	const unsigned char *line;

	while ((line = readLineFromInputFile ()) != NULL)
	{
		const unsigned char* cp = line;
		if ((line[0] == 'F' || line[0] == 'f') &&
			(line[1] == 'U' || line[1] == 'u') &&
			(line[2] == 'N' || line[2] == 'n') &&
			(line[3] == 'C' || line[3] == 'c') &&
			isspace ((int) line[4]))
		{
			cp += 4;
			while (isspace ((int) *cp))
				++cp;
			while (isalnum ((int) *cp) || *cp == '_')
			{
				vStringPut (name, (int) *cp);
				++cp;
			}
			while (isspace ((int) *cp))
				++cp;
			if (*cp == '(')
				makeSimpleTag (name, AutoItKinds, K_FUNCTION);
			vStringClear (name);
		}
	}
	vStringDelete (name);
}

parserDefinition *AutoItParser (void)
{
	static char const *extensions[] = { "au3", "AU3", "Au3", "aU3", NULL };
	parserDefinition* def = parserNew ("AutoIt");
	def->kinds      = AutoItKinds;
	def->kindCount  = ARRAY_SIZE (AutoItKinds);
	def->extensions = extensions;
	def->parser     = findAutoItTags;
	return def;
}
```
and change ```ctags/Makefile.am```
```diff
@@ -14,6 +14,7 @@
 	parsers/actionscript.c \
 	parsers/asciidoc.c \
 	parsers/asm.c \
+	parsers/autoit.c \
 	parsers/basic.c \
 	parsers/c.c \
 	parsers/cobol.c \
```
Sad outcome: autocompletion doesn't work, on Symbols tab I see "No symbols found".
What did I miss?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/967#issuecomment-340590784
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20171030/3533cbf6/attachment-0001.html>


More information about the Github-comments mailing list