Skip to content

Commit

Permalink
Try to fix the dypgen lexer. See #171.
Browse files Browse the repository at this point in the history
  • Loading branch information
skaller committed Sep 3, 2022
1 parent 6717d02 commit c16497a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/compiler/dypgen/dypgen/extract_type.mll
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ and replace_tpar oldtp newtp = parse
if s = Bytes.of_string oldtp then
(let s = Bytes.of_string ("'"^newtp^" ") in
let len2 = Bytes.length s in
s.[len2-1] <- r.[len-1];
Bytes.set s (len2-1) r.[len-1];
Buffer.add_bytes string_buf s)
else
Buffer.add_string string_buf r;
Expand All @@ -140,11 +140,11 @@ and fix_variant fun_typ = parse
| [^'_''['] * eof { () }
| "_[" ['<''>']
{ let i = Lexing.lexeme_start lexbuf in
fun_typ.[i] <- byte_of_char ' '; fun_typ.[i+2] <- byte_of_char ' ';
Bytes.set fun_typ i ' '; Bytes.set fun_typ (i+2) ' ';
fix_variant fun_typ lexbuf}
| "[" ['<''>']
{ let i = Lexing.lexeme_start lexbuf in
fun_typ.[i+1] <- byte_of_char ' ';
Bytes.set fun_typ (i+1) ' ';
fix_variant fun_typ lexbuf}
| [^'_''['] + { fix_variant fun_typ lexbuf }
| ['_''['] { fix_variant fun_typ lexbuf }
Expand Down

0 comments on commit c16497a

Please sign in to comment.