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 *.
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:
**/is necessary because**/ashould be able to match"a", but if we represented it as['**', 'a']thentoGlobwould produce the ugly"**a".**/*only exists for better capture semantics, as otherwise the"**/"could greedily match characters after the final slash that ought to belong to the*.