Skip to content

Commit

Permalink
Fix lexing of cinaps comments starting with (*$<symbol-char>
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGr committed Sep 25, 2019
1 parent 77c98a8 commit 3ce84f2
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/approx_lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,6 @@ rule parse_token = parse
comment_stack := Comment :: !comment_stack;
rewind lexbuf 1;
COMMENT }
| '$'
{ if !entering_inline_code_block then begin
entering_inline_code_block := false;
comment_stack := Code :: !comment_stack;
OCAMLDOC_CODE
end
else INFIXOP0(Lexing.lexeme lexbuf)
}
| "(*"
{
let comment_start = lexbuf.lex_start_p in
Expand Down Expand Up @@ -504,7 +496,17 @@ rule parse_token = parse
{ check_commentclose lexbuf (fun s -> PREFIXOP s) }
| ['~' '?'] symbolchar + ')'?
{ check_commentclose lexbuf (fun s -> PREFIXOP s) }
| ['=' '<' '>' '|' '&' '$'] symbolchar * ')'?
| '$' symbolchar * ')'?
{ if !entering_inline_code_block then begin
entering_inline_code_block := false;
comment_stack := Code :: !comment_stack;
rewind lexbuf
(Lexing.lexeme_end lexbuf - Lexing.lexeme_start lexbuf - 1);
OCAMLDOC_CODE
end
else check_commentclose lexbuf (fun s -> INFIXOP0 s)
}
| ['=' '<' '>' '|' '&'] symbolchar * ')'?
{ check_commentclose lexbuf (fun s -> INFIXOP0 s) }
| ['@' '^'] symbolchar * ')'?
{ check_commentclose lexbuf (fun s -> INFIXOP1 s) }
Expand Down

0 comments on commit 3ce84f2

Please sign in to comment.