Skip to content

Document rationale behind types of transitions #2

@ExpHP

Description

@ExpHP

So, to my understanding, transitions are classified into:

  • '', an epsilon transition
  • 'a' or any other single character is a literal
  • '.*' represents a glob * or a wildcard ?
  • '**' is a globstar ** not covered by the following cases
  • '**/' represents a **/ (except at the end)
  • '**/*' represents the string **/*

The last two feel pretty ad-hoc. Do you recall why these special cases exist, and if so, could this be documented in the code? My best guesses so far are:

  • I think **/ is necessary because **/a should be able to match "a", but if we represented it as ['**', 'a'] then toGlob would produce the ugly "**a".
  • I think **/* only exists for better capture semantics, as otherwise the "**/" could greedily match characters after the final slash that ought to belong to the *.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions