Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Mon, 14 Mar 2022 18:54:12 UTC Commit: 92e2a783795b2c893185a309dd7675d40d970850 https://github.com/geany/geany/commit/92e2a783795b2c893185a309dd7675d40d9708...
Log Message: ----------- Use C parser for GLSL files and CUDA parser for CUDA files
The GLSL portion of c.c doesn't seem to do anything - it's just a synonym for a C parser which can be used directly instead. This way we can switch to the new cxx parser for GLSL too and reduce one more language to care about in c.c.
For reference, the GLSL "parser" was introduced in commit
6ce421f1411060b8576bdac982cca11229b8ef96
Since we need to keep original identifiers for parsers and need some parser instead of the removed GLSL parser, we can replace it with the CUDA parser that is part of the new cxx parser and we can use this parser for parsing CUDA files instead of C++ (the CUDA parser is basically just C++ parsers with different keywords).
Modified Paths: -------------- ctags/parsers/geany_c.c data/filedefs/filetypes.CUDA.conf src/filetypes.c src/tagmanager/tm_parser.c src/tagmanager/tm_parser.h src/tagmanager/tm_parsers.h
Modified: ctags/parsers/geany_c.c 19 lines changed, 0 insertions(+), 19 deletions(-) =================================================================== @@ -267,7 +267,6 @@ static langType Lang_cpp; static langType Lang_csharp; static langType Lang_java; static langType Lang_d; -static langType Lang_glsl; static langType Lang_vala;
/* Used to index into the CKinds table. */ @@ -3197,12 +3196,6 @@ static void initializeDParser (const langType language) addKeyword ("version", language, KEYWORD_NAMESPACE); /* parse block */ }
-static void initializeGLSLParser (const langType language) -{ - Lang_glsl = language; - buildKeywordHash (language, 0); /* C keywords */ -} - static void initializeCsharpParser (const langType language) { Lang_csharp = language; @@ -3275,18 +3268,6 @@ extern parserDefinition* DParser (void) return def; }
-extern parserDefinition* GLSLParser (void) -{ - static const char *const extensions [] = { "glsl", "frag", "vert", NULL }; - parserDefinition* def = parserNew ("GLSL"); - def->kindTable = CKinds; - def->kindCount = ARRAY_SIZE (CKinds); - def->extensions = extensions; - def->parser2 = findCTags; - def->initialize = initializeGLSLParser; - return def; -} - extern parserDefinition* CsharpParser (void) { static const char *const extensions [] = { "cs", NULL };
Modified: data/filedefs/filetypes.CUDA.conf 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -15,7 +15,7 @@ docComment=a addindex addtogroup anchor arg attention author authors b brief bug
[settings] lexer_filetype=C -tag_parser=C++ +tag_parser=CUDA
# default extension used when saving files extension=cu
Modified: src/filetypes.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -137,7 +137,7 @@ static void init_builtin_filetypes(void) FT_INIT( BASIC, FREEBASIC, "FreeBasic", NULL, SOURCE_FILE, COMPILED ); FT_INIT( FORTRAN, FORTRAN, "Fortran", "Fortran (F90)", SOURCE_FILE, COMPILED ); FT_INIT( F77, F77, "F77", "Fortran (F77)", SOURCE_FILE, COMPILED ); - FT_INIT( GLSL, GLSL, "GLSL", NULL, SOURCE_FILE, COMPILED ); + FT_INIT( GLSL, C, "GLSL", NULL, SOURCE_FILE, COMPILED ); FT_INIT( CAML, NONE, "CAML", "(O)Caml", SOURCE_FILE, COMPILED ); FT_INIT( PERL, PERL, "Perl", NULL, SOURCE_FILE, SCRIPT ); FT_INIT( PHP, PHP, "PHP", NULL, SOURCE_FILE, SCRIPT );
Modified: src/tagmanager/tm_parser.c 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -409,7 +409,7 @@ static TMParserMapEntry map_MATLAB[] = { {'s', tm_tag_struct_t}, };
-#define map_GLSL map_C_old_parser +#define map_CUDA map_C
/* not in universal-ctags */ static TMParserMapEntry map_VALA[] = { @@ -651,7 +651,7 @@ static TMParserMap parser_map[] = { MAP_ENTRY(REST), MAP_ENTRY(HTML), MAP_ENTRY(F77), - MAP_ENTRY(GLSL), + MAP_ENTRY(CUDA), MAP_ENTRY(MATLAB), MAP_ENTRY(VALA), MAP_ENTRY(ACTIONSCRIPT), @@ -1042,7 +1042,7 @@ const gchar *tm_parser_scope_separator(TMParserType lang) { case TM_PARSER_C: /* for C++ .h headers or C structs */ case TM_PARSER_CPP: - case TM_PARSER_GLSL: /* for structs */ + case TM_PARSER_CUDA: case TM_PARSER_PHP: case TM_PARSER_POWERSHELL: case TM_PARSER_RUST: @@ -1089,11 +1089,11 @@ gboolean tm_parser_has_full_scope(TMParserType lang) case TM_PARSER_ACTIONSCRIPT: case TM_PARSER_C: case TM_PARSER_CPP: + case TM_PARSER_CUDA: case TM_PARSER_CSHARP: case TM_PARSER_COBOL: case TM_PARSER_D: case TM_PARSER_GDSCRIPT: - case TM_PARSER_GLSL: case TM_PARSER_GO: case TM_PARSER_JAVA: case TM_PARSER_JAVASCRIPT:
Modified: src/tagmanager/tm_parser.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -90,7 +90,7 @@ enum TM_PARSER_REST, TM_PARSER_HTML, TM_PARSER_F77, - TM_PARSER_GLSL, + TM_PARSER_CUDA, TM_PARSER_MATLAB, TM_PARSER_VALA, TM_PARSER_ACTIONSCRIPT,
Modified: src/tagmanager/tm_parsers.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -46,7 +46,7 @@ RstParser, \ HtmlParser, \ F77Parser, \ - GLSLParser, \ + CUDAParser, \ MatLabParser, \ ValaParser, \ FlexParser, \
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).