Skip to content

Commit

Permalink
Merge pull request geany#3859 from techee/ctags_sync2
Browse files Browse the repository at this point in the history
Sync our ctags to the latest tag version (p6.1.20240421.0)
  • Loading branch information
techee authored May 14, 2024
2 parents 11b4a00 + ae75c73 commit 2d1b3d5
Show file tree
Hide file tree
Showing 214 changed files with 14,522 additions and 4,823 deletions.
16 changes: 14 additions & 2 deletions ctags/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ parsers = \
parsers/cxx/cxx_parser.h \
parsers/cxx/cxx_parser_internal.h \
parsers/cxx/cxx_parser_lambda.c \
parsers/cxx/cxx_parser_module.c \
parsers/cxx/cxx_parser_namespace.c \
parsers/cxx/cxx_parser_template.c \
parsers/cxx/cxx_parser_tokenizer.c \
Expand All @@ -32,6 +33,8 @@ parsers = \
parsers/cxx/cxx_qtmoc.c \
parsers/cxx/cxx_scope.c \
parsers/cxx/cxx_scope.h \
parsers/cxx/cxx_side_chain.c \
parsers/cxx/cxx_side_chain.h \
parsers/cxx/cxx_subparser.c \
parsers/cxx/cxx_subparser.h \
parsers/cxx/cxx_subparser_internal.h \
Expand All @@ -51,6 +54,7 @@ parsers = \
parsers/autoit.c \
parsers/basic.c \
parsers/bibtex.c \
parsers/bibtex.h \
parsers/geany_c.c \
parsers/clojure.c \
parsers/cobol.c \
Expand All @@ -69,33 +73,37 @@ parsers = \
parsers/haxe.c \
parsers/html.c \
parsers/jscript.c \
parsers/jscript.h \
parsers/json.c \
parsers/julia.c \
parsers/geany_lcpp.c \
parsers/geany_lcpp.h \
parsers/ldscript.c \
parsers/lisp.c \
parsers/lua.c \
parsers/make.c \
parsers/make.h \
parsers/markdown.c \
parsers/markdown.h \
parsers/geany_matlab.c \
parsers/matlab.c \
parsers/nsis.c \
parsers/objc.c \
parsers/ocaml.c \
parsers/pascal.c \
parsers/perl.c \
parsers/perl.h \
parsers/perl6.c \
parsers/php.c \
parsers/powershell.c \
parsers/python.c \
parsers/r.c \
parsers/r.h \
parsers/raku.c \
parsers/rst.c \
parsers/ruby.c \
parsers/ruby.h \
parsers/rust.c \
parsers/sh.c \
parsers/sh.h \
parsers/sql.c \
parsers/tcl.c \
parsers/tcl.h \
Expand Down Expand Up @@ -148,6 +156,7 @@ libctags_la_SOURCES = \
main/htable.h \
main/inline.h \
main/interactive_p.h \
main/interval_tree_generic.h \
main/keyword.c \
main/keyword.h \
main/keyword_p.h \
Expand Down Expand Up @@ -195,6 +204,7 @@ libctags_la_SOURCES = \
main/ptrarray.h \
main/rbtree.c \
main/rbtree.h \
main/rbtree_augmented.h \
main/read.c \
main/read.h \
main/read_p.h \
Expand Down Expand Up @@ -226,6 +236,8 @@ libctags_la_SOURCES = \
main/types.h \
main/unwindi.c \
main/unwindi.h \
main/utf8_str.c \
main/utf8_str.h \
main/vstring.c \
main/vstring.h \
main/writer-ctags.c \
Expand Down
37 changes: 30 additions & 7 deletions ctags/dsl/es.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <string.h>
#include <errno.h>
#include <limits.h>
#include <math.h>

#include <regex.h>

Expand Down Expand Up @@ -822,7 +823,6 @@ es_symbol_print(const EsObject* object, MIO* fp)
unsigned char cc;
unsigned char mask;
int needs_bar;
int i;

string = es_symbol_get(object);
if (!string)
Expand All @@ -840,7 +840,7 @@ es_symbol_print(const EsObject* object, MIO* fp)
{
/* 0 => 1? */
mask = 0x2;
for (i = 0; i< len; i++)
for (size_t i = 0; i< len; i++)
{
c = string[i];
cc = get_char_class(c);
Expand All @@ -854,7 +854,7 @@ es_symbol_print(const EsObject* object, MIO* fp)
if (needs_bar)
mio_printf(fp, "|");

for (i = 0; i < len; i++)
for (size_t i = 0; i < len; i++)
{
c = string[i];
if (c == '\\' || c == '|')
Expand Down Expand Up @@ -1028,7 +1028,7 @@ es_string_print(const EsObject* object, MIO* fp)
const char* string;
char c;
size_t len;
int i;
size_t i;


string = es_string_get(object);
Expand Down Expand Up @@ -1352,6 +1352,29 @@ es_regex_exec (const EsObject* regex,
0, NULL, 0)? es_false: es_true;
}

EsObject*
es_regex_exec_extract_match_new (const EsObject* regex,
const EsObject* str,
unsigned int group)
{
EsObject *r;
regmatch_t *pmatch = calloc(group + 1, sizeof(regmatch_t));
if (!pmatch)
return ES_ERROR_MEMORY;

const char *s = es_string_get (str);
if (regexec(((EsRegex*)regex)->code, s, group + 1, pmatch, 0))
r = es_false;
else
r = pmatch[group].rm_so == -1
? es_nil:
es_string_newL(s + pmatch[group].rm_so,
pmatch[group].rm_eo - pmatch[group].rm_so);

free (pmatch);
return r;
}

/*
* Error
*/
Expand Down Expand Up @@ -2167,7 +2190,7 @@ static void
dump_token (MIO* stream, const char* prefix, Token* seed)
{
const char* buf;
int i;
size_t i;
char c;


Expand Down Expand Up @@ -2562,8 +2585,8 @@ is_real (const char* cstr,
return 0;
else if (*endptr != '\0')
return 0;

/* TODO: INF, NAN... */
else if (isinf(*d) || isnan(*d))
return 0;
return 1;
}

Expand Down
6 changes: 6 additions & 0 deletions ctags/dsl/es.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ int es_regex_p (const EsObject* object);
EsObject* es_regex_exec (const EsObject* regex,
const EsObject* str);

/* Return #f if unmatched.
* Retrun NIL is the associate group is not in REGEX. */
EsObject* es_regex_exec_extract_match_new (const EsObject* regex,
const EsObject* str,
unsigned int group);

/*
* Foreign pointer
*/
Expand Down
Loading

0 comments on commit 2d1b3d5

Please sign in to comment.