Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Fri, 14 Feb 2014 23:33:05 UTC
Commit: 497bfaed465ac3aa3baf394029189a01a043ff2e
https://github.com/geany/geany/commit/497bfaed465ac3aa3baf394029189a01a043f…
Log Message:
-----------
Fortran: fix line continuation inside comments
Fix improperly handling '&' at the end of the first comment line after
a non-comment line as a line continuation.
Part of bug #1023.
Modified Paths:
--------------
tagmanager/ctags/fortran.c
tests/ctags/Makefile.am
tests/ctags/fortran_line_continuation.f90
tests/ctags/fortran_line_continuation.f90.tags
Modified: tagmanager/ctags/fortran.c
8 files changed, 4 insertions(+), 4 deletions(-)
===================================================================
@@ -698,7 +698,7 @@ static int skipToNextLine (void)
return c;
}
-static int getFreeFormChar (void)
+static int getFreeFormChar (boolean inComment)
{
static boolean newline = TRUE;
boolean advanceLine = FALSE;
@@ -708,7 +708,7 @@ static int getFreeFormChar (void)
* free-format text line is an ampersand then the next non-comment
* line is a continuation line.
*/
- if (c == '&')
+ if (! inComment && c == '&')
{
do
c = fileGetc ();
@@ -757,7 +757,7 @@ static int getChar (void)
Ungetc = '\0';
}
else if (FreeSourceForm)
- c = getFreeFormChar ();
+ c = getFreeFormChar (FALSE);
else
c = getFixedFormChar ();
return c;
@@ -992,7 +992,7 @@ static void readToken (tokenInfo *const token)
if (FreeSourceForm)
{
do
- c = getChar ();
+ c = getFreeFormChar (TRUE);
while (c != '\n' && c != EOF);
}
else
Modified: tests/ctags/Makefile.am
1 files changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -127,6 +127,7 @@ test_sources = \
forall_module.f90 \
format.pl \
fortran_associate.f90 \
+ fortran_line_continuation.f90 \
func_typedef.h \
general.cs \
hex2dec.sql \
Modified: tests/ctags/fortran_line_continuation.f90
17 files changed, 17 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,17 @@
+! this is a comment and continuation must not be handled in it &
+! this is another line of comment
+
+#if dummy
+function &
+ ! just a test for support of comments after a line continuation
+ ! below is a preprocessor line, also just to test continuation
+ #endif
+ ! still testing
+& do_stuff(a)
+end function do_stuff
+
+function &
+ ! actually the ampersand isn't required at the start of the continuation line
+ #pragma stuff
+do_stuff_again(b)
+end function do_stuff_again
Modified: tests/ctags/fortran_line_continuation.f90.tags
3 files changed, 3 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,3 @@
+# format=tagmanager
+do_stuffÌ16Ö0
+do_stuff_againÌ16Ö0
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: elextr <elextr(a)gmail.com>
Committer: elextr <elextr(a)gmail.com>
Date: Mon, 10 Feb 2014 01:19:45 UTC
Commit: 5d3b2f6269dc9151d9d72ab550539e6de37a439f
https://github.com/geany/geany/commit/5d3b2f6269dc9151d9d72ab550539e6de37a4…
Log Message:
-----------
Fix crash if document closed while custom command is executing
Custom command callback never checked that the doc was still valid.
Can still paste in the wrong doc if user closes and opens while
the command is running, but not crash.
Modified Paths:
--------------
src/tools.c
Modified: src/tools.c
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -290,7 +290,7 @@ static gboolean cc_replace_sel_cb(gpointer user_data)
return TRUE;
}
- if (! data->error && data->buffer != NULL)
+ if (! data->error && data->buffer != NULL && DOC_VALID(data->doc))
{ /* Command completed successfully */
sci_replace_sel(data->doc->editor->sci, data->buffer->str);
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).