package sedlex
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=b8efae9d2a9a39c2ca2c43a2684f3fb686a8775329f7f9b07c3e3d8a2b7682d6
sha512=ae6ac8282b9e899a510745d64a817d06d908bc61f29530568323eb4145b3db38cf61a82575e2b4c15825f570f2b270ab885c3d27adedbbbe7cdad12510de6d80
doc/sedlex_ppx/Sedlex_ppx/Ppx_sedlex/index.html
Module Sedlex_ppx.Ppx_sedlexSource
PPX rewriter for sedlex.
Transforms match%sedlex lexbuf with ... into DFA-based lexer code. Registration with ppxlib is done via side effects at module initialization.
Internals exposed for the test PPX
The values below are not part of the public API. They are exposed so that ppx_sedlex_test can invoke the code generator in isolation and inspect the generated AST and DFA.
Clear all internal tables (partitions, lookup tables). Must be called between independent compilations in tests.
val handle_sedlex_match :
Ppxlib.Parsetree.expression ->
Ppxlib.Parsetree.expression * Sedlex_compiler.Sedlex.dfahandle_sedlex_match match_expr compiles a match%sedlex lexbuf with ... expression into generated DFA code using the built-in regexp environment. Returns the generated expression and the DFA automaton.
map_expression expr applies the sedlex mapper to expr, processing any [%sedlex] or [%sedlex.regexp?] extensions it contains.