Commit cd4c6131 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter

Fix line number calculation for verbatim strings, fixes bug 537123

2008-06-15  Jürg Billeter  <j@bitron.ch>

	* vala/valascanner.vala:

	Fix line number calculation for verbatim strings, fixes bug 537123

svn path=/trunk/; revision=1588
parent fd58a82b
2008-06-15 Jürg Billeter <j@bitron.ch>
* vala/valascanner.vala:
Fix line number calculation for verbatim strings, fixes bug 537123
2008-06-15 Jürg Billeter <j@bitron.ch> 2008-06-15 Jürg Billeter <j@bitron.ch>
* vapi/packages/gtk+-2.0/: * vapi/packages/gtk+-2.0/:
......
...@@ -621,13 +621,19 @@ public class Vala.Scanner : Object { ...@@ -621,13 +621,19 @@ public class Vala.Scanner : Object {
while (current < end - 4) { while (current < end - 4) {
if (current[0] == '"' && current[1] == '"' && current[2] == '"') { if (current[0] == '"' && current[1] == '"' && current[2] == '"') {
break; break;
} } else if (current[0] == '\n') {
unichar u = ((string) current).get_char_validated ((long) (end - current)); current++;
if (u != (unichar) (-1)) { line++;
current += u.to_utf8 (null); column = 1;
token_length_in_chars++; token_length_in_chars = 3;
} else { } else {
Report.error (new SourceReference (source_file, line, column + token_length_in_chars, line, column + token_length_in_chars), "invalid UTF-8 character"); unichar u = ((string) current).get_char_validated ((long) (end - current));
if (u != (unichar) (-1)) {
current += u.to_utf8 (null);
token_length_in_chars++;
} else {
Report.error (new SourceReference (source_file, line, column + token_length_in_chars, line, column + token_length_in_chars), "invalid UTF-8 character");
}
} }
} }
if (current[0] == '"' && current[1] == '"' && current[2] == '"') { if (current[0] == '"' && current[1] == '"' && current[2] == '"') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment