Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document rationale behind types of transitions #2

Open
ExpHP opened this issue Jul 9, 2017 · 0 comments
Open

Document rationale behind types of transitions #2

ExpHP opened this issue Jul 9, 2017 · 0 comments

Comments

@ExpHP
Copy link

ExpHP commented Jul 9, 2017

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 *.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant