lists.geany.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
List overview
Commits
February 2014
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
commits@lists.geany.org
1 participants
36 discussions
Start a n
N
ew thread
[geany/geany] 2f120d: Fix typo in "deque" include name
by Colomban Wendling
27 Feb '14
27 Feb '14
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Thu, 27 Feb 2014 13:33:45 UTC Commit: 2f120d73c9dd13f3aa7aeb4bbe59979750c14c93
https://github.com/geany/geany/commit/2f120d73c9dd13f3aa7aeb4bbe59979750c14…
Log Message: ----------- Fix typo in "deque" include name Fixes bug #1027. Modified Paths: -------------- src/ui_utils.c Modified: src/ui_utils.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -608,7 +608,7 @@ void ui_create_insert_menu_items(void) "memory", "locale", NULL }; const gchar *c_includes_stl[] = { - "bitset", "dequev", "list", "map", "set", "queue", "stack", "vector", "algorithm", + "bitset", "deque", "list", "map", "set", "queue", "stack", "vector", "algorithm", "iterator", "functional", "string", "complex", "valarray", NULL }; -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 8930ba: Merge branch 'fortran/improvements'
by Colomban Wendling
23 Feb '14
23 Feb '14
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 23 Feb 2014 19:30:11 UTC Commit: 8930ba80eb7a5fb2c489772fa37fc269202ba2d3
https://github.com/geany/geany/commit/8930ba80eb7a5fb2c489772fa37fc269202ba…
Log Message: ----------- Merge branch 'fortran/improvements' Modified Paths: -------------- data/filetypes.fortran src/symbols.c tagmanager/ctags/fortran.c tests/ctags/Makefile.am tests/ctags/array-spec.f90.tags tests/ctags/auto.f.tags tests/ctags/block.f90 tests/ctags/block.f90.tags tests/ctags/bug565813.f90.tags tests/ctags/bug670433.f90.tags tests/ctags/bug726712.f90.tags tests/ctags/bug734933.f90.tags tests/ctags/bug858165.f90.tags tests/ctags/bug877956.f90.tags tests/ctags/byte.f.tags tests/ctags/common.f.tags tests/ctags/debian_432872.f90.tags tests/ctags/enum.f90 tests/ctags/enum.f90.tags tests/ctags/enumerators.f90 tests/ctags/enumerators.f90.tags tests/ctags/forall_module.f90.tags tests/ctags/fortran_associate.f90.tags tests/ctags/interfaces.f90 tests/ctags/interfaces.f90.tags tests/ctags/invalid_name.f90.tags tests/ctags/keyword_names.f90 tests/ctags/keyword_names.f90.tags tests/ctags/members.f90 tests/ctags/members.f90.tags tests/ctags/misc_types.f.tags tests/ctags/misc_types.f90.tags tests/ctags/namelist.f.tags tests/ctags/numlib.f90.tags tests/ctags/preprocessor.f90 tests/ctags/preprocessor.f90.tags tests/ctags/procedure_pointer_module.f90.tags tests/ctags/procpoint.f90.tags tests/ctags/qualified_types.f90 tests/ctags/qualified_types.f90.tags tests/ctags/recursive.f95.tags tests/ctags/square_parens.f90.tags tests/ctags/stdcall.f.tags tests/ctags/structure.f.tags tests/ctags/union.f.tags tests/ctags/value.f.tags Modified: data/filetypes.fortran 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -3,7 +3,7 @@ [keywords] # all items must be in one line -primary=abstract access action advance all allstop allocatable allocate apostrophe assign assignment associate asynchronous backspace bind blank blockdata call case character class close codimension common complex concurrent contains contiguous continue critical cycle data deallocate decimal delim default dimension direct do dowhile double doubleprecision elemental else elseif elsewhere encoding end endassociate endblockdata endcritical enddo endfile endforall endfunction endif endinterface endmodule endprocedure endprogram endselect endsubmodule endsubroutine endtype endwhere entry enum enumerator eor equivalence err errmsg exist exit extends external file final flush fmt forall form format formatted function generic go goto id if images implicit import impure in include inout integer inquire intent interface intrinsic iomsg iolength iostat is kind len lock logical memory module name named namelist nextrec nml non_intrinsic non_overridable none nopass nullify number only open opened operator optional out pad parameter pass pause pending pointer pos position precision print private procedure program protected public quote pure read readwrite real rec recl recursive result return rewind save select selectcase selecttype sequential sign size stat status stop stream submodule subroutine sync syncall syncimages syncmemory target then to type unformatted unit unlock use value volatile wait where while write +primary=abstract access action advance all allstop allocatable allocate apostrophe assign assignment associate asynchronous backspace bind blank block blockdata call case character class close codimension common complex concurrent contains contiguous continue critical cycle data deallocate decimal delim default dimension direct do dowhile double doubleprecision elemental else elseif elsewhere encoding end endassociate endblock endblockdata endcritical enddo endfile endforall endfunction endif endinterface endmodule endprocedure endprogram endselect endsubmodule endsubroutine endtype endwhere entry enum enumerator eor equivalence err errmsg exist exit extends external file final flush fmt forall form format formatted function generic go goto id if images implicit import impure in include inout integer inquire intent interface intrinsic iomsg iolength iostat is kind len lock logical memory module name named namelist nextrec nml non_intrinsic non_overridable none nopass nullify number only open opened operator optional out pad parameter pass pause pending pointer pos position precision print private procedure program protected public quote pure read readwrite real rec recl recursive result return rewind save select selectcase selecttype sequential sign size stat status stop stream submodule subroutine sync syncall syncimages syncmemory target then to type unformatted unit unlock use value volatile wait where while write intrinsic_functions=abs achar acos acosd acosh adjustl adjustr aimag aimax0 aimin0 aint ajmax0 ajmin0 akmax0 akmin0 all allocated alog alog10 amax0 amax1 amin0 amin1 amod anint any asin asind asinh associated atan atan2 atan2d atand atanh atomic_define atomic_ref bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn bge bgt bit_size bitest bitl bitlr bitrl bjtest bktest ble blt break btest c_associated c_f_pointer c_f_procpointer c_funloc c_loc c_sizeof cabs ccos cdabs cdcos cdexp cdlog cdsin cdsqrt ceiling cexp char clog cmplx command_argument_count conjg cos cosd cosh count cpu_time cshift csin csqrt dabs dacos dacosd dasin dasind datan datan2 datan2d datand date date_and_time dble dcmplx dconjg dcos dcosd dcosh dcotan ddim dexp dfloat dfloti dflotj dflotk digits dim dimag dint dlog dlog10 dmax1 dmin1 dmod dnint dot_product dprod dreal dshiftl dshiftr dsign dsin dsind dsinh dsqrt dtan dtand dtanh eoshift epsilon erf erfc erfc_scaled errsns execute_command_line exp exponent extends_type_of findloc float floati floatj floatk floor fraction free gamma get_command get_command_argument get_environment_variable huge hypot iabs iachar iall iand iany ibclr ibits ibset ichar idate idim idint idnint ieor ifix iiabs iiand iibclr iibits iibset iidim iidint iidnnt iieor iifix iint iior iiqint iiqnnt iishft iishftc iisign ilen image_index imax0 imax1 imin0 imin1 imod index inint inot int int1 int2 int4 int8 ior iparity iqint iqnint is_contiguous is_isostat_end is_isostat_eor ishft ishftc isign isnan izext jiand jibclr jibits jibset jidim jidint jidnnt jieor jifix jint jior jiqint jiqnnt jishft jishftc jisign jmax0 jmax1 jmin0 jmin1 jmod jnint jnot jzext kiabs kiand kibclr kibits kibset kidim kidint kidnnt kieor kifix kind kint kior kishft kishftc kisign kmax0 kmax1 kmin0 kmin1 kmod knint knot kzext lbound lcobound leadz len len_trim lge lgt lle llt log log10 log_gamma logical lshift malloc maskl maskr matmul max max0 max1 maxexponent maxloc maxval merge merge_bits min min0 min1 minexponent minloc minval mod modulo move_alloc mvbits nearest new_line nint norm2 not null num_images number_of_processors nworkers pack parity popcnt poppar precision present product radix random random_number random_seed range real repeat reshape rrspacing rshift same_type_as scale scan secnds selected_char_kind selected_int_kind selected_real_kind set_exponent shape shifta shiftl shiftr sign sin sind sinh size sizeof sngl snglq spacing spread sqrt storage_size sum system_clock tan tand tanh this_image tiny trailz transfer transpose trim ubound ucobound unpack verify user_functions=cdabs cdcos cdexp cdlog cdsin cdsqrt cotan cotand dcmplx dconjg dcotan dcotand decode dimag dll_export dll_import doublecomplex dreal dvchk encode find flen flush getarg getcharqq getcl getdat getenv gettim hfix ibchng identifier imag int1 int2 int4 intc intrup invalop iostat_msg isha ishc ishl jfix lacfar locking locnear map nargs nbreak ndperr ndpexc offset ovefl peekcharqq precfill prompt qabs qacos qacosd qasin qasind qatan qatand qatan2 qcmplx qconjg qcos qcosd qcosh qdim qexp qext qextd qfloat qimag qlog qlog10 qmax1 qmin1 qmod qreal qsign qsin qsind qsinh qsqrt qtan qtand qtanh ran rand randu rewrite segment setdat settim system timer undfl unlock union val virtual volatile zabs zcos zexp zlog zsin zsqrt Modified: src/symbols.c 8 files changed, 5 insertions(+), 3 deletions(-) =================================================================== @@ -972,12 +972,14 @@ static void add_top_level_items(GeanyDocument *doc) { tag_list_add_groups(tag_store, &(tv_iters.tag_namespace), _("Module"), "classviewer-class", + &(tv_iters.tag_struct), _("Programs"), "classviewer-class", &(tv_iters.tag_interface), _("Interfaces"), "classviewer-struct", - &(tv_iters.tag_function), _("Functions"), "classviewer-method", - &(tv_iters.tag_member), _("Subroutines"), "classviewer-method", + &(tv_iters.tag_function), _("Functions / Subroutines"), "classviewer-method", &(tv_iters.tag_variable), _("Variables"), "classviewer-var", - &(tv_iters.tag_type), _("Types"), "classviewer-namespace", + &(tv_iters.tag_class), _("Types"), "classviewer-class", + &(tv_iters.tag_member), _("Components"), "classviewer-member", &(tv_iters.tag_macro), _("Blocks"), "classviewer-member", + &(tv_iters.tag_type), _("Enums"), "classviewer-struct", &(tv_iters.tag_other), _("Other"), "classviewer-other", NULL); break; Modified: tagmanager/ctags/fortran.c 200 files changed, 152 insertions(+), 48 deletions(-) =================================================================== @@ -65,6 +65,7 @@ KEYWORD_assignment, KEYWORD_associate, KEYWORD_automatic, + KEYWORD_bind, KEYWORD_block, KEYWORD_byte, KEYWORD_cexternal, @@ -83,6 +84,8 @@ KEYWORD_elemental, KEYWORD_end, KEYWORD_entry, + KEYWORD_enum, + KEYWORD_enumerator, KEYWORD_equivalence, KEYWORD_extends, KEYWORD_external, @@ -97,6 +100,8 @@ KEYWORD_intent, KEYWORD_interface, KEYWORD_intrinsic, + KEYWORD_kind, + KEYWORD_len, KEYWORD_logical, KEYWORD_map, KEYWORD_module, @@ -178,6 +183,8 @@ TAG_SUBROUTINE, TAG_DERIVED_TYPE, TAG_VARIABLE, + TAG_ENUM, + TAG_ENUMERATOR, TAG_COUNT /* must be last */ } tagType; @@ -203,6 +210,8 @@ static boolean FreeSourceForm = FALSE; static boolean ParsingString; static tokenInfo *Parent = NULL; +static boolean NewLine = TRUE; +static unsigned int contextual_fake_count = 0; /* indexed by tagType */ static kindOption FortranKinds [] = { @@ -210,16 +219,18 @@ { TRUE, 'c', "macro", "common blocks"}, { TRUE, 'e', "entry", "entry points"}, { TRUE, 'f', "function", "functions"}, - { FALSE, 'i', "interface", "interface contents, generic names, and operators"}, - { TRUE, 'k', "component", "type and structure components"}, + { TRUE, 'i', "interface", "interface contents, generic names, and operators"}, + { TRUE, 'k', "member", "type and structure components"}, { TRUE, 'l', "label", "labels"}, { FALSE, 'L', "local", "local, common block, and namelist variables"}, { TRUE, 'm', "namespace", "modules"}, { TRUE, 'n', "namelist", "namelists"}, - { TRUE, 'p', "package", "programs"}, - { TRUE, 's', "member", "subroutines"}, - { TRUE, 't', "typedef", "derived types and structures"}, - { TRUE, 'v', "variable", "program (global) and module variables"} + { TRUE, 'p', "struct", "programs"}, + { TRUE, 's', "method", "subroutines"}, + { TRUE, 't', "class", "derived types and structures"}, + { TRUE, 'v', "variable", "program (global) and module variables"}, + { TRUE, 'E', "enum", "enumerations"}, + { TRUE, 'F', "enumerator", "enumeration values"}, }; /* For efinitions of Fortran 77 with extensions: @@ -236,6 +247,7 @@ { "assignment", KEYWORD_assignment }, { "associate", KEYWORD_associate }, { "automatic", KEYWORD_automatic }, + { "bind", KEYWORD_bind }, { "block", KEYWORD_block }, { "byte", KEYWORD_byte }, { "cexternal", KEYWORD_cexternal }, @@ -254,6 +266,8 @@ { "elemental", KEYWORD_elemental }, { "end", KEYWORD_end }, { "entry", KEYWORD_entry }, + { "enum", KEYWORD_enum }, + { "enumerator", KEYWORD_enumerator }, { "equivalence", KEYWORD_equivalence }, { "extends", KEYWORD_extends }, { "external", KEYWORD_external }, @@ -268,6 +282,8 @@ { "intent", KEYWORD_intent }, { "interface", KEYWORD_interface }, { "intrinsic", KEYWORD_intrinsic }, + { "kind", KEYWORD_kind }, + { "len", KEYWORD_len }, { "logical", KEYWORD_logical }, { "map", KEYWORD_map }, { "module", KEYWORD_module }, @@ -368,7 +384,7 @@ static const tokenInfo* ancestorScope (void) { tokenInfo *const token = Ancestors.list + i - 1; if (token->type == TOKEN_IDENTIFIER && - token->tag != TAG_UNDEFINED && token->tag != TAG_INTERFACE) + token->tag != TAG_UNDEFINED) result = token; } return result; @@ -445,6 +461,16 @@ static tokenInfo *newTokenFrom (tokenInfo *const token) return result; } +static tokenInfo *newAnonTokenFrom (tokenInfo *const token, const char *type) +{ + char buffer[64]; + tokenInfo *result = newTokenFrom (token); + sprintf (buffer, "%s#%u", type, contextual_fake_count++); + vStringClear (result->string); + vStringCatS (result->string, buffer); + return result; +} + static void deleteToken (tokenInfo *const token) { if (token != NULL) @@ -500,7 +526,7 @@ static void makeFortranTag (tokenInfo *const token, tagType tag) e.extensionFields.scope [1] = vStringValue (scope->string); } } - if (! insideInterface () || includeTag (TAG_INTERFACE)) + if (! insideInterface () /*|| includeTag (TAG_INTERFACE)*/) makeTagEntry (&e); } } @@ -704,7 +730,6 @@ static int skipToNextLine (void) static int getFreeFormChar (boolean inComment) { - static boolean newline = TRUE; boolean advanceLine = FALSE; int c = fileGetc (); @@ -719,7 +744,7 @@ static int getFreeFormChar (boolean inComment) while (isspace (c) && c != '\n'); if (c == '\n') { - newline = TRUE; + NewLine = TRUE; advanceLine = TRUE; } else if (c == '!') @@ -730,16 +755,16 @@ static int getFreeFormChar (boolean inComment) c = '&'; } } - else if (newline && (c == '!' || c == '#')) + else if (NewLine && (c == '!' || c == '#')) advanceLine = TRUE; while (advanceLine) { while (isspace (c)) c = fileGetc (); - if (c == '!' || (newline && c == '#')) + if (c == '!' || (NewLine && c == '#')) { c = skipToNextLine (); - newline = TRUE; + NewLine = TRUE; continue; } if (c == '&') @@ -747,7 +772,7 @@ static int getFreeFormChar (boolean inComment) else advanceLine = FALSE; } - newline = (boolean) (c == '\n'); + NewLine = (boolean) (c == '\n'); return c; } @@ -1144,6 +1169,7 @@ static boolean isTypeSpec (tokenInfo *const token) case KEYWORD_record: case KEYWORD_type: case KEYWORD_procedure: + case KEYWORD_enumerator: result = TRUE; break; default: @@ -1171,6 +1197,21 @@ static boolean isSubprogramPrefix (tokenInfo *const token) return result; } +static void parseKindSelector (tokenInfo *const token) +{ + if (isType (token, TOKEN_PAREN_OPEN)) + skipOverParens (token); /* skip kind-selector */ + if (isType (token, TOKEN_OPERATOR) && + strcmp (vStringValue (token->string), "*") == 0) + { + readToken (token); + if (isType (token, TOKEN_PAREN_OPEN)) + skipOverParens (token); + else + readToken (token); + } +} + /* type-spec * is INTEGER [kind-selector] * or REAL [kind-selector] is ( etc. ) @@ -1208,14 +1249,7 @@ static void parseTypeSpec (tokenInfo *const token) case KEYWORD_real: case KEYWORD_procedure: readToken (token); - if (isType (token, TOKEN_PAREN_OPEN)) - skipOverParens (token); /* skip kind-selector */ - if (isType (token, TOKEN_OPERATOR) && - strcmp (vStringValue (token->string), "*") == 0) - { - readToken (token); - readToken (token); - } + parseKindSelector (token); break; case KEYWORD_double: @@ -1246,6 +1280,10 @@ static void parseTypeSpec (tokenInfo *const token) parseDerivedTypeDef (token); break; + case KEYWORD_enumerator: + readToken (token); + break; + default: skipToToken (token, TOKEN_STATEMENT_END); break; @@ -1297,6 +1335,8 @@ static void parseQualifierSpecList (tokenInfo *const token) case KEYWORD_allocatable: case KEYWORD_external: case KEYWORD_intrinsic: + case KEYWORD_kind: + case KEYWORD_len: case KEYWORD_optional: case KEYWORD_private: case KEYWORD_pointer: @@ -1333,11 +1373,12 @@ static tagType variableTagType (void) const tokenInfo* const parent = ancestorTop (); switch (parent->tag) { - case TAG_MODULE: result = TAG_VARIABLE; break; - case TAG_DERIVED_TYPE: result = TAG_COMPONENT; break; - case TAG_FUNCTION: result = TAG_LOCAL; break; - case TAG_SUBROUTINE: result = TAG_LOCAL; break; - default: result = TAG_VARIABLE; break; + case TAG_MODULE: result = TAG_VARIABLE; break; + case TAG_DERIVED_TYPE: result = TAG_COMPONENT; break; + case TAG_FUNCTION: result = TAG_LOCAL; break; + case TAG_SUBROUTINE: result = TAG_LOCAL; break; + case TAG_ENUM: result = TAG_ENUMERATOR; break; + default: result = TAG_VARIABLE; break; } } return result; @@ -1568,25 +1609,27 @@ static void parseUnionStmt (tokenInfo *const token) */ static void parseStructureStmt (tokenInfo *const token) { - tokenInfo *name; + tokenInfo *name = NULL; Assert (isKeyword (token, KEYWORD_structure)); readToken (token); if (isType (token, TOKEN_OPERATOR) && strcmp (vStringValue (token->string), "/") == 0) { /* read structure name */ readToken (token); - if (isType (token, TOKEN_IDENTIFIER)) - makeFortranTag (token, TAG_DERIVED_TYPE); - name = newTokenFrom (token); + if (isType (token, TOKEN_IDENTIFIER) || isType (token, TOKEN_KEYWORD)) + { + name = newTokenFrom (token); + name->type = TOKEN_IDENTIFIER; + } skipPast (token, TOKEN_OPERATOR); } - else + if (name == NULL) { /* fake out anonymous structure */ - name = newToken (); + name = newAnonTokenFrom (token, "Structure"); name->type = TOKEN_IDENTIFIER; name->tag = TAG_DERIVED_TYPE; - vStringCopyS (name->string, "anonymous"); } + makeFortranTag (name, TAG_DERIVED_TYPE); while (isType (token, TOKEN_IDENTIFIER)) { /* read field names */ makeFortranTag (token, TAG_COMPONENT); @@ -1694,8 +1737,11 @@ static void parseDerivedTypeDef (tokenInfo *const token) parseQualifierSpecList (token); if (isType (token, TOKEN_DOUBLE_COLON)) readToken (token); - if (isType (token, TOKEN_IDENTIFIER)) + if (isType (token, TOKEN_IDENTIFIER) || isType (token, TOKEN_KEYWORD)) + { + token->type = TOKEN_IDENTIFIER; makeFortranTag (token, TAG_DERIVED_TYPE); + } ancestorPush (token); skipToNextStatement (token); if (isKeyword (token, KEYWORD_private) || @@ -1743,29 +1789,27 @@ static void parseInterfaceBlock (tokenInfo *const token) tokenInfo *name = NULL; Assert (isKeyword (token, KEYWORD_interface)); readToken (token); - if (isType (token, TOKEN_IDENTIFIER)) - { - makeFortranTag (token, TAG_INTERFACE); - name = newTokenFrom (token); - } - else if (isKeyword (token, KEYWORD_assignment) || - isKeyword (token, KEYWORD_operator)) + if (isKeyword (token, KEYWORD_assignment) || + isKeyword (token, KEYWORD_operator)) { readToken (token); if (isType (token, TOKEN_PAREN_OPEN)) readToken (token); if (isType (token, TOKEN_OPERATOR)) - { - makeFortranTag (token, TAG_INTERFACE); name = newTokenFrom (token); - } + } + else if (isType (token, TOKEN_IDENTIFIER) || isType (token, TOKEN_KEYWORD)) + { + name = newTokenFrom (token); + name->type = TOKEN_IDENTIFIER; } if (name == NULL) { - name = newToken (); + name = newAnonTokenFrom (token, "Interface"); name->type = TOKEN_IDENTIFIER; name->tag = TAG_INTERFACE; } + makeFortranTag (name, TAG_INTERFACE); ancestorPush (name); while (! isKeyword (token, KEYWORD_end)) { @@ -1791,6 +1835,56 @@ static void parseInterfaceBlock (tokenInfo *const token) deleteToken (name); } +/* enum-block + * enum-stmt (is ENUM, BIND(C) [ :: type-alias-name ] + * or ENUM [ kind-selector ] [ :: ] [ type-alias-name ]) + * [ enum-body (is ENUMERATOR [ :: ] enumerator-list) ] + * end-enum-stmt (is END ENUM) + */ +static void parseEnumBlock (tokenInfo *const token) +{ + tokenInfo *name = NULL; + Assert (isKeyword (token, KEYWORD_enum)); + readToken (token); + if (isType (token, TOKEN_COMMA)) + { + readToken (token); + if (isType (token, TOKEN_KEYWORD)) + readToken (token); + if (isType (token, TOKEN_PAREN_OPEN)) + skipOverParens (token); + } + parseKindSelector (token); + if (isType (token, TOKEN_DOUBLE_COLON)) + readToken (token); + if (isType (token, TOKEN_IDENTIFIER) || isType (token, TOKEN_KEYWORD)) + { + name = newTokenFrom (token); + name->type = TOKEN_IDENTIFIER; + } + if (name == NULL) + { + name = newAnonTokenFrom (token, "Enum"); + name->type = TOKEN_IDENTIFIER; + name->tag = TAG_ENUM; + } + makeFortranTag (name, TAG_ENUM); + skipToNextStatement (token); + ancestorPush (name); + while (! isKeyword (token, KEYWORD_end)) + { + if (isTypeSpec (token)) + parseTypeDeclarationStmt (token); + else + skipToNextStatement (token); + } + readSubToken (token); + /* secondary token should be KEYWORD_enum token */ + skipToNextStatement (token); + ancestorPop (); + deleteToken (name); +} + /* entry-stmt is * ENTRY entry-name [ ( dummy-arg-list ) ] */ @@ -1872,6 +1966,7 @@ static boolean parseDeclarationConstruct (tokenInfo *const token) { case KEYWORD_entry: parseEntryStmt (token); break; case KEYWORD_interface: parseInterfaceBlock (token); break; + case KEYWORD_enum: parseEnumBlock (token); break; case KEYWORD_stdcall: readToken (token); break; /* derived type handled by parseTypeDeclarationStmt(); */ @@ -2022,8 +2117,11 @@ static void parseModule (tokenInfo *const token) { Assert (isKeyword (token, KEYWORD_module)); readToken (token); - if (isType (token, TOKEN_IDENTIFIER)) + if (isType (token, TOKEN_IDENTIFIER) || isType (token, TOKEN_KEYWORD)) + { + token->type = TOKEN_IDENTIFIER; makeFortranTag (token, TAG_MODULE); + } ancestorPush (token); skipToNextStatement (token); parseSpecificationPart (token); @@ -2079,6 +2177,7 @@ static boolean parseExecutionPart (tokenInfo *const token) case KEYWORD_end: readSubToken (token); if (isSecondaryKeyword (token, KEYWORD_do) || + isSecondaryKeyword (token, KEYWORD_enum) || isSecondaryKeyword (token, KEYWORD_if) || isSecondaryKeyword (token, KEYWORD_select) || isSecondaryKeyword (token, KEYWORD_where) || @@ -2102,8 +2201,11 @@ static void parseSubprogram (tokenInfo *const token, const tagType tag) isKeyword (token, KEYWORD_function) || isKeyword (token, KEYWORD_subroutine)); readToken (token); - if (isType (token, TOKEN_IDENTIFIER)) + if (isType (token, TOKEN_IDENTIFIER) || isType (token, TOKEN_KEYWORD)) + { + token->type = TOKEN_IDENTIFIER; makeFortranTag (token, tag); + } ancestorPush (token); skipToNextStatement (token); parseSpecificationPart (token); @@ -2207,7 +2309,9 @@ static boolean findFortranTags (const unsigned int passCount) Parent = newToken (); token = newToken (); FreeSourceForm = (boolean) (passCount > 1); + contextual_fake_count = 0; Column = 0; + NewLine = TRUE; exception = (exception_t) setjmp (Exception); if (exception == ExceptionEOF) retry = FALSE; Modified: tests/ctags/Makefile.am 8 files changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -20,6 +20,7 @@ test_sources = \ attributes.cs \ auto.f \ bit_field.c \ + block.f90 \ bracematch.js \ bug1020715.cpp \ bug1020715.c \ @@ -121,7 +122,9 @@ test_sources = \ directives.c \ dopbl2.f \ enum.c \ + enum.f90 \ enum.java \ + enumerators.f90 \ events.cs \ extern_variable.h \ forall_module.f90 \ @@ -138,6 +141,7 @@ test_sources = \ initialization.f90 \ interface_indexers.cs \ interface_properties.cs \ + interfaces.f90 \ internal.cs \ intro_orig.tex \ intro.tex \ @@ -156,6 +160,7 @@ test_sources = \ keyword_implicit.cs \ keyword_interface.cs \ keyword_namespace.cs \ + keyword_names.f90 \ keyword_out.cs \ keyword_override.cs \ keyword_params.cs \ @@ -176,6 +181,7 @@ test_sources = \ matlab_backtracking.m \ matlab_test.m \ maze.erl \ + members.f90 \ misc_types.f90 \ misc_types.f \ mode.php \ @@ -192,12 +198,14 @@ test_sources = \ objectivec_protocol.mm \ Package.pm \ php5_5_class_kw.php \ + preprocessor.f90 \ procedure_pointer_module.f90 \ procpoint.f90 \ property.cs \ prototype.h \ pure_elem.f95 \ py_constructor_arglist.py \ + qualified_types.f90 \ random.sql \ readlob.sql \ readlong.sql \ Modified: tests/ctags/array-spec.f90.tags 6 files changed, 5 insertions(+), 1 deletions(-) =================================================================== @@ -1,3 +1,7 @@ # format=tagmanager -df_typeÌ4096Îinm_dfÖ0 +df_mb_dataÌ64Îdf_typeÖ0 +df_mb_timeÌ64Îdf_typeÖ0 +df_typeÌ1Îinm_dfÖ0 +df_wb_dataÌ64Îdf_typeÖ0 +df_wb_timeÌ64Îdf_typeÖ0 inm_dfÌ256Ö0 Modified: tests/ctags/auto.f.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,5 +1,5 @@ # format=tagmanager -AUTO_TESTÌ512Ö0 +AUTO_TESTÌ2048Ö0 DÌ16384ÎAUTO_TESTÖ0 PÌ16384ÎAUTO_TESTÖ0 QÌ16384ÎAUTO_TESTÖ0 Modified: tests/ctags/block.f90 51 files changed, 51 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,51 @@ +module Blocks + implicit none + + integer :: i + +contains + + function MyFunc(thing) + integer, intent(in) :: thing + integer :: myfunc + + block + ! these obviously won't show up, because variables inside functions inside modules don't anyway + ! and that's fine + integer :: tempint + tempint = 1 + if (tempint == 1) then + tempint = 2 + end if + myfunc = tempint + end block + + end function MyFunc + +end module Blocks + +program Main + use Blocks + + implicit none + + ! these variable declarations should definitely show up in the symbol list + integer :: otherint, moreint + + otherint = 3 + + block + ! These shouldn't, because... + integer :: newtempint + + newtempint = 2 + block + ! ...the damn things can be arbitrarily nested! + integer :: newer_int + + newer_int = 3 + end block + newtempint = 2 * newtempint + end block + +end program Main Modified: tests/ctags/block.f90.tags 7 files changed, 7 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,7 @@ +# format=tagmanager +BlocksÌ256Ö0 +MainÌ2048Ö0 +MyFuncÌ16ÎBlocksÖ0 +iÌ16384ÎBlocksÖ0 +moreintÌ16384ÎMainÖ0 +otherintÌ16384ÎMainÖ0 Modified: tests/ctags/bug565813.f90.tags 7 files changed, 4 insertions(+), 3 deletions(-) =================================================================== @@ -1,7 +1,8 @@ # format=tagmanager NÌ16384Îctags_bugÖ0 +barÌ64Îfoo_tÖ0 ctags_bugÌ256Ö0 foo_getbarÌ16Îctags_bugÖ0 -foo_set_barÌ64Îctags_bugÖ0 -foo_setbarÌ64Îctags_bugÖ0 -foo_tÌ4096Îctags_bugÖ0 +foo_set_barÌ128Îctags_bugÖ0 +foo_setbarÌ128Îctags_bugÖ0 +foo_tÌ1Îctags_bugÖ0 Modified: tests/ctags/bug670433.f90.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,5 +1,5 @@ # format=tagmanager -barÌ64ÎfoobarÖ0 +barÌ128ÎfoobarÖ0 fÌ16ÎfooÖ0 fooÌ16ÎfoobarÖ0 foobarÌ256Ö0 Modified: tests/ctags/bug726712.f90.tags 6 files changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -1,4 +1,4 @@ # format=tagmanager -sub1Ì64Ö0 -sub2Ì64Ö0 -tagstest_ctrlÌ64Ö0 +sub1Ì128Ö0 +sub2Ì128Ö0 +tagstest_ctrlÌ128Ö0 Modified: tests/ctags/bug734933.f90.tags 11 files changed, 8 insertions(+), 3 deletions(-) =================================================================== @@ -1,12 +1,17 @@ # format=tagmanager -ADD_COMPONENTSÌ64ÎMDCOMPONENTSÖ0 +ADD_COMPONENTSÌ128ÎMDCOMPONENTSÖ0 COMPÌ16384ÎMDCOMPONENTSÖ0 -COMPONENTÌ4096ÎMDCOMPONENTSÖ0 +COMPONENTÌ1ÎMDCOMPONENTSÖ0 COMPONENTSÌ16384ÎMDCOMPONENTSÖ0 COMPONENTS_TMPÌ16384ÎMDCOMPONENTSÖ0 -COMPONENT_POINTERÌ4096ÎMDCOMPONENTSÖ0 +COMPONENT_POINTERÌ1ÎMDCOMPONENTSÖ0 COMP_TMPÌ16384ÎMDCOMPONENTSÖ0 LIM_COMPONENTSÌ16384ÎMDCOMPONENTSÖ0 MDCOMPONENTSÌ256Ö0 +MEMDEALLOCÌ32ÎMDCOMPONENTSÖ0 +NAMEÌ64ÎCOMPONENTÖ0 NCOMPÌ16384ÎMDCOMPONENTSÖ0 NUM_COMPONENTSÌ16384ÎMDCOMPONENTSÖ0 +NUM_PARTÌ64ÎCOMPONENTÖ0 +PÌ64ÎCOMPONENT_POINTERÖ0 +PART_LISTÌ64ÎCOMPONENTÖ0 Modified: tests/ctags/bug858165.f90.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -3,4 +3,4 @@ a bÌ16384ÎtestÖ0 cÌ16384ÎtestÖ0 dÌ16384ÎtestÖ0 -testÌ512Ö0 +testÌ2048Ö0 Modified: tests/ctags/bug877956.f90.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,4 +1,4 @@ # format=tagmanager c2Ì16384ÎtestÖ0 cm1Ì16384ÎtestÖ0 -testÌ512Ö0 +testÌ2048Ö0 Modified: tests/ctags/byte.f.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -8,4 +8,4 @@ B2 CÌ16384Îbyte_testÖ0 C1Ì16384Îbyte_testÖ0 C2Ì16384Îbyte_testÖ0 -byte_testÌ512Ö0 +byte_testÌ2048Ö0 Modified: tests/ctags/common.f.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -2,4 +2,4 @@ common1Ì65536ÎmainÖ0 common2Ì65536ÎmainÖ0 common3Ì65536ÎmainÖ0 -mainÌ512Ö0 +mainÌ2048Ö0 Modified: tests/ctags/debian_432872.f90.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,3 +1,3 @@ # format=tagmanager FOOÌ256Ö0 -FOOÌ64ÎFOOÖ0 +FOOÌ128ÎFOOÖ0 Modified: tests/ctags/enum.f90 52 files changed, 52 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,52 @@ +module Constants + implicit none + + real, parameter :: pi = 4 * atan(1.0) + real, parameter :: E_e = 510998.91013 + + ! we now have enumerators in F2003/8, for the sake of interop with C + enum, bind(c) ! unnamed 1 + enumerator :: red =1, blue, black =5 + enumerator yellow + enumerator gold, silver, bronze + enumerator :: purple + enumerator :: pink, lavender + end enum + + enum ! unnamed 2 + enumerator :: a, b, c + end enum + + enum :: Named1 + enumerator :: x1, y1, z1 + end enum + + enum Named2 + enumerator :: x2, y2, z2 + end enum + + enum(8) Named3 + enumerator :: x3, y3, z3 + end enum + + enum*8 Named4 + enumerator :: x4, y4, z4 + end enum + + enum(8) :: Named5 + enumerator :: x5, y5, z5 + end enum + + enum*8 :: Named6 + enumerator :: x6, y6, z6 + end enum + + enum, bind(c) :: Named7 + enumerator :: x7, y7, z7 + end enum + + real, parameter :: hc = 12398.4193 + + public + +end module Constants Modified: tests/ctags/enum.f90.tags 48 files changed, 48 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,48 @@ +# format=tagmanager +ConstantsÌ256Ö0 +E_eÌ16384ÎConstantsÖ0 +Enum#0Ì2ÎConstantsÖ0 +Enum#1Ì2ÎConstantsÖ0 +Named1Ì2ÎConstantsÖ0 +Named2Ì2ÎConstantsÖ0 +Named3Ì2ÎConstantsÖ0 +Named4Ì2ÎConstantsÖ0 +Named5Ì2ÎConstantsÖ0 +Named6Ì2ÎConstantsÖ0 +Named7Ì2ÎConstantsÖ0 +aÌ4ÎEnum#1Ö0 +bÌ4ÎEnum#1Ö0 +blackÌ4ÎEnum#0Ö0 +blueÌ4ÎEnum#0Ö0 +bronzeÌ4ÎEnum#0Ö0 +cÌ4ÎEnum#1Ö0 +goldÌ4ÎEnum#0Ö0 +hcÌ16384ÎConstantsÖ0 +lavenderÌ4ÎEnum#0Ö0 +piÌ16384ÎConstantsÖ0 +pinkÌ4ÎEnum#0Ö0 +purpleÌ4ÎEnum#0Ö0 +redÌ4ÎEnum#0Ö0 +silverÌ4ÎEnum#0Ö0 +x1Ì4ÎNamed1Ö0 +x2Ì4ÎNamed2Ö0 +x3Ì4ÎNamed3Ö0 +x4Ì4ÎNamed4Ö0 +x5Ì4ÎNamed5Ö0 +x6Ì4ÎNamed6Ö0 +x7Ì4ÎNamed7Ö0 +y1Ì4ÎNamed1Ö0 +y2Ì4ÎNamed2Ö0 +y3Ì4ÎNamed3Ö0 +y4Ì4ÎNamed4Ö0 +y5Ì4ÎNamed5Ö0 +y6Ì4ÎNamed6Ö0 +y7Ì4ÎNamed7Ö0 +yellowÌ4ÎEnum#0Ö0 +z1Ì4ÎNamed1Ö0 +z2Ì4ÎNamed2Ö0 +z3Ì4ÎNamed3Ö0 +z4Ì4ÎNamed4Ö0 +z5Ì4ÎNamed5Ö0 +z6Ì4ÎNamed6Ö0 +z7Ì4ÎNamed7Ö0 Modified: tests/ctags/enumerators.f90 55 files changed, 55 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,55 @@ +module Enums + real :: somevar + + ! we now have enumerators in F2003/8, for the sake of interop with C + enum, bind(c) ! unnamed 1 + enumerator :: red =1, blue + enumerator gold, silver, bronze + enumerator :: purple + end enum + + + ! here follow nonstandard enum declarations, which may become valid in a later standard + ! no real harm implementing these as long as valid stuff isn't broken + enum + enumerator :: no_c_binding + end enum + + enum :: Colons + enumerator :: r + end enum + + enum BodyPart + enumerator :: arm, leg + end enum + + enum(8) Paren_kind + enumerator :: b + end enum + + enum*8 Aster_kind + enumerator :: c + end enum + + enum(8) :: Paren_colon + enumerator :: d + end enum + + enum*8 :: Aster_colon + enumerator :: e + end enum + + enum, bind(c) :: Name_colon + enumerator :: d + end enum + + ! another entry to verify the parsing hasn't broken + real, parameter :: othervar + +contains + + function Func(arg) + ! ... + end function Func + +end module Enums Modified: tests/ctags/enumerators.f90.tags 29 files changed, 29 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,29 @@ +# format=tagmanager +Aster_colonÌ2ÎEnumsÖ0 +Aster_kindÌ2ÎEnumsÖ0 +BodyPartÌ2ÎEnumsÖ0 +ColonsÌ2ÎEnumsÖ0 +Enum#0Ì2ÎEnumsÖ0 +Enum#1Ì2ÎEnumsÖ0 +EnumsÌ256Ö0 +FuncÌ16ÎEnumsÖ0 +Name_colonÌ2ÎEnumsÖ0 +Paren_colonÌ2ÎEnumsÖ0 +Paren_kindÌ2ÎEnumsÖ0 +armÌ4ÎBodyPartÖ0 +bÌ4ÎParen_kindÖ0 +blueÌ4ÎEnum#0Ö0 +bronzeÌ4ÎEnum#0Ö0 +cÌ4ÎAster_kindÖ0 +dÌ4ÎName_colonÖ0 +dÌ4ÎParen_colonÖ0 +eÌ4ÎAster_colonÖ0 +goldÌ4ÎEnum#0Ö0 +legÌ4ÎBodyPartÖ0 +no_c_bindingÌ4ÎEnum#1Ö0 +othervarÌ16384ÎEnumsÖ0 +purpleÌ4ÎEnum#0Ö0 +rÌ4ÎColonsÖ0 +redÌ4ÎEnum#0Ö0 +silverÌ4ÎEnum#0Ö0 +somevarÌ16384ÎEnumsÖ0 Modified: tests/ctags/forall_module.f90.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,5 +1,5 @@ # format=tagmanager aÌ16384Îwith_forallÖ0 -sub_with_forallÌ64Îwith_forallÖ0 +sub_with_forallÌ128Îwith_forallÖ0 twoÌ16Îwith_forallÖ0 with_forallÌ256Ö0 Modified: tests/ctags/fortran_associate.f90.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,5 +1,5 @@ # format=tagmanager aÌ16384Îwith_associateÖ0 -do_other_stuffÌ64Îwith_associateÖ0 +do_other_stuffÌ128Îwith_associateÖ0 do_stuffÌ16Îwith_associateÖ0 with_associateÌ256Ö0 Modified: tests/ctags/interfaces.f90 45 files changed, 45 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,45 @@ +module HasInterfaces + ! INTERFACE blocks can have names + ! usually only used for when overloading, but good practice anyway! + interface MyFunc + function Func1(arg) + integer :: arg + end function Func1 + + function Func2(arg) + integer :: arg + end function Func2 + end interface MyFunc + + ! without a name we just use a generic one + interface + subroutine CHEEV(...) + ! ... + end subroutine CHEEV + end interface + +contains + + function Func1(arg) + integer :: arg, func1 + func1 = arg + end function Func1 + + function Func2(arg) + integer :: arg, func2 + func2 = arg + end function Func2 + +end module HasInterfaces + +program Main + use HasInterfaces + + ! can also occur in PROGRAMs + interface MySubroutine + subroutine Sub1(arg) + ! ... + end subroutine Sub1 + end interface MySubroutine + +end program Main Modified: tests/ctags/interfaces.f90.tags 8 files changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,8 @@ +# format=tagmanager +Func1Ì16ÎHasInterfacesÖ0 +Func2Ì16ÎHasInterfacesÖ0 +HasInterfacesÌ256Ö0 +Interface#0Ì32ÎHasInterfacesÖ0 +MainÌ2048Ö0 +MyFuncÌ32ÎHasInterfacesÖ0 +MySubroutineÌ32ÎMainÖ0 Modified: tests/ctags/invalid_name.f90.tags 5 files changed, 4 insertions(+), 1 deletions(-) =================================================================== @@ -1,5 +1,8 @@ # format=tagmanager +ActivityÌ64ÎDetection_RecordÖ0 DR_FilenameÌ16384ÎTR_DetectionRecordingÖ0 DR_LunÌ16384ÎTR_DetectionRecordingÖ0 -Detection_RecordÌ4096ÎTR_DetectionRecordingÖ0 +Detection_RecordÌ1ÎTR_DetectionRecordingÖ0 +FaceÌ64ÎDetection_RecordÖ0 TR_DetectionRecordingÌ256Ö0 +TypeÌ64ÎDetection_RecordÖ0 Modified: tests/ctags/keyword_names.f90 28 files changed, 28 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,28 @@ +! For some reason, the Fortran standard does not prohibit this... + +module Program + + type Data + integer :: contents + end type Data + + integer :: i + + interface Program + function myFunc(arg) + !... + end function myFunc + end interface Program + +contains + + function MyFunc(arg) + ! ... + end function MyFunc + +end module Program + +program Interface + use Program + ! ... +end program Interface Modified: tests/ctags/keyword_names.f90.tags 8 files changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,8 @@ +# format=tagmanager +DataÌ1ÎProgramÖ0 +InterfaceÌ2048Ö0 +MyFuncÌ16ÎProgramÖ0 +ProgramÌ256Ö0 +ProgramÌ32ÎProgramÖ0 +contentsÌ64ÎDataÖ0 +iÌ16384ÎProgramÖ0 Modified: tests/ctags/members.f90 19 files changed, 19 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,19 @@ +module Members + implicit none + + type HasMembers + ! a "derived type" in Fortran is analagous to a "class" in other languages + integer, kind :: kind_member + integer, len :: len_member + integer :: member + contains + procedure :: MyMethod + end type HasMembers + +contains + + subroutine MySubroutine(arg) + ! ... + end subroutine MySubroutine + +end module Members Modified: tests/ctags/members.f90.tags 8 files changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,8 @@ +# format=tagmanager +HasMembersÌ1ÎMembersÖ0 +MembersÌ256Ö0 +MyMethodÌ64ÎHasMembersÖ0 +MySubroutineÌ128ÎMembersÖ0 +kind_memberÌ64ÎHasMembersÖ0 +len_memberÌ64ÎHasMembersÖ0 +memberÌ64ÎHasMembersÖ0 Modified: tests/ctags/misc_types.f.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,4 +1,4 @@ # format=tagmanager INFOOBARÌ16384ÎspecsÖ0 MÌ16384ÎspecsÖ0 -specsÌ512Ö0 +specsÌ2048Ö0 Modified: tests/ctags/misc_types.f90.tags 6 files changed, 4 insertions(+), 2 deletions(-) =================================================================== @@ -1,5 +1,7 @@ # format=tagmanager +align_second_16Ì64Îmy_structÖ0 base_typeÌ16384ÎtestallocÖ0 +first_byteÌ64Îmy_structÖ0 iÌ16384ÎtestallocÖ0 i2Ì16384ÎtestallocÖ0 i3Ì16384ÎtestallocÖ0 @@ -9,7 +11,7 @@ i6 i7Ì16384ÎtestallocÖ0 i8Ì16384ÎtestallocÖ0 listÌ16384ÎtestallocÖ0 -my_structÌ4096ÎtestallocÖ0 +my_structÌ1ÎtestallocÖ0 statusÌ16384ÎtestallocÖ0 -testallocÌ512Ö0 +testallocÌ2048Ö0 the_structÌ16384ÎtestallocÖ0 Modified: tests/ctags/namelist.f.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,2 +1,2 @@ # format=tagmanager -mainÌ512Ö0 +mainÌ2048Ö0 Modified: tests/ctags/numlib.f90.tags 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -1,2 +1,3 @@ # format=tagmanager +Interface#0Ì32Înumerical_librariesÖ0 numerical_librariesÌ256Ö0 Modified: tests/ctags/preprocessor.f90 17 files changed, 17 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,17 @@ +#include +! preprocessor directives on line 1 (and only line 1) cause breakage +module Invisible + + integer :: nope + +contains + + function SpillsOutside + ! ... + end function SpillsOutside + +end module Invisible + +program Main +! ... +end program Main Modified: tests/ctags/preprocessor.f90.tags 5 files changed, 5 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,5 @@ +# format=tagmanager +InvisibleÌ256Ö0 +MainÌ2048Ö0 +SpillsOutsideÌ16ÎInvisibleÖ0 +nopeÌ16384ÎInvisibleÖ0 Modified: tests/ctags/procedure_pointer_module.f90.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -2,4 +2,4 @@ aĚ16384Îproc_pointerÖ0 my_pointerĚ16384Îproc_pointerÖ0 proc_pointerĚ256Ö0 -subĚ64Îproc_pointerÖ0 +subĚ128Îproc_pointerÖ0 Modified: tests/ctags/procpoint.f90.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,5 +1,5 @@ # format=tagmanager -MainÌ512Ö0 +MainÌ2048Ö0 MyOtherProcÌ16384ÎTestÖ0 MyProcÌ16384ÎTestÖ0 ProcOneÌ16ÎTestÖ0 Modified: tests/ctags/qualified_types.f90 12 files changed, 12 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,12 @@ +module test + implicit none + type goodtype(p1, p2, p3, p4) ! the stuff in brackets after the name of the type shouldn't appear in the type's name + ! this is already correctly handled, so that's fine + integer, kind :: p1, p3 + integer, len :: p2, p4 ! the question is whether or not these "kind" and "len"s should be shown as members + real(kind=p1) :: c1 + character(len=p2) :: c2 + complex :: c3(p3) + integer :: c4 = p1 +contains +end module test Modified: tests/ctags/qualified_types.f90.tags 11 files changed, 11 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,11 @@ +# format=tagmanager +c1フ64ホgoodtypeヨ0 +c2フ64ホgoodtypeヨ0 +c3フ64ホgoodtypeヨ0 +c4フ64ホgoodtypeヨ0 +goodtypeフ1ホtestヨ0 +p1フ64ホgoodtypeヨ0 +p2フ64ホgoodtypeヨ0 +p3フ64ホgoodtypeヨ0 +p4フ64ホgoodtypeヨ0 +testフ256ヨ0 Modified: tests/ctags/recursive.f95.tags 2 files changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -1,4 +1,6 @@ # format=tagmanager +Interface#0Ì32ÎapproxÖ0 +Interface#1Ì32Îapprox2Ö0 approxÌ256Ö0 approx2Ì256Ö0 partsÌ16384ÎapproxÖ0 Modified: tests/ctags/square_parens.f90.tags 8 files changed, 5 insertions(+), 3 deletions(-) =================================================================== @@ -1,12 +1,14 @@ # format=tagmanager -SymmetryĚ4096ÎsquaretestÖ0 +SymmetryĚ1ÎsquaretestÖ0 assigneeĚ16384ÎsquaretestÖ0 -executeĚ64ÎsquaretestÖ0 +executeĚ128ÎsquaretestÖ0 invisibleĚ16384ÎsquaretestÖ0 invisible_fourĚ16384ÎsquaretestÖ0 invisible_threeĚ16384ÎsquaretestÖ0 invisible_twoĚ16384ÎsquaretestÖ0 -mainĚ512Ö0 +iterationsĚ64ÎSymmetryÖ0 +mainĚ2048Ö0 +matrixĚ64ÎSymmetryÖ0 squaretestĚ256Ö0 stateĚ16384ÎsquaretestÖ0 state_twoĚ16384ÎsquaretestÖ0 Modified: tests/ctags/stdcall.f.tags 4 files changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -1,6 +1,6 @@ # format=tagmanager D02CJWÌ16384Ö0 -FCNÌ64Ö0 +FCNÌ128Ö0 GÌ16Ö0 GÌ16384Ö0 HÌ16384Ö0 @@ -11,7 +11,7 @@ J KÌ16384Ö0 NÌ16384Ö0 NOUTÌ16384Ö0 -OUTÌ64Ö0 +OUTÌ128Ö0 PIÌ16384Ö0 RELABSÌ16384Ö0 TOLÌ16384Ö0 Modified: tests/ctags/structure.f.tags 24 files changed, 17 insertions(+), 7 deletions(-) =================================================================== @@ -1,10 +1,20 @@ # format=tagmanager -initialized_structureÌ512Ö0 +Structure#0Ì1ÎnestedÖ0 +aÌ64ÎStructure#0Ö0 +cloudsÌ64ÎweatherÖ0 +dayÌ64ÎweatherÖ0 +initialized_structureÌ2048Ö0 latestÌ16384Îinitialized_structureÖ0 latestÌ16384Îuninitialized_structureÖ0 -nestedÌ4096ÎtopÖ0 -nested_structureÌ512Ö0 -topÌ4096Înested_structureÖ0 -uninitialized_structureÌ512Ö0 -weatherÌ4096Îinitialized_structureÖ0 -weatherÌ4096Îuninitialized_structureÖ0 +level2Ì64ÎtopÖ0 +level3aÌ64ÎnestedÖ0 +level3bÌ64ÎnestedÖ0 +monthÌ64ÎweatherÖ0 +nestedÌ1ÎtopÖ0 +nested_structureÌ2048Ö0 +rainfallÌ64ÎweatherÖ0 +topÌ1Înested_structureÖ0 +uninitialized_structureÌ2048Ö0 +weatherÌ1Îinitialized_structureÖ0 +weatherÌ1Îuninitialized_structureÖ0 +yearÌ64ÎweatherÖ0 Modified: tests/ctags/union.f.tags 8 files changed, 6 insertions(+), 2 deletions(-) =================================================================== @@ -1,4 +1,8 @@ # format=tagmanager +dateÌ64ÎstartÖ0 +dayÌ64ÎstartÖ0 +monthÌ64ÎstartÖ0 sdateÌ16384ÎwritedateÖ0 -startÌ4096ÎwritedateÖ0 -writedateÌ512Ö0 +startÌ1ÎwritedateÖ0 +writedateÌ2048Ö0 +yearÌ64ÎstartÖ0 Modified: tests/ctags/value.f.tags 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,4 +1,4 @@ # format=tagmanager aaÌ16384ÎfigureÖ0 figÌ16384ÎfigureÖ0 -figureÌ512Ö0 +figureÌ2048Ö0 -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 5965b5: Fortran: add a few more test cases
by Adam Hirst
23 Feb '14
23 Feb '14
Branch: refs/heads/master Author: Adam Hirst <adam(a)aphirst.karoo.co.uk> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 23 Feb 2014 19:16:29 UTC Commit: 5965b5ebd3797b846ff3b92e9a5079d0834537f1
https://github.com/geany/geany/commit/5965b5ebd3797b846ff3b92e9a5079d083453…
Log Message: ----------- Fortran: add a few more test cases Modified Paths: -------------- tests/ctags/Makefile.am tests/ctags/block.f90 tests/ctags/block.f90.tags tests/ctags/interfaces.f90 tests/ctags/interfaces.f90.tags Modified: tests/ctags/Makefile.am 2 files changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -20,6 +20,7 @@ test_sources = \ attributes.cs \ auto.f \ bit_field.c \ + block.f90 \ bracematch.js \ bug1020715.cpp \ bug1020715.c \ @@ -140,6 +141,7 @@ test_sources = \ initialization.f90 \ interface_indexers.cs \ interface_properties.cs \ + interfaces.f90 \ internal.cs \ intro_orig.tex \ intro.tex \ Modified: tests/ctags/block.f90 51 files changed, 51 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,51 @@ +module Blocks + implicit none + + integer :: i + +contains + + function MyFunc(thing) + integer, intent(in) :: thing + integer :: myfunc + + block + ! these obviously won't show up, because variables inside functions inside modules don't anyway + ! and that's fine + integer :: tempint + tempint = 1 + if (tempint == 1) then + tempint = 2 + end if + myfunc = tempint + end block + + end function MyFunc + +end module Blocks + +program Main + use Blocks + + implicit none + + ! these variable declarations should definitely show up in the symbol list + integer :: otherint, moreint + + otherint = 3 + + block + ! These shouldn't, because... + integer :: newtempint + + newtempint = 2 + block + ! ...the damn things can be arbitrarily nested! + integer :: newer_int + + newer_int = 3 + end block + newtempint = 2 * newtempint + end block + +end program Main Modified: tests/ctags/block.f90.tags 7 files changed, 7 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,7 @@ +# format=tagmanager +BlocksÌ256Ö0 +MainÌ2048Ö0 +MyFuncÌ16ÎBlocksÖ0 +iÌ16384ÎBlocksÖ0 +moreintÌ16384ÎMainÖ0 +otherintÌ16384ÎMainÖ0 Modified: tests/ctags/interfaces.f90 45 files changed, 45 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,45 @@ +module HasInterfaces + ! INTERFACE blocks can have names + ! usually only used for when overloading, but good practice anyway! + interface MyFunc + function Func1(arg) + integer :: arg + end function Func1 + + function Func2(arg) + integer :: arg + end function Func2 + end interface MyFunc + + ! without a name we just use a generic one + interface + subroutine CHEEV(...) + ! ... + end subroutine CHEEV + end interface + +contains + + function Func1(arg) + integer :: arg, func1 + func1 = arg + end function Func1 + + function Func2(arg) + integer :: arg, func2 + func2 = arg + end function Func2 + +end module HasInterfaces + +program Main + use HasInterfaces + + ! can also occur in PROGRAMs + interface MySubroutine + subroutine Sub1(arg) + ! ... + end subroutine Sub1 + end interface MySubroutine + +end program Main Modified: tests/ctags/interfaces.f90.tags 8 files changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,8 @@ +# format=tagmanager +Func1Ì16ÎHasInterfacesÖ0 +Func2Ì16ÎHasInterfacesÖ0 +HasInterfacesÌ256Ö0 +Interface#0Ì32ÎHasInterfacesÖ0 +MainÌ2048Ö0 +MyFuncÌ32ÎHasInterfacesÖ0 +MySubroutineÌ32ÎMainÖ0 -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] d8954b: Fortran: add support for "len" and "kind" qualifiers
by Colomban Wendling
23 Feb '14
23 Feb '14
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 23 Feb 2014 19:13:36 UTC Commit: d8954bbf67d575883a3fb3687e776cb92793d88c
https://github.com/geany/geany/commit/d8954bbf67d575883a3fb3687e776cb92793d…
Log Message: ----------- Fortran: add support for "len" and "kind" qualifiers Test cases contributed by Adam Hirst, thanks. Modified Paths: -------------- tagmanager/ctags/fortran.c tests/ctags/Makefile.am tests/ctags/members.f90 tests/ctags/members.f90.tags tests/ctags/qualified_types.f90 tests/ctags/qualified_types.f90.tags Modified: tagmanager/ctags/fortran.c 6 files changed, 6 insertions(+), 0 deletions(-) =================================================================== @@ -100,6 +100,8 @@ KEYWORD_intent, KEYWORD_interface, KEYWORD_intrinsic, + KEYWORD_kind, + KEYWORD_len, KEYWORD_logical, KEYWORD_map, KEYWORD_module, @@ -280,6 +282,8 @@ { "intent", KEYWORD_intent }, { "interface", KEYWORD_interface }, { "intrinsic", KEYWORD_intrinsic }, + { "kind", KEYWORD_kind }, + { "len", KEYWORD_len }, { "logical", KEYWORD_logical }, { "map", KEYWORD_map }, { "module", KEYWORD_module }, @@ -1331,6 +1335,8 @@ static void parseQualifierSpecList (tokenInfo *const token) case KEYWORD_allocatable: case KEYWORD_external: case KEYWORD_intrinsic: + case KEYWORD_kind: + case KEYWORD_len: case KEYWORD_optional: case KEYWORD_private: case KEYWORD_pointer: Modified: tests/ctags/Makefile.am 2 files changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -179,6 +179,7 @@ test_sources = \ matlab_backtracking.m \ matlab_test.m \ maze.erl \ + members.f90 \ misc_types.f90 \ misc_types.f \ mode.php \ @@ -202,6 +203,7 @@ test_sources = \ prototype.h \ pure_elem.f95 \ py_constructor_arglist.py \ + qualified_types.f90 \ random.sql \ readlob.sql \ readlong.sql \ Modified: tests/ctags/members.f90 19 files changed, 19 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,19 @@ +module Members + implicit none + + type HasMembers + ! a "derived type" in Fortran is analagous to a "class" in other languages + integer, kind :: kind_member + integer, len :: len_member + integer :: member + contains + procedure :: MyMethod + end type HasMembers + +contains + + subroutine MySubroutine(arg) + ! ... + end subroutine MySubroutine + +end module Members Modified: tests/ctags/members.f90.tags 8 files changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,8 @@ +# format=tagmanager +HasMembersÌ1ÎMembersÖ0 +MembersÌ256Ö0 +MyMethodÌ64ÎHasMembersÖ0 +MySubroutineÌ128ÎMembersÖ0 +kind_memberÌ64ÎHasMembersÖ0 +len_memberÌ64ÎHasMembersÖ0 +memberÌ64ÎHasMembersÖ0 Modified: tests/ctags/qualified_types.f90 12 files changed, 12 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,12 @@ +module test + implicit none + type goodtype(p1, p2, p3, p4) ! the stuff in brackets after the name of the type shouldn't appear in the type's name + ! this is already correctly handled, so that's fine + integer, kind :: p1, p3 + integer, len :: p2, p4 ! the question is whether or not these "kind" and "len"s should be shown as members + real(kind=p1) :: c1 + character(len=p2) :: c2 + complex :: c3(p3) + integer :: c4 = p1 +contains +end module test Modified: tests/ctags/qualified_types.f90.tags 11 files changed, 11 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,11 @@ +# format=tagmanager +c1フ64ホgoodtypeヨ0 +c2フ64ホgoodtypeヨ0 +c3フ64ホgoodtypeヨ0 +c4フ64ホgoodtypeヨ0 +goodtypeフ1ホtestヨ0 +p1フ64ホgoodtypeヨ0 +p2フ64ホgoodtypeヨ0 +p3フ64ホgoodtypeヨ0 +p4フ64ホgoodtypeヨ0 +testフ256ヨ0 -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] ed1dc5: Fortran: allow keywords as names
by Colomban Wendling
23 Feb '14
23 Feb '14
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 23 Feb 2014 19:11:00 UTC Commit: ed1dc50062c27e1c00d94404d96e6bc3dd051e29
https://github.com/geany/geany/commit/ed1dc50062c27e1c00d94404d96e6bc3dd051…
Log Message: ----------- Fortran: allow keywords as names Allow keywords for names of modules, programs, types, interfaces, structures and enums. Test case contributed by Adam Hirst, thanks. Modified Paths: -------------- tagmanager/ctags/fortran.c tests/ctags/Makefile.am tests/ctags/keyword_names.f90 tests/ctags/keyword_names.f90.tags Modified: tagmanager/ctags/fortran.c 38 files changed, 27 insertions(+), 11 deletions(-) =================================================================== @@ -1610,8 +1610,11 @@ static void parseStructureStmt (tokenInfo *const token) strcmp (vStringValue (token->string), "/") == 0) { /* read structure name */ readToken (token); - if (isType (token, TOKEN_IDENTIFIER)) + if (isType (token, TOKEN_IDENTIFIER) || isType (token, TOKEN_KEYWORD)) + { name = newTokenFrom (token); + name->type = TOKEN_IDENTIFIER; + } skipPast (token, TOKEN_OPERATOR); } if (name == NULL) @@ -1728,8 +1731,11 @@ static void parseDerivedTypeDef (tokenInfo *const token) parseQualifierSpecList (token); if (isType (token, TOKEN_DOUBLE_COLON)) readToken (token); - if (isType (token, TOKEN_IDENTIFIER)) + if (isType (token, TOKEN_IDENTIFIER) || isType (token, TOKEN_KEYWORD)) + { + token->type = TOKEN_IDENTIFIER; makeFortranTag (token, TAG_DERIVED_TYPE); + } ancestorPush (token); skipToNextStatement (token); if (isKeyword (token, KEYWORD_private) || @@ -1777,12 +1783,8 @@ static void parseInterfaceBlock (tokenInfo *const token) tokenInfo *name = NULL; Assert (isKeyword (token, KEYWORD_interface)); readToken (token); - if (isType (token, TOKEN_IDENTIFIER)) - { - name = newTokenFrom (token); - } - else if (isKeyword (token, KEYWORD_assignment) || - isKeyword (token, KEYWORD_operator)) + if (isKeyword (token, KEYWORD_assignment) || + isKeyword (token, KEYWORD_operator)) { readToken (token); if (isType (token, TOKEN_PAREN_OPEN)) @@ -1790,6 +1792,11 @@ static void parseInterfaceBlock (tokenInfo *const token) if (isType (token, TOKEN_OPERATOR)) name = newTokenFrom (token); } + else if (isType (token, TOKEN_IDENTIFIER) || isType (token, TOKEN_KEYWORD)) + { + name = newTokenFrom (token); + name->type = TOKEN_IDENTIFIER; + } if (name == NULL) { name = newAnonTokenFrom (token, "Interface"); @@ -1844,8 +1851,11 @@ static void parseEnumBlock (tokenInfo *const token) parseKindSelector (token); if (isType (token, TOKEN_DOUBLE_COLON)) readToken (token); - if (isType (token, TOKEN_IDENTIFIER)) + if (isType (token, TOKEN_IDENTIFIER) || isType (token, TOKEN_KEYWORD)) + { name = newTokenFrom (token); + name->type = TOKEN_IDENTIFIER; + } if (name == NULL) { name = newAnonTokenFrom (token, "Enum"); @@ -2101,8 +2111,11 @@ static void parseModule (tokenInfo *const token) { Assert (isKeyword (token, KEYWORD_module)); readToken (token); - if (isType (token, TOKEN_IDENTIFIER)) + if (isType (token, TOKEN_IDENTIFIER) || isType (token, TOKEN_KEYWORD)) + { + token->type = TOKEN_IDENTIFIER; makeFortranTag (token, TAG_MODULE); + } ancestorPush (token); skipToNextStatement (token); parseSpecificationPart (token); @@ -2182,8 +2195,11 @@ static void parseSubprogram (tokenInfo *const token, const tagType tag) isKeyword (token, KEYWORD_function) || isKeyword (token, KEYWORD_subroutine)); readToken (token); - if (isType (token, TOKEN_IDENTIFIER)) + if (isType (token, TOKEN_IDENTIFIER) || isType (token, TOKEN_KEYWORD)) + { + token->type = TOKEN_IDENTIFIER; makeFortranTag (token, tag); + } ancestorPush (token); skipToNextStatement (token); parseSpecificationPart (token); Modified: tests/ctags/Makefile.am 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -158,6 +158,7 @@ test_sources = \ keyword_implicit.cs \ keyword_interface.cs \ keyword_namespace.cs \ + keyword_names.f90 \ keyword_out.cs \ keyword_override.cs \ keyword_params.cs \ Modified: tests/ctags/keyword_names.f90 28 files changed, 28 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,28 @@ +! For some reason, the Fortran standard does not prohibit this... + +module Program + + type Data + integer :: contents + end type Data + + integer :: i + + interface Program + function myFunc(arg) + !... + end function myFunc + end interface Program + +contains + + function MyFunc(arg) + ! ... + end function MyFunc + +end module Program + +program Interface + use Program + ! ... +end program Interface Modified: tests/ctags/keyword_names.f90.tags 8 files changed, 8 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,8 @@ +# format=tagmanager +DataÌ1ÎProgramÖ0 +InterfaceÌ2048Ö0 +MyFuncÌ16ÎProgramÖ0 +ProgramÌ256Ö0 +ProgramÌ32ÎProgramÖ0 +contentsÌ64ÎDataÖ0 +iÌ16384ÎProgramÖ0 -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] e47d45: Fortran: fix handling of preprocessor directives on the first line
by Colomban Wendling
23 Feb '14
23 Feb '14
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 23 Feb 2014 19:10:35 UTC Commit: e47d45eb281a968b733241aab431c045d61569f9
https://github.com/geany/geany/commit/e47d45eb281a968b733241aab431c045d6156…
Log Message: ----------- Fortran: fix handling of preprocessor directives on the first line Fix a race initialization leading to incorrect handling of preprocessor directives on the first input line. Test case contributed by Adam Hirst, thanks. Modified Paths: -------------- tagmanager/ctags/fortran.c tests/ctags/Makefile.am tests/ctags/preprocessor.f90 tests/ctags/preprocessor.f90.tags Modified: tagmanager/ctags/fortran.c 13 files changed, 7 insertions(+), 6 deletions(-) =================================================================== @@ -208,6 +208,7 @@ static boolean FreeSourceForm = FALSE; static boolean ParsingString; static tokenInfo *Parent = NULL; +static boolean NewLine = TRUE; static unsigned int contextual_fake_count = 0; /* indexed by tagType */ @@ -725,7 +726,6 @@ static int skipToNextLine (void) static int getFreeFormChar (boolean inComment) { - static boolean newline = TRUE; boolean advanceLine = FALSE; int c = fileGetc (); @@ -740,7 +740,7 @@ static int getFreeFormChar (boolean inComment) while (isspace (c) && c != '\n'); if (c == '\n') { - newline = TRUE; + NewLine = TRUE; advanceLine = TRUE; } else if (c == '!') @@ -751,16 +751,16 @@ static int getFreeFormChar (boolean inComment) c = '&'; } } - else if (newline && (c == '!' || c == '#')) + else if (NewLine && (c == '!' || c == '#')) advanceLine = TRUE; while (advanceLine) { while (isspace (c)) c = fileGetc (); - if (c == '!' || (newline && c == '#')) + if (c == '!' || (NewLine && c == '#')) { c = skipToNextLine (); - newline = TRUE; + NewLine = TRUE; continue; } if (c == '&') @@ -768,7 +768,7 @@ static int getFreeFormChar (boolean inComment) else advanceLine = FALSE; } - newline = (boolean) (c == '\n'); + NewLine = (boolean) (c == '\n'); return c; } @@ -2289,6 +2289,7 @@ static boolean findFortranTags (const unsigned int passCount) FreeSourceForm = (boolean) (passCount > 1); contextual_fake_count = 0; Column = 0; + NewLine = TRUE; exception = (exception_t) setjmp (Exception); if (exception == ExceptionEOF) retry = FALSE; Modified: tests/ctags/Makefile.am 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -194,6 +194,7 @@ test_sources = \ objectivec_protocol.mm \ Package.pm \ php5_5_class_kw.php \ + preprocessor.f90 \ procedure_pointer_module.f90 \ procpoint.f90 \ property.cs \ Modified: tests/ctags/preprocessor.f90 17 files changed, 17 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,17 @@ +#include +! preprocessor directives on line 1 (and only line 1) cause breakage +module Invisible + + integer :: nope + +contains + + function SpillsOutside + ! ... + end function SpillsOutside + +end module Invisible + +program Main +! ... +end program Main Modified: tests/ctags/preprocessor.f90.tags 5 files changed, 5 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,5 @@ +# format=tagmanager +InvisibleÌ256Ö0 +MainÌ2048Ö0 +SpillsOutsideÌ16ÎInvisibleÖ0 +nopeÌ16384ÎInvisibleÖ0 -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 987179: Fortran: add missing `block` and `endblock` keywords
by Colomban Wendling
23 Feb '14
23 Feb '14
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 23 Feb 2014 19:02:56 UTC Commit: 98717999d0dd7362078514ec0964b39db605307d
https://github.com/geany/geany/commit/98717999d0dd7362078514ec0964b39db6053…
Log Message: ----------- Fortran: add missing `block` and `endblock` keywords Modified Paths: -------------- data/filetypes.fortran Modified: data/filetypes.fortran 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -3,7 +3,7 @@ [keywords] # all items must be in one line -primary=abstract access action advance all allstop allocatable allocate apostrophe assign assignment associate asynchronous backspace bind blank blockdata call case character class close codimension common complex concurrent contains contiguous continue critical cycle data deallocate decimal delim default dimension direct do dowhile double doubleprecision elemental else elseif elsewhere encoding end endassociate endblockdata endcritical enddo endfile endforall endfunction endif endinterface endmodule endprocedure endprogram endselect endsubmodule endsubroutine endtype endwhere entry enum enumerator eor equivalence err errmsg exist exit extends external file final flush fmt forall form format formatted function generic go goto id if images implicit import impure in include inout integer inquire intent interface intrinsic iomsg iolength iostat is kind len lock logical memory module name named namelist nextrec nml non_intrinsic non_overridable none nopass nullify number only open opened operator optional out pad parameter pass pause pending pointer pos position precision print private procedure program protected public quote pure read readwrite real rec recl recursive result return rewind save select selectcase selecttype sequential sign size stat status stop stream submodule subroutine sync syncall syncimages syncmemory target then to type unformatted unit unlock use value volatile wait where while write +primary=abstract access action advance all allstop allocatable allocate apostrophe assign assignment associate asynchronous backspace bind blank block blockdata call case character class close codimension common complex concurrent contains contiguous continue critical cycle data deallocate decimal delim default dimension direct do dowhile double doubleprecision elemental else elseif elsewhere encoding end endassociate endblock endblockdata endcritical enddo endfile endforall endfunction endif endinterface endmodule endprocedure endprogram endselect endsubmodule endsubroutine endtype endwhere entry enum enumerator eor equivalence err errmsg exist exit extends external file final flush fmt forall form format formatted function generic go goto id if images implicit import impure in include inout integer inquire intent interface intrinsic iomsg iolength iostat is kind len lock logical memory module name named namelist nextrec nml non_intrinsic non_overridable none nopass nullify number only open opened operator optional out pad parameter pass pause pending pointer pos position precision print private procedure program protected public quote pure read readwrite real rec recl recursive result return rewind save select selectcase selecttype sequential sign size stat status stop stream submodule subroutine sync syncall syncimages syncmemory target then to type unformatted unit unlock use value volatile wait where while write intrinsic_functions=abs achar acos acosd acosh adjustl adjustr aimag aimax0 aimin0 aint ajmax0 ajmin0 akmax0 akmin0 all allocated alog alog10 amax0 amax1 amin0 amin1 amod anint any asin asind asinh associated atan atan2 atan2d atand atanh atomic_define atomic_ref bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn bge bgt bit_size bitest bitl bitlr bitrl bjtest bktest ble blt break btest c_associated c_f_pointer c_f_procpointer c_funloc c_loc c_sizeof cabs ccos cdabs cdcos cdexp cdlog cdsin cdsqrt ceiling cexp char clog cmplx command_argument_count conjg cos cosd cosh count cpu_time cshift csin csqrt dabs dacos dacosd dasin dasind datan datan2 datan2d datand date date_and_time dble dcmplx dconjg dcos dcosd dcosh dcotan ddim dexp dfloat dfloti dflotj dflotk digits dim dimag dint dlog dlog10 dmax1 dmin1 dmod dnint dot_product dprod dreal dshiftl dshiftr dsign dsin dsind dsinh dsqrt dtan dtand dtanh eoshift epsilon erf erfc erfc_scaled errsns execute_command_line exp exponent extends_type_of findloc float floati floatj floatk floor fraction free gamma get_command get_command_argument get_environment_variable huge hypot iabs iachar iall iand iany ibclr ibits ibset ichar idate idim idint idnint ieor ifix iiabs iiand iibclr iibits iibset iidim iidint iidnnt iieor iifix iint iior iiqint iiqnnt iishft iishftc iisign ilen image_index imax0 imax1 imin0 imin1 imod index inint inot int int1 int2 int4 int8 ior iparity iqint iqnint is_contiguous is_isostat_end is_isostat_eor ishft ishftc isign isnan izext jiand jibclr jibits jibset jidim jidint jidnnt jieor jifix jint jior jiqint jiqnnt jishft jishftc jisign jmax0 jmax1 jmin0 jmin1 jmod jnint jnot jzext kiabs kiand kibclr kibits kibset kidim kidint kidnnt kieor kifix kind kint kior kishft kishftc kisign kmax0 kmax1 kmin0 kmin1 kmod knint knot kzext lbound lcobound leadz len len_trim lge lgt lle llt log log10 log_gamma logical lshift malloc maskl maskr matmul max max0 max1 maxexponent maxloc maxval merge merge_bits min min0 min1 minexponent minloc minval mod modulo move_alloc mvbits nearest new_line nint norm2 not null num_images number_of_processors nworkers pack parity popcnt poppar precision present product radix random random_number random_seed range real repeat reshape rrspacing rshift same_type_as scale scan secnds selected_char_kind selected_int_kind selected_real_kind set_exponent shape shifta shiftl shiftr sign sin sind sinh size sizeof sngl snglq spacing spread sqrt storage_size sum system_clock tan tand tanh this_image tiny trailz transfer transpose trim ubound ucobound unpack verify user_functions=cdabs cdcos cdexp cdlog cdsin cdsqrt cotan cotand dcmplx dconjg dcotan dcotand decode dimag dll_export dll_import doublecomplex dreal dvchk encode find flen flush getarg getcharqq getcl getdat getenv gettim hfix ibchng identifier imag int1 int2 int4 intc intrup invalop iostat_msg isha ishc ishl jfix lacfar locking locnear map nargs nbreak ndperr ndpexc offset ovefl peekcharqq precfill prompt qabs qacos qacosd qasin qasind qatan qatand qatan2 qcmplx qconjg qcos qcosd qcosh qdim qexp qext qextd qfloat qimag qlog qlog10 qmax1 qmin1 qmod qreal qsign qsin qsind qsinh qsqrt qtan qtand qtanh ran rand randu rewrite segment setdat settim system timer undfl unlock union val virtual volatile zabs zcos zexp zlog zsin zsqrt -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] ef4c72: Fortran: generate fake tags for anonymous structures, interfaces and enums
by Colomban Wendling
23 Feb '14
23 Feb '14
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 23 Feb 2014 19:02:55 UTC Commit: ef4c72501e0f8532e31a9fac91a3a29c3e078ce4
https://github.com/geany/geany/commit/ef4c72501e0f8532e31a9fac91a3a29c3e078…
Log Message: ----------- Fortran: generate fake tags for anonymous structures, interfaces and enums This allows both to show those anonymous elements, as well as giving a parent to their children, fixing display in the symbols tree. Modified Paths: -------------- src/symbols.c tagmanager/ctags/fortran.c tests/ctags/enum.f90.tags tests/ctags/enumerators.f90.tags tests/ctags/numlib.f90.tags tests/ctags/recursive.f95.tags tests/ctags/structure.f.tags Modified: src/symbols.c 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -979,6 +979,7 @@ static void add_top_level_items(GeanyDocument *doc) &(tv_iters.tag_class), _("Types"), "classviewer-class", &(tv_iters.tag_member), _("Components"), "classviewer-member", &(tv_iters.tag_macro), _("Blocks"), "classviewer-member", + &(tv_iters.tag_type), _("Enums"), "classviewer-struct", &(tv_iters.tag_other), _("Other"), "classviewer-other", NULL); break; Modified: tagmanager/ctags/fortran.c 38 files changed, 22 insertions(+), 16 deletions(-) =================================================================== @@ -208,6 +208,7 @@ static boolean FreeSourceForm = FALSE; static boolean ParsingString; static tokenInfo *Parent = NULL; +static unsigned int contextual_fake_count = 0; /* indexed by tagType */ static kindOption FortranKinds [] = { @@ -378,8 +379,7 @@ static const tokenInfo* ancestorScope (void) { tokenInfo *const token = Ancestors.list + i - 1; if (token->type == TOKEN_IDENTIFIER && - token->tag != TAG_UNDEFINED && token->tag != TAG_INTERFACE && - token->tag != TAG_ENUM) + token->tag != TAG_UNDEFINED) result = token; } return result; @@ -456,6 +456,16 @@ static tokenInfo *newTokenFrom (tokenInfo *const token) return result; } +static tokenInfo *newAnonTokenFrom (tokenInfo *const token, const char *type) +{ + char buffer[64]; + tokenInfo *result = newTokenFrom (token); + sprintf (buffer, "%s#%u", type, contextual_fake_count++); + vStringClear (result->string); + vStringCatS (result->string, buffer); + return result; +} + static void deleteToken (tokenInfo *const token) { if (token != NULL) @@ -1593,7 +1603,7 @@ static void parseUnionStmt (tokenInfo *const token) */ static void parseStructureStmt (tokenInfo *const token) { - tokenInfo *name; + tokenInfo *name = NULL; Assert (isKeyword (token, KEYWORD_structure)); readToken (token); if (isType (token, TOKEN_OPERATOR) && @@ -1601,17 +1611,16 @@ static void parseStructureStmt (tokenInfo *const token) { /* read structure name */ readToken (token); if (isType (token, TOKEN_IDENTIFIER)) - makeFortranTag (token, TAG_DERIVED_TYPE); - name = newTokenFrom (token); + name = newTokenFrom (token); skipPast (token, TOKEN_OPERATOR); } - else + if (name == NULL) { /* fake out anonymous structure */ - name = newToken (); + name = newAnonTokenFrom (token, "Structure"); name->type = TOKEN_IDENTIFIER; name->tag = TAG_DERIVED_TYPE; - vStringCopyS (name->string, "anonymous"); } + makeFortranTag (name, TAG_DERIVED_TYPE); while (isType (token, TOKEN_IDENTIFIER)) { /* read field names */ makeFortranTag (token, TAG_COMPONENT); @@ -1770,7 +1779,6 @@ static void parseInterfaceBlock (tokenInfo *const token) readToken (token); if (isType (token, TOKEN_IDENTIFIER)) { - makeFortranTag (token, TAG_INTERFACE); name = newTokenFrom (token); } else if (isKeyword (token, KEYWORD_assignment) || @@ -1780,17 +1788,15 @@ static void parseInterfaceBlock (tokenInfo *const token) if (isType (token, TOKEN_PAREN_OPEN)) readToken (token); if (isType (token, TOKEN_OPERATOR)) - { - makeFortranTag (token, TAG_INTERFACE); name = newTokenFrom (token); - } } if (name == NULL) { - name = newToken (); + name = newAnonTokenFrom (token, "Interface"); name->type = TOKEN_IDENTIFIER; name->tag = TAG_INTERFACE; } + makeFortranTag (name, TAG_INTERFACE); ancestorPush (name); while (! isKeyword (token, KEYWORD_end)) { @@ -1842,12 +1848,11 @@ static void parseEnumBlock (tokenInfo *const token) name = newTokenFrom (token); if (name == NULL) { - name = newToken (); + name = newAnonTokenFrom (token, "Enum"); name->type = TOKEN_IDENTIFIER; name->tag = TAG_ENUM; } - else - makeFortranTag (name, TAG_ENUM); + makeFortranTag (name, TAG_ENUM); skipToNextStatement (token); ancestorPush (name); while (! isKeyword (token, KEYWORD_end)) @@ -2282,6 +2287,7 @@ static boolean findFortranTags (const unsigned int passCount) Parent = newToken (); token = newToken (); FreeSourceForm = (boolean) (passCount > 1); + contextual_fake_count = 0; Column = 0; exception = (exception_t) setjmp (Exception); if (exception == ExceptionEOF) Modified: tests/ctags/enum.f90.tags 70 files changed, 36 insertions(+), 34 deletions(-) =================================================================== @@ -1,6 +1,8 @@ # format=tagmanager ConstantsÌ256Ö0 E_eÌ16384ÎConstantsÖ0 +Enum#0Ì2ÎConstantsÖ0 +Enum#1Ì2ÎConstantsÖ0 Named1Ì2ÎConstantsÖ0 Named2Ì2ÎConstantsÖ0 Named3Ì2ÎConstantsÖ0 @@ -8,39 +10,39 @@ Named4 Named5Ì2ÎConstantsÖ0 Named6Ì2ÎConstantsÖ0 Named7Ì2ÎConstantsÖ0 -aÌ4ÎConstantsÖ0 -bÌ4ÎConstantsÖ0 -blackÌ4ÎConstantsÖ0 -blueÌ4ÎConstantsÖ0 -bronzeÌ4ÎConstantsÖ0 -cÌ4ÎConstantsÖ0 -goldÌ4ÎConstantsÖ0 +aÌ4ÎEnum#1Ö0 +bÌ4ÎEnum#1Ö0 +blackÌ4ÎEnum#0Ö0 +blueÌ4ÎEnum#0Ö0 +bronzeÌ4ÎEnum#0Ö0 +cÌ4ÎEnum#1Ö0 +goldÌ4ÎEnum#0Ö0 hcÌ16384ÎConstantsÖ0 -lavenderÌ4ÎConstantsÖ0 +lavenderÌ4ÎEnum#0Ö0 piÌ16384ÎConstantsÖ0 -pinkÌ4ÎConstantsÖ0 -purpleÌ4ÎConstantsÖ0 -redÌ4ÎConstantsÖ0 -silverÌ4ÎConstantsÖ0 -x1Ì4ÎConstantsÖ0 -x2Ì4ÎConstantsÖ0 -x3Ì4ÎConstantsÖ0 -x4Ì4ÎConstantsÖ0 -x5Ì4ÎConstantsÖ0 -x6Ì4ÎConstantsÖ0 -x7Ì4ÎConstantsÖ0 -y1Ì4ÎConstantsÖ0 -y2Ì4ÎConstantsÖ0 -y3Ì4ÎConstantsÖ0 -y4Ì4ÎConstantsÖ0 -y5Ì4ÎConstantsÖ0 -y6Ì4ÎConstantsÖ0 -y7Ì4ÎConstantsÖ0 -yellowÌ4ÎConstantsÖ0 -z1Ì4ÎConstantsÖ0 -z2Ì4ÎConstantsÖ0 -z3Ì4ÎConstantsÖ0 -z4Ì4ÎConstantsÖ0 -z5Ì4ÎConstantsÖ0 -z6Ì4ÎConstantsÖ0 -z7Ì4ÎConstantsÖ0 +pinkÌ4ÎEnum#0Ö0 +purpleÌ4ÎEnum#0Ö0 +redÌ4ÎEnum#0Ö0 +silverÌ4ÎEnum#0Ö0 +x1Ì4ÎNamed1Ö0 +x2Ì4ÎNamed2Ö0 +x3Ì4ÎNamed3Ö0 +x4Ì4ÎNamed4Ö0 +x5Ì4ÎNamed5Ö0 +x6Ì4ÎNamed6Ö0 +x7Ì4ÎNamed7Ö0 +y1Ì4ÎNamed1Ö0 +y2Ì4ÎNamed2Ö0 +y3Ì4ÎNamed3Ö0 +y4Ì4ÎNamed4Ö0 +y5Ì4ÎNamed5Ö0 +y6Ì4ÎNamed6Ö0 +y7Ì4ÎNamed7Ö0 +yellowÌ4ÎEnum#0Ö0 +z1Ì4ÎNamed1Ö0 +z2Ì4ÎNamed2Ö0 +z3Ì4ÎNamed3Ö0 +z4Ì4ÎNamed4Ö0 +z5Ì4ÎNamed5Ö0 +z6Ì4ÎNamed6Ö0 +z7Ì4ÎNamed7Ö0 Modified: tests/ctags/enumerators.f90.tags 31 files changed, 17 insertions(+), 14 deletions(-) =================================================================== @@ -3,24 +3,27 @@ Aster_colon Aster_kindÌ2ÎEnumsÖ0 BodyPartÌ2ÎEnumsÖ0 ColonsÌ2ÎEnumsÖ0 +Enum#0Ì2ÎEnumsÖ0 +Enum#1Ì2ÎEnumsÖ0 EnumsÌ256Ö0 FuncÌ16ÎEnumsÖ0 Name_colonÌ2ÎEnumsÖ0 Paren_colonÌ2ÎEnumsÖ0 Paren_kindÌ2ÎEnumsÖ0 -armÌ4ÎEnumsÖ0 -bÌ4ÎEnumsÖ0 -blueÌ4ÎEnumsÖ0 -bronzeÌ4ÎEnumsÖ0 -cÌ4ÎEnumsÖ0 -dÌ4ÎEnumsÖ0 -eÌ4ÎEnumsÖ0 -goldÌ4ÎEnumsÖ0 -legÌ4ÎEnumsÖ0 -no_c_bindingÌ4ÎEnumsÖ0 +armÌ4ÎBodyPartÖ0 +bÌ4ÎParen_kindÖ0 +blueÌ4ÎEnum#0Ö0 +bronzeÌ4ÎEnum#0Ö0 +cÌ4ÎAster_kindÖ0 +dÌ4ÎName_colonÖ0 +dÌ4ÎParen_colonÖ0 +eÌ4ÎAster_colonÖ0 +goldÌ4ÎEnum#0Ö0 +legÌ4ÎBodyPartÖ0 +no_c_bindingÌ4ÎEnum#1Ö0 othervarÌ16384ÎEnumsÖ0 -purpleÌ4ÎEnumsÖ0 -rÌ4ÎEnumsÖ0 -redÌ4ÎEnumsÖ0 -silverÌ4ÎEnumsÖ0 +purpleÌ4ÎEnum#0Ö0 +rÌ4ÎColonsÖ0 +redÌ4ÎEnum#0Ö0 +silverÌ4ÎEnum#0Ö0 somevarÌ16384ÎEnumsÖ0 Modified: tests/ctags/numlib.f90.tags 1 files changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -1,2 +1,3 @@ # format=tagmanager +Interface#0Ì32Înumerical_librariesÖ0 numerical_librariesÌ256Ö0 Modified: tests/ctags/recursive.f95.tags 2 files changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -1,4 +1,6 @@ # format=tagmanager +Interface#0Ì32ÎapproxÖ0 +Interface#1Ì32Îapprox2Ö0 approxÌ256Ö0 approx2Ì256Ö0 partsÌ16384ÎapproxÖ0 Modified: tests/ctags/structure.f.tags 3 files changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -1,5 +1,6 @@ # format=tagmanager -aÌ64ÎanonymousÖ0 +Structure#0Ì1ÎnestedÖ0 +aÌ64ÎStructure#0Ö0 cloudsÌ64ÎweatherÖ0 dayÌ64ÎweatherÖ0 initialized_structureÌ2048Ö0 -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 9520e7: Fortran: parse Fortran 2003 enums
by Colomban Wendling
23 Feb '14
23 Feb '14
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 23 Feb 2014 19:01:30 UTC Commit: 9520e7f7d7b7a9570db2feb165653ef1d68e547a
https://github.com/geany/geany/commit/9520e7f7d7b7a9570db2feb165653ef1d68e5…
Log Message: ----------- Fortran: parse Fortran 2003 enums Allow for not-yet-standard enum naming using `:: name` syntax, see
http://docs.cray.com/books/S-3692-51/html-S-3692-51/z970507905n9123.html
Test cases contributed by Adam Hirst, thanks. Modified Paths: -------------- tagmanager/ctags/fortran.c tests/ctags/Makefile.am tests/ctags/enum.f90 tests/ctags/enum.f90.tags tests/ctags/enumerators.f90 tests/ctags/enumerators.f90.tags Modified: tagmanager/ctags/fortran.c 105 files changed, 90 insertions(+), 15 deletions(-) =================================================================== @@ -65,6 +65,7 @@ KEYWORD_assignment, KEYWORD_associate, KEYWORD_automatic, + KEYWORD_bind, KEYWORD_block, KEYWORD_byte, KEYWORD_cexternal, @@ -83,6 +84,8 @@ KEYWORD_elemental, KEYWORD_end, KEYWORD_entry, + KEYWORD_enum, + KEYWORD_enumerator, KEYWORD_equivalence, KEYWORD_extends, KEYWORD_external, @@ -178,6 +181,8 @@ TAG_SUBROUTINE, TAG_DERIVED_TYPE, TAG_VARIABLE, + TAG_ENUM, + TAG_ENUMERATOR, TAG_COUNT /* must be last */ } tagType; @@ -219,7 +224,9 @@ { TRUE, 'p', "struct", "programs"}, { TRUE, 's', "method", "subroutines"}, { TRUE, 't', "class", "derived types and structures"}, - { TRUE, 'v', "variable", "program (global) and module variables"} + { TRUE, 'v', "variable", "program (global) and module variables"}, + { TRUE, 'E', "enum", "enumerations"}, + { TRUE, 'F', "enumerator", "enumeration values"}, }; /* For efinitions of Fortran 77 with extensions: @@ -236,6 +243,7 @@ { "assignment", KEYWORD_assignment }, { "associate", KEYWORD_associate }, { "automatic", KEYWORD_automatic }, + { "bind", KEYWORD_bind }, { "block", KEYWORD_block }, { "byte", KEYWORD_byte }, { "cexternal", KEYWORD_cexternal }, @@ -254,6 +262,8 @@ { "elemental", KEYWORD_elemental }, { "end", KEYWORD_end }, { "entry", KEYWORD_entry }, + { "enum", KEYWORD_enum }, + { "enumerator", KEYWORD_enumerator }, { "equivalence", KEYWORD_equivalence }, { "extends", KEYWORD_extends }, { "external", KEYWORD_external }, @@ -368,7 +378,8 @@ static const tokenInfo* ancestorScope (void) { tokenInfo *const token = Ancestors.list + i - 1; if (token->type == TOKEN_IDENTIFIER && - token->tag != TAG_UNDEFINED && token->tag != TAG_INTERFACE) + token->tag != TAG_UNDEFINED && token->tag != TAG_INTERFACE && + token->tag != TAG_ENUM) result = token; } return result; @@ -1144,6 +1155,7 @@ static boolean isTypeSpec (tokenInfo *const token) case KEYWORD_record: case KEYWORD_type: case KEYWORD_procedure: + case KEYWORD_enumerator: result = TRUE; break; default: @@ -1171,6 +1183,21 @@ static boolean isSubprogramPrefix (tokenInfo *const token) return result; } +static void parseKindSelector (tokenInfo *const token) +{ + if (isType (token, TOKEN_PAREN_OPEN)) + skipOverParens (token); /* skip kind-selector */ + if (isType (token, TOKEN_OPERATOR) && + strcmp (vStringValue (token->string), "*") == 0) + { + readToken (token); + if (isType (token, TOKEN_PAREN_OPEN)) + skipOverParens (token); + else + readToken (token); + } +} + /* type-spec * is INTEGER [kind-selector] * or REAL [kind-selector] is ( etc. ) @@ -1208,14 +1235,7 @@ static void parseTypeSpec (tokenInfo *const token) case KEYWORD_real: case KEYWORD_procedure: readToken (token); - if (isType (token, TOKEN_PAREN_OPEN)) - skipOverParens (token); /* skip kind-selector */ - if (isType (token, TOKEN_OPERATOR) && - strcmp (vStringValue (token->string), "*") == 0) - { - readToken (token); - readToken (token); - } + parseKindSelector (token); break; case KEYWORD_double: @@ -1246,6 +1266,10 @@ static void parseTypeSpec (tokenInfo *const token) parseDerivedTypeDef (token); break; + case KEYWORD_enumerator: + readToken (token); + break; + default: skipToToken (token, TOKEN_STATEMENT_END); break; @@ -1333,11 +1357,12 @@ static tagType variableTagType (void) const tokenInfo* const parent = ancestorTop (); switch (parent->tag) { - case TAG_MODULE: result = TAG_VARIABLE; break; - case TAG_DERIVED_TYPE: result = TAG_COMPONENT; break; - case TAG_FUNCTION: result = TAG_LOCAL; break; - case TAG_SUBROUTINE: result = TAG_LOCAL; break; - default: result = TAG_VARIABLE; break; + case TAG_MODULE: result = TAG_VARIABLE; break; + case TAG_DERIVED_TYPE: result = TAG_COMPONENT; break; + case TAG_FUNCTION: result = TAG_LOCAL; break; + case TAG_SUBROUTINE: result = TAG_LOCAL; break; + case TAG_ENUM: result = TAG_ENUMERATOR; break; + default: result = TAG_VARIABLE; break; } } return result; @@ -1791,6 +1816,54 @@ static void parseInterfaceBlock (tokenInfo *const token) deleteToken (name); } +/* enum-block + * enum-stmt (is ENUM, BIND(C) [ :: type-alias-name ] + * or ENUM [ kind-selector ] [ :: ] [ type-alias-name ]) + * [ enum-body (is ENUMERATOR [ :: ] enumerator-list) ] + * end-enum-stmt (is END ENUM) + */ +static void parseEnumBlock (tokenInfo *const token) +{ + tokenInfo *name = NULL; + Assert (isKeyword (token, KEYWORD_enum)); + readToken (token); + if (isType (token, TOKEN_COMMA)) + { + readToken (token); + if (isType (token, TOKEN_KEYWORD)) + readToken (token); + if (isType (token, TOKEN_PAREN_OPEN)) + skipOverParens (token); + } + parseKindSelector (token); + if (isType (token, TOKEN_DOUBLE_COLON)) + readToken (token); + if (isType (token, TOKEN_IDENTIFIER)) + name = newTokenFrom (token); + if (name == NULL) + { + name = newToken (); + name->type = TOKEN_IDENTIFIER; + name->tag = TAG_ENUM; + } + else + makeFortranTag (name, TAG_ENUM); + skipToNextStatement (token); + ancestorPush (name); + while (! isKeyword (token, KEYWORD_end)) + { + if (isTypeSpec (token)) + parseTypeDeclarationStmt (token); + else + skipToNextStatement (token); + } + readSubToken (token); + /* secondary token should be KEYWORD_enum token */ + skipToNextStatement (token); + ancestorPop (); + deleteToken (name); +} + /* entry-stmt is * ENTRY entry-name [ ( dummy-arg-list ) ] */ @@ -1872,6 +1945,7 @@ static boolean parseDeclarationConstruct (tokenInfo *const token) { case KEYWORD_entry: parseEntryStmt (token); break; case KEYWORD_interface: parseInterfaceBlock (token); break; + case KEYWORD_enum: parseEnumBlock (token); break; case KEYWORD_stdcall: readToken (token); break; /* derived type handled by parseTypeDeclarationStmt(); */ @@ -2079,6 +2153,7 @@ static boolean parseExecutionPart (tokenInfo *const token) case KEYWORD_end: readSubToken (token); if (isSecondaryKeyword (token, KEYWORD_do) || + isSecondaryKeyword (token, KEYWORD_enum) || isSecondaryKeyword (token, KEYWORD_if) || isSecondaryKeyword (token, KEYWORD_select) || isSecondaryKeyword (token, KEYWORD_where) || Modified: tests/ctags/Makefile.am 2 files changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -121,7 +121,9 @@ test_sources = \ directives.c \ dopbl2.f \ enum.c \ + enum.f90 \ enum.java \ + enumerators.f90 \ events.cs \ extern_variable.h \ forall_module.f90 \ Modified: tests/ctags/enum.f90 52 files changed, 52 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,52 @@ +module Constants + implicit none + + real, parameter :: pi = 4 * atan(1.0) + real, parameter :: E_e = 510998.91013 + + ! we now have enumerators in F2003/8, for the sake of interop with C + enum, bind(c) ! unnamed 1 + enumerator :: red =1, blue, black =5 + enumerator yellow + enumerator gold, silver, bronze + enumerator :: purple + enumerator :: pink, lavender + end enum + + enum ! unnamed 2 + enumerator :: a, b, c + end enum + + enum :: Named1 + enumerator :: x1, y1, z1 + end enum + + enum Named2 + enumerator :: x2, y2, z2 + end enum + + enum(8) Named3 + enumerator :: x3, y3, z3 + end enum + + enum*8 Named4 + enumerator :: x4, y4, z4 + end enum + + enum(8) :: Named5 + enumerator :: x5, y5, z5 + end enum + + enum*8 :: Named6 + enumerator :: x6, y6, z6 + end enum + + enum, bind(c) :: Named7 + enumerator :: x7, y7, z7 + end enum + + real, parameter :: hc = 12398.4193 + + public + +end module Constants Modified: tests/ctags/enum.f90.tags 46 files changed, 46 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,46 @@ +# format=tagmanager +ConstantsÌ256Ö0 +E_eÌ16384ÎConstantsÖ0 +Named1Ì2ÎConstantsÖ0 +Named2Ì2ÎConstantsÖ0 +Named3Ì2ÎConstantsÖ0 +Named4Ì2ÎConstantsÖ0 +Named5Ì2ÎConstantsÖ0 +Named6Ì2ÎConstantsÖ0 +Named7Ì2ÎConstantsÖ0 +aÌ4ÎConstantsÖ0 +bÌ4ÎConstantsÖ0 +blackÌ4ÎConstantsÖ0 +blueÌ4ÎConstantsÖ0 +bronzeÌ4ÎConstantsÖ0 +cÌ4ÎConstantsÖ0 +goldÌ4ÎConstantsÖ0 +hcÌ16384ÎConstantsÖ0 +lavenderÌ4ÎConstantsÖ0 +piÌ16384ÎConstantsÖ0 +pinkÌ4ÎConstantsÖ0 +purpleÌ4ÎConstantsÖ0 +redÌ4ÎConstantsÖ0 +silverÌ4ÎConstantsÖ0 +x1Ì4ÎConstantsÖ0 +x2Ì4ÎConstantsÖ0 +x3Ì4ÎConstantsÖ0 +x4Ì4ÎConstantsÖ0 +x5Ì4ÎConstantsÖ0 +x6Ì4ÎConstantsÖ0 +x7Ì4ÎConstantsÖ0 +y1Ì4ÎConstantsÖ0 +y2Ì4ÎConstantsÖ0 +y3Ì4ÎConstantsÖ0 +y4Ì4ÎConstantsÖ0 +y5Ì4ÎConstantsÖ0 +y6Ì4ÎConstantsÖ0 +y7Ì4ÎConstantsÖ0 +yellowÌ4ÎConstantsÖ0 +z1Ì4ÎConstantsÖ0 +z2Ì4ÎConstantsÖ0 +z3Ì4ÎConstantsÖ0 +z4Ì4ÎConstantsÖ0 +z5Ì4ÎConstantsÖ0 +z6Ì4ÎConstantsÖ0 +z7Ì4ÎConstantsÖ0 Modified: tests/ctags/enumerators.f90 55 files changed, 55 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,55 @@ +module Enums + real :: somevar + + ! we now have enumerators in F2003/8, for the sake of interop with C + enum, bind(c) ! unnamed 1 + enumerator :: red =1, blue + enumerator gold, silver, bronze + enumerator :: purple + end enum + + + ! here follow nonstandard enum declarations, which may become valid in a later standard + ! no real harm implementing these as long as valid stuff isn't broken + enum + enumerator :: no_c_binding + end enum + + enum :: Colons + enumerator :: r + end enum + + enum BodyPart + enumerator :: arm, leg + end enum + + enum(8) Paren_kind + enumerator :: b + end enum + + enum*8 Aster_kind + enumerator :: c + end enum + + enum(8) :: Paren_colon + enumerator :: d + end enum + + enum*8 :: Aster_colon + enumerator :: e + end enum + + enum, bind(c) :: Name_colon + enumerator :: d + end enum + + ! another entry to verify the parsing hasn't broken + real, parameter :: othervar + +contains + + function Func(arg) + ! ... + end function Func + +end module Enums Modified: tests/ctags/enumerators.f90.tags 26 files changed, 26 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,26 @@ +# format=tagmanager +Aster_colonÌ2ÎEnumsÖ0 +Aster_kindÌ2ÎEnumsÖ0 +BodyPartÌ2ÎEnumsÖ0 +ColonsÌ2ÎEnumsÖ0 +EnumsÌ256Ö0 +FuncÌ16ÎEnumsÖ0 +Name_colonÌ2ÎEnumsÖ0 +Paren_colonÌ2ÎEnumsÖ0 +Paren_kindÌ2ÎEnumsÖ0 +armÌ4ÎEnumsÖ0 +bÌ4ÎEnumsÖ0 +blueÌ4ÎEnumsÖ0 +bronzeÌ4ÎEnumsÖ0 +cÌ4ÎEnumsÖ0 +dÌ4ÎEnumsÖ0 +eÌ4ÎEnumsÖ0 +goldÌ4ÎEnumsÖ0 +legÌ4ÎEnumsÖ0 +no_c_bindingÌ4ÎEnumsÖ0 +othervarÌ16384ÎEnumsÖ0 +purpleÌ4ÎEnumsÖ0 +rÌ4ÎEnumsÖ0 +redÌ4ÎEnumsÖ0 +silverÌ4ÎEnumsÖ0 +somevarÌ16384ÎEnumsÖ0 -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 329b2c: Fortran: don't generate tags for interface content
by Colomban Wendling
23 Feb '14
23 Feb '14
Branch: refs/heads/master Author: Colomban Wendling <ban(a)herbesfolles.org> Committer: Colomban Wendling <ban(a)herbesfolles.org> Date: Sun, 23 Feb 2014 18:38:34 UTC Commit: 329b2cb40135b759322a9a3f942ddad64ae5c78b
https://github.com/geany/geany/commit/329b2cb40135b759322a9a3f942ddad64ae5c…
Log Message: ----------- Fortran: don't generate tags for interface content Modified Paths: -------------- tagmanager/ctags/fortran.c tests/ctags/numlib.f90.tags tests/ctags/recursive.f95.tags Modified: tagmanager/ctags/fortran.c 2 files changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -500,7 +500,7 @@ static void makeFortranTag (tokenInfo *const token, tagType tag) e.extensionFields.scope [1] = vStringValue (scope->string); } } - if (! insideInterface () || includeTag (TAG_INTERFACE)) + if (! insideInterface () /*|| includeTag (TAG_INTERFACE)*/) makeTagEntry (&e); } } Modified: tests/ctags/numlib.f90.tags 3 files changed, 0 insertions(+), 3 deletions(-) =================================================================== @@ -1,5 +1,2 @@ # format=tagmanager -a2aldÌ128Înumerical_librariesÖ0 -b2lsfÌ128Înumerical_librariesÖ0 -fcnÌ128Îb2lsfÖ0 numerical_librariesÌ256Ö0 Modified: tests/ctags/recursive.f95.tags 8 files changed, 0 insertions(+), 8 deletions(-) =================================================================== @@ -1,14 +1,6 @@ # format=tagmanager approxĚ256Ö0 approx2Ě256Ö0 -arcsinĚ16ÎapproxÖ0 -arcsin1Ě16ÎapproxÖ0 -arcsin2Ě16ÎapproxÖ0 -arcsin3Ě16ÎapproxÖ0 -asĚ16Îapprox2Ö0 -as1Ě16Îapprox2Ö0 -as2Ě16Îapprox2Ö0 -as3Ě16Îapprox2Ö0 partsĚ16384ÎapproxÖ0 parts2Ě16384Îapprox2Ö0 yĚ16384ÎapproxÖ0 -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
← Newer
1
2
3
4
Older →
Jump to page:
1
2
3
4
Results per page:
10
25
50
100
200