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