remove debugging related code

This commit is contained in:
Mylloon 2023-10-25 10:01:23 +02:00
parent 899dae5ea1
commit b06572a5ca
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -9,13 +9,8 @@
f lexbuf
;;
let error lexbuf c =
let msg =
"during lexing"
^
match c with
| Some c -> Printf.sprintf " at `%c`" c
| None -> ""
let error lexbuf =
let msg = "during lexing"
in
error msg (lex_join lexbuf.lex_start_p lexbuf.lex_curr_p)
;;
@ -43,7 +38,7 @@
let ascii_code = int_of_string caractere in
Char.chr ascii_code
with
| _ -> error lexbuf None err_msg))
| _ -> error lexbuf err_msg))
;;
}
@ -190,21 +185,21 @@ rule token = parse
(** Lexing errors *)
(* Erreur qui advient quand un code ASCII est trop grand *)
| "'" ascii_trop_grand "'" { error lexbuf None "" }
| _ as _c { error lexbuf None (* (Some _c) *) err_msg }
| "'" ascii_trop_grand "'" { error lexbuf "" }
| _ { error lexbuf err_msg }
and commentary nest = parse
(* Support nesting *)
| close_comment { if nest = 1 then token lexbuf
else commentary (nest - 1) lexbuf }
| open_comment { commentary (nest + 1) lexbuf }
else commentary (nest - 1) lexbuf }
| open_comment { commentary (nest + 1) lexbuf }
(** Error *)
| eof { error lexbuf None "unclosed commentary." }
| eof { error lexbuf "unclosed commentary." }
(** Commentary content *)
| newline { next_line_and (commentary nest) lexbuf }
| _ { commentary nest lexbuf }
| newline { next_line_and (commentary nest) lexbuf }
| _ { commentary nest lexbuf }
and commentary_line = parse
| newline { next_line_and token lexbuf }
@ -213,16 +208,16 @@ and commentary_line = parse
and read_string buffer = parse
(** End of string *)
| '"' { STRING (Buffer.contents buffer) }
| '"' { STRING (Buffer.contents buffer) }
(** Escape *)
| "\\\"" { Buffer.add_char buffer '\"'
; read_string buffer lexbuf }
; read_string buffer lexbuf }
(** String characters *)
| str_char as s { let c = recup_char s lexbuf
in Buffer.add_char buffer c
; read_string buffer lexbuf }
; read_string buffer lexbuf }
(** Error *)
| eof { error lexbuf None "Unterminated string." }
| eof { error lexbuf "Unterminated string." }