[vala] Ignore #! line at the top of source files



commit 1e8d9aea367d12b4943da474306c25aa62d23f70
Author: Jürg Billeter <j bitron ch>
Date:   Wed Jun 30 20:13:46 2010 +0200

    Ignore #! line at the top of source files

 vala/valascanner.vala |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/vala/valascanner.vala b/vala/valascanner.vala
index 30f24df..3d2ebec 100644
--- a/vala/valascanner.vala
+++ b/vala/valascanner.vala
@@ -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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]