diff options
| author | Hugo Herbelin | 2018-12-26 22:52:52 +0100 |
|---|---|---|
| committer | Hugo Herbelin | 2018-12-26 22:52:52 +0100 |
| commit | 86fc5bbbd93f7e6c380bc3a9a4271fc83214264d (patch) | |
| tree | 47aeebee726a737dd178425534a50f88448f5816 /parsing/cLexer.mli | |
| parent | 599696d804eb7c40661615a49c5d729e7d6ff373 (diff) | |
| parent | 70a139733dfaa42d665a85736ee4324d926723ed (diff) | |
Merge PR #8734: Make diffs work for more input strings
Diffstat (limited to 'parsing/cLexer.mli')
| -rw-r--r-- | parsing/cLexer.mli | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/parsing/cLexer.mli b/parsing/cLexer.mli index c0ebdd45ef..af3fd7f318 100644 --- a/parsing/cLexer.mli +++ b/parsing/cLexer.mli @@ -56,3 +56,14 @@ val set_lexer_state : lexer_state -> unit val get_lexer_state : unit -> lexer_state val drop_lexer_state : unit -> unit val get_comment_state : lexer_state -> ((int * int) * string) list + +(** Create a lexer. true enables alternate handling for computing diffs. +It ensures that, ignoring white space, the concatenated tokens equal the input +string. Specifically: +- for strings, return the enclosing quotes as tokens and treat the quoted value +as if it was unquoted, possibly becoming multiple tokens +- for comments, return the "(*" as a token and treat the contents of the comment as if +it was not in a comment, possibly becoming multiple tokens +- return any unrecognized Ascii or UTF-8 character as a string +*) +val make_lexer : diff_mode:bool -> Tok.t Gramlib.Plexing.lexer |
