]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Ignore #! line at the top of source files
authorJürg Billeter <j@bitron.ch>
Wed, 30 Jun 2010 18:13:46 +0000 (20:13 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 30 Jun 2010 18:13:46 +0000 (20:13 +0200)
vala/valascanner.vala

index 30f24dfc24e78642cce55f59128aefa9840fb0ab..3d2ebecee3debe3da09684e7c312c462d949fa9f 100644 (file)
@@ -1214,6 +1214,15 @@ public class Vala.Scanner {
                current++;
                column++;
 
+               if (line == 1 && column == 2 && current < end && current[0] == '!') {
+                       // hash bang: #!
+                       // skip until end of line or end of file
+                       while (current < end && current[0] != '\n') {
+                               current++;
+                       }
+                       return;
+               }
+
                pp_whitespace ();
 
                char* begin = current;