summaryrefslogtreecommitdiff
path: root/sched
diff options
context:
space:
mode:
Diffstat (limited to 'sched')
-rw-r--r--sched/netlist_lexer.mll9
1 files changed, 8 insertions, 1 deletions
diff --git a/sched/netlist_lexer.mll b/sched/netlist_lexer.mll
index 60cb223..ec27367 100644
--- a/sched/netlist_lexer.mll
+++ b/sched/netlist_lexer.mll
@@ -1,5 +1,6 @@
{
open Netlist_parser
+open Lexing
exception Eof
let keyword_list =
@@ -22,10 +23,16 @@ let keyword_list =
"XOR", XOR;
]
+let newline lexbuf =
+ let pos = lexbuf.lex_curr_p in
+ lexbuf.lex_curr_p <-
+ { pos with pos_lnum = pos.pos_lnum + 1; pos_bol = pos.pos_cnum }
+
}
rule token = parse
- [' ' '\t' '\n'] { token lexbuf } (* skip blanks *)
+ | '\n' { newline lexbuf ; token lexbuf }
+ | [' ' '\t'] { token lexbuf } (* skip blanks *)
| "=" { EQUAL }
| ":" { COLON }
| "," { COMMA }