Skip to content

Instantly share code, notes, and snippets.

@lascar-pacagi
Created January 8, 2020 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lascar-pacagi/b3cff072c864e636e4a2416c1491a8fe to your computer and use it in GitHub Desktop.
Save lascar-pacagi/b3cff072c864e636e4a2416c1491a8fe to your computer and use it in GitHub Desktop.
rule clean = parse
| '\t'
{
print_string " ";
clean lexbuf
}
| (' ' | '\t')* '\n'
{
print_newline ();
clean lexbuf
}
| _ as c
{
print_char c;
clean lexbuf
}
| eof
{
()
}
{
let () = clean (Lexing.from_channel stdin)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment