[vala] Fix scanning of case where single line comments are appended to end of a line
- From: Jamie McCracken <jamiemcc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] Fix scanning of case where single line comments are appended to end of a line
- Date: Sun, 23 Aug 2009 04:01:16 +0000 (UTC)
commit 1382bccbdf331238fbae094835942fcd140887a0
Author: Jamie McCracken <jamiemcc gnome org>
Date: Sun Aug 23 00:03:46 2009 -0400
Fix scanning of case where single line comments are appended to end of a line
Fixes GNOME Bug 592369 - compiler is complaining about indentation if there are comments
vala/valageniescanner.vala | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/vala/valageniescanner.vala b/vala/valageniescanner.vala
index d28ff76..ecbb426 100644
--- a/vala/valageniescanner.vala
+++ b/vala/valageniescanner.vala
@@ -1040,13 +1040,16 @@ public class Vala.Genie.Scanner {
// single-line comment
current += 2;
char* begin = current;
+
// skip until end of line or end of file
while (current < end && current[0] != '\n') {
current++;
}
+
push_comment (((string) begin).ndup ((long) (current - begin)), line == 1);
- if (current[0] == '\n') {
+ /* do not ignore EOL if comment does not exclusively occupy the line */
+ if (current[0] == '\n' && last_token == TokenType.EOL) {
current++;
line++;
column = 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]