After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652899 - Vala Scanner calculates an incorrect column value for tokens after multiline comment
Vala Scanner calculates an incorrect column value for tokens after multiline ...
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Parser
unspecified
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-18 15:36 UTC by Magomed Abdurakhmanov
Modified: 2017-05-02 09:30 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Magomed Abdurakhmanov 2011-06-18 15:36:04 UTC
1. Steps to reproduce:

Compile this .vala file
---------------------
int main(){/*1*/r}
---------------------

Bug applied only to case where comment placed in one line. I've attached patch to fix it.


2. Got result
---------------------
test.vala:1.16-1.16: error: syntax error, expected identifier
int main(){/*1*/r}
               ^
Compilation failed: 1 error(s), 0 warning(s)
---------------------


3. Expected result:
---------------------
test.vala:1.18-1.18: error: syntax error, expected identifier
int main(){/*1*/r}
                 ^
Compilation failed: 1 error(s), 0 warning(s)
---------------------

4. Patch to fix problem (applied to vala/valascanner.vala):

--- a/vala/valascanner.vala
+++ b/vala/valascanner.vala
@@ -1526,6 +1526,7 @@ public class Vala.Scanner {
                        }
 
                        current += 2;
+                       column += 2;
 
                        char* begin = current;
                        while (current < end - 1
Comment 1 Rico Tzschichholz 2017-05-02 09:30:33 UTC
commit 0dc1689af3f2a394c20751dfd372bab8034395f1
Author: Magomed Abdurakhmanov <maqdev@gmail.com>
Date:   Tue May 2 10:40:14 2017 +0200

    scanner: Fix calculation of column value for tokens after multiline comment