8000 Instead of raising `Sedlexing.MalFormed` a `Invalid_argument` is triggered · Issue #91 · ocaml-community/sedlex · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Instead of raising Sedlexing.MalFormed a Invalid_argument is triggered #91
Closed
@haselwarter

Description

@haselwarter

When trying to parse certain malformed unicode characters, Sedlexing calls Uchar.of_int without sufficient verification that the codepoint is well-formed. This results in Uchar.of_int triggering a Stdlib.Invalid_argument s where s is some error message string. Instead, MalFormed should be raised, which would allow clean handling of this particular exception from the sedlex user side instead of a catch-all treatment of Invalid_argument.

An example file that contains such a malformed codepoint triggering this error can be found at
https://github.com/Andromedans/andromeda/blob/c45d500b3650a6df30d5a1ef09e2d677aeacc190/tests/malformed-unicode.m31

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0