summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parsing/lexer.mli1
-rw-r--r--parsing/lexer.mll5
2 files changed, 6 insertions, 0 deletions
diff --git a/parsing/lexer.mli b/parsing/lexer.mli
index 3fca27a78..fa9ab42f9 100644
--- a/parsing/lexer.mli
+++ b/parsing/lexer.mli
@@ -15,6 +15,7 @@
(* The lexical analyzer *)
val token: Lexing.lexbuf -> Parser.token
+val skip_sharp_bang: Lexing.lexbuf -> unit
type error =
| Illegal_character of char
diff --git a/parsing/lexer.mll b/parsing/lexer.mll
index 14fedb90a..c01fbb665 100644
--- a/parsing/lexer.mll
+++ b/parsing/lexer.mll
@@ -368,3 +368,8 @@ and string = parse
| _
{ store_string_char(Lexing.lexeme_char lexbuf 0);
string lexbuf }
+
+and skip_sharp_bang = parse
+ | "#!" [^ '\n']* '\n' [^ '\n']* "\n!#\n"
+ | "#!" [^ '\n']* '\n'
+ | "" {}