mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
fix(lexer): update comments in order to keep the unicity
This commit is contained in:
parent
ddd8864907
commit
05f60b72f4
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user