aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Lexer.mll
diff options
context:
space:
mode:
Diffstat (limited to 'cparser/Lexer.mll')
-rw-r--r--cparser/Lexer.mll16
1 files changed, 10 insertions, 6 deletions
diff --git a/cparser/Lexer.mll b/cparser/Lexer.mll
index aca1be27..c453b15b 100644
--- a/cparser/Lexer.mll
+++ b/cparser/Lexer.mll
@@ -440,15 +440,19 @@ and singleline_comment = parse
open Parser
open Aut.GramDefs
+ (* This is the main entry point to the lexer. *)
+
+ let lexer : lexbuf -> Pre_parser.token =
+ fun lexbuf ->
+ if lexbuf.lex_curr_p.pos_cnum = lexbuf.lex_curr_p.pos_bol then
+ initial_linebegin lexbuf
+ else
+ initial lexbuf
+
let tokens_stream filename text : token coq_Stream =
let tokens = Queue.create () in
let lexer_wraper lexbuf : Pre_parser.token =
- let res =
- if lexbuf.lex_curr_p.pos_cnum = lexbuf.lex_curr_p.pos_bol then
- initial_linebegin lexbuf
- else
- initial lexbuf
- in
+ let res = lexer lexbuf in
Queue.push res tokens;
res
in