package sedlex
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
- Bug fixes
- 3.8 (2026-10-01)
- 3.7 (2025-10-06)
- 3.6 (2025-01-05)
- 3.5 (2025-05-29)
- 3.4 (2025-03-28)
- 3.3 (2024-10-29)
- 3.2 (2023-06-28):
- 3.1:
- 3.0:
- 2.4
- 2.3
- 2.2
- 2.1
- 2.0
- 1.99.4
- 1.99.3
- 1.99.2
- 1.99.1
- 1.99
- 1.1
- 1.0
- 0.8
- 0.7 released May 24 2005
- 0.5 release Jul. 8 2004
- 0.4 released Jan. 10 2004
- 0.3 released Oct. 8 2003
- 0.2 released Sep. 22 2003
- 0.1 released Sep. 20 2003
An OCaml lexer generator for Unicode
Install
dune-project
Dependency
Authors
Maintainers
Sources
sedlex-3.8.1.tbz
sha256=b8efae9d2a9a39c2ca2c43a2684f3fb686a8775329f7f9b07c3e3d8a2b7682d6
sha512=ae6ac8282b9e899a510745d64a817d06d908bc61f29530568323eb4145b3db38cf61a82575e2b4c15825f570f2b270ab885c3d27adedbbbe7cdad12510de6d80
doc/CHANGES.html
3.8.1 (2026-10-06)
Bug fixes
- End of input counts as one more character read, as it did before 3.8: a rule matching
s, eofbeats an earlier rule matchings. 3.8 let the earlier rule win, so a lexer with a rule matching the empty string before itseofrule looped forever at end of input (#223)
3.8 (2026-10-01)
New features
- Named capture groups:
(r as x)bindsxin the action to aSedlexing.submatch, extracted withSedlexing.Utf8.of_submatch,Latin1.of_submatch,Utf16.of_submatchorlexeme_of_submatch. Both branches of an or-pattern must bind the same names, andasis not allowed underStar,Plus,Opt,Rep,Compl,SuborIntersect. Submatches are chosen leftmost-greedy within the longest match, using a tagged DFA; a boundary at a fixed offset from the start or end of the lexeme costs nothing at runtime. A submatch is only valid inside its action (#177, #178, #204, #208, #209, #212) - Nested
let .. indefinitions of[%sedlex.regexp?](#176) - Unicode 18.0.0 (#205)
Compl,SubandIntersectacceptRep (c, 1 .. 1)(#201)- Clearer errors for a bare
Star,Plus,Opt,Utf8,Latin1orAsciiand for unknown operators (#196)
Bug fixes
- Rule priority with
eof: a rule matchings, eofno longer beats an earlier rule matchings(#211) - End of input is read once:
Plus eofandStar ('a' | eof)no longer loop forever at end of input, andeof, eofno longer matches (#211) - Empty character sets (
Chars "",Compl any,SuborIntersectof coinciding classes) are a compile error instead of crashing the ppx or producing a rule that never matches (#201) - Rule sets where every rule is nullable, such as a lone
"", no longer generate invalid code (#201) - UTF-8 decoding: the surrogate range rejected by
Utf8.Helper.check_threeended at U+DF00 instead of U+DFFF (#184) Sedlexing.sub_lexemeand itsLatin1,Utf8andUtf16versions raiseInvalid_argumentwhen the range is not within the lexeme, instead of returning code points of the rest of the buffer or, for a negative length, an empty string (#219)
Performance
- Faster
lexeme,sub_lexemeandof_submatchinSedlexing.Latin1,Sedlexing.Utf8andSedlexing.Utf16(#219) - The memory cells of
asbindings are no longer cleared at the start of every token (#220)
Other changes
- Require OCaml 4.11, the oldest compiler still in opam-repository
3.7 (2025-10-06)
- Update to unicode 17.0.0
3.6 (2025-01-05)
- Fixed one of the ranges implementing Implement Corrigendum #1: UTF-8 Shortest Form for 4-bytes long characters (#171)
3.5 (2025-05-29)
- Implement Corrigendum #1: UTF-8 Shortest Form
- Add utf8 support for string literal (#127)
3.4 (2025-03-28)
- Make the library compatibility with ppxlib.0.36 (#166)
3.3 (2024-10-29)
- Add support for unicode
16.0.0(#157) - Add API for retrieving start and stop positions separately (#155)
3.2 (2023-06-28):
- Restore compatibility with OCaml 4.08
- Use
Sedlexing.{Utf8,Utf16}.from_gento initialize UTF8 (resp. UTF16) lexing buffers from string. - Delay raising Malformed until actually reading the malformed part of the imput. (#140)
- Count lines in all cases (#130). Previously, certain functions for initiating the lexical buffer would disable lines counting.
- Check and fix invariants from Cset. The codebase was not respecting invariants documented in the Cset module which could break code relying on it. The code generated by sedlex.ppx could be affected.
- Do not rely on comments from unicode UCD files
- Add API to track position in bytes. Should be opt-in and backward compatible. (#146)
3.1:
- Fix directly nested sedlex matches (@smuenzel, PR #117, fixes: #12)
- Use explicit stdlib in generated code (@hhugo, PR #122, fixes: #115)
- Preserve location of lexbuf (@hhugo, PR #118, fixes: #19)
- Don't use gen to consume channels (@hhugo, PR #124, fixes: #45)
- New expect_test testsuite (@hhugo, PR #124)
- Properly recognize malformed truncated input (@hhugo, PR #124)
- Raise
Malformedinstead ofInvalid_arg(@hhugo, PR #126, fixes: #91) - Updated unicode support to
15.0.0
3.0:
- Dropped
Streamapi which was removed in4.14.0ahead of the5.0release.
2.6:
- Adapted to ppxlib
0.26, thanks to @pitag-ha
2.5:
- Fix exponential compilation time, thanks to @mnxn for reporting in #97 and @fangyi-zhou for fixing in #106
- Update unicode support for
14.0.0.
2.4
- Update
dunesupport to2.8, add auto-generatedopamfiles. - Optimize generated code, thanks to @bobzhang
- Update unicode version to 13.0.0
2.3
- Switch to ppxlib
2.2
- Support for OCaml 4.08
2.1
- GPR#78: Auto-generate unicode data
2.0
- GPR#70: Switch to dune, opam v2
- GPR#60: Breaking change: switch from int codepoints to Uchar.t codepoints
- GPR#59: Track lexing position
1.99.4
- GPR#47: Switch to ocaml-migrate-parsetree (contributed by Adrien Guatto)
- GPR#42: Added 'Rep' (repeat operator) (contributed by jpathy)
1.99.3
- Update to work with 4.03 (4.02 still supported)
1.99.2
- First official release of sedlex
1.99.1
- Support for new Ast_mapper registration API, follow OCaml trunk after the inclusion of the extension_point branch
1.99
- First version of sedlex. The history below refers to ulex, the ancestor or sedlex implemented with Camlp4.
1.1
- Generate (more) globally unique identifiers to avoid conflicts when open'ing another module processed by ulex (issue reported by Gerd Stolpmann)
1.0
- Update to the new Camlp4 and to ocamlbuild (release for OCaml 3.10 only), by Nicolas Pouillard.
0.8
- Really make it work with OCaml 3.09.
- Support for Utf-16.
0.7 released May 24 2005
- Bug fixes
- Update to OCaml 3.09 (currently CVS). Still works with OCaml 3.08.
- MIT-like license (used to LGPL)
0.5 release Jul. 8 2004
- Document how to use a custom implementation for lex buffers
- Update to OCaml 3.08
0.4 released Jan. 10 2004
- Bug fix (accept 1114111 as valid Unicode code point)
- Add the rollback function-
0.3 released Oct. 8 2003
- Bug fix
- Add a new predefined class for ISO identifiers
0.2 released Sep. 22 2003
- Changed the names of predefined regexp
- Fix max_code = 0x10ffff
- Lexers that changes encoding on the fly
- Documentation of the interface Ulexing
0.1 released Sep. 20 2003
- Initial release
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
- Bug fixes
- 3.8 (2026-10-01)
- 3.7 (2025-10-06)
- 3.6 (2025-01-05)
- 3.5 (2025-05-29)
- 3.4 (2025-03-28)
- 3.3 (2024-10-29)
- 3.2 (2023-06-28):
- 3.1:
- 3.0:
- 2.4
- 2.3
- 2.2
- 2.1
- 2.0
- 1.99.4
- 1.99.3
- 1.99.2
- 1.99.1
- 1.99
- 1.1
- 1.0
- 0.8
- 0.7 released May 24 2005
- 0.5 release Jul. 8 2004
- 0.4 released Jan. 10 2004
- 0.3 released Oct. 8 2003
- 0.2 released Sep. 22 2003
- 0.1 released Sep. 20 2003