Skip to content

Which rule-branch gets precedence if several match ? #165

Open
@chetmurthy

Description

@chetmurthy

I searched the documentation, and didn't find anything obvious for the following question:

If two rules both match and the lexeme they match is of the same length, which is chosen? I checked ocamllex and there

If several regular expressions match a prefix of the input, the “longest match” rule applies: the regular expression that matches the longest prefix of the input is selected. In case of tie, the regular expression that occurs earlier in the rule is selected.

Is that the case with sedlex ? Maybe I missed it in the documentation?

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