fix(lexer): update comments in order to keep the unicity

This commit is contained in:
EmileRolley 2021-03-09 21:01:24 +01:00
parent ddd8864907
commit 05f60b72f4
2 changed files with 5 additions and 2 deletions

View File

@ -23,7 +23,7 @@ module L = Lexer
'#' remaining corresponds to the precedence. *)
let calc_precedence (matched_regex : string) : int = String.length matched_regex - 2
(* Gets the [LAW_HEADING] token from the current [lexbuf] *)
(* Gets the [LAW_HEADING] token from the current {!val: lexbuf} *)
let get_law_heading (lexbuf : lexbuf) : token =
let extract_code_title = R.regexp "([#]+)\\s*([^#\n]+)\n" in
let get_match = R.get_substring (R.exec ~rex:extract_code_title (Utf8.lexeme lexbuf)) in

View File

@ -547,4 +547,7 @@ let lex_law_en (lexbuf : lexbuf) : token =
| Plus (Compl ('/' | '#' | '`' | '>')) -> LAW_TEXT (Utf8.lexeme lexbuf)
| _ -> L.raise_lexer_error (Pos.from_lpos prev_pos) prev_lexeme
let lexer_en lexbuf = if !L.is_code then lex_code_en lexbuf else lex_law_en lexbuf
(** Entry point of the lexer, distributes to {!val: lex_code_en} or {!val: lex_law_en} depending of
{!val: Surface.Lexer.is_code}. *)
let lexer_en (lexbuf : lexbuf) : token =
if !L.is_code then lex_code_en lexbuf else lex_law_en lexbuf