summaryrefslogtreecommitdiff
path: root/vala/valageniescanner.vala
diff options
context:
space:
mode:
authorJamie McCracken <jamiemcc@gnome.org>2008-06-23 02:38:56 +0000
committerJamie McCracken <jamiemcc@src.gnome.org>2008-06-23 02:38:56 +0000
commitc28d54360420def5608e7002e6d35de4063871fc (patch)
tree7ac307169400c2e396606398c727064787cc9c21 /vala/valageniescanner.vala
parentd157ba0211f50b15e5e5f9d57696b245d81224ab (diff)
downloadvala-c28d54360420def5608e7002e6d35de4063871fc.tar.gz
Allow arbitrary whitespace/tabs at start of line when its a line
2008-06-23 Jamie McCracken <jamiemcc@gnome.org> * vala/valageniescanner.vala: Allow arbitrary whitespace/tabs at start of line when its a line continuation svn path=/trunk/; revision=1633
Diffstat (limited to 'vala/valageniescanner.vala')
-rw-r--r--vala/valageniescanner.vala24
1 files changed, 23 insertions, 1 deletions
diff --git a/vala/valageniescanner.vala b/vala/valageniescanner.vala
index 478fef9fc..2543e0811 100644
--- a/vala/valageniescanner.vala
+++ b/vala/valageniescanner.vala
@@ -453,9 +453,11 @@ public class Vala.Genie.Scanner : Object {
space ();
}
- /* handle line continuation */
+ /* handle line continuation (lines ending with \) */
while (current < end && current[0] == '\\' && current[1] == '\n') {
current += 2;
+ line++;
+ skip_space_tabs ();
}
/* handle non-consecutive new line once parsing is underway - EOL */
@@ -1016,11 +1018,31 @@ public class Vala.Genie.Scanner : Object {
return true;
}
+ bool skip_tabs () {
+ bool found = false;
+ while (current < end && current[0] == '\t' ) {
+ current++;
+ column++;
+ found = true;
+ }
+
+ return found;
+ }
+
+ void skip_space_tabs () {
+ while (whitespace () || skip_tabs () || comment () ) {
+ }
+
+ }
+
void space () {
while (whitespace () || comment ()) {
}
}
+
+
+
void push_comment (string comment_item, bool file_comment) {
if (_comment == null) {
_comment = comment_item;