Add verbatim identifiers#112
Conversation
DustinCampbell
left a comment
There was a problem hiding this comment.
Very nice, and thanks for all of the tests! I just had a few questions around some of the regex tweaks.
| captures: | ||
| '1': { name: storage.modifier.cs } | ||
| - match: \b([_[:alpha:]][_[:alnum:]]*)\b | ||
| - match: (@?\b[_[:alpha:]][_[:alnum:]]*)\b |
There was a problem hiding this comment.
Shouldn't @? and \b be swapped?
| end: (?<=\})|(?=;) | ||
| patterns: | ||
| - match: \b([_[:alpha:]][_[:alnum:]]*)\b | ||
| - match: (@?\b[_[:alpha:]][_[:alnum:]]*)\b |
There was a problem hiding this comment.
Shouldn't @? and \b be swapped here?
| ) | ||
| )\s* | ||
| (?:\b(\g<identifier>)\b)? | ||
| (?:(\g<identifier>)\b)? |
There was a problem hiding this comment.
Why did you remove this \b?
| - match: |- | ||
| (?x) # e.g. x | ||
| \b([_[:alpha:]][_[:alnum:]]*)\b\s* | ||
| (@?\b[_[:alpha:]][_[:alnum:]]*)\b\s* |
There was a problem hiding this comment.
Should @? and \b be swapped?
| - match: |- | ||
| (?x) # e.g. x | ||
| \b([_[:alpha:]][_[:alnum:]]*)\b\s* | ||
| (@?\b[_[:alpha:]][_[:alnum:]]*)\b\s* |
There was a problem hiding this comment.
Should @? and \b be swapped?
| (?x) | ||
| \b(into)\b\s* | ||
| \b([_[:alpha:]][_[:alnum:]]*)\b\s* | ||
| (@?\b[_[:alpha:]][_[:alnum:]]*)\b\s* |
There was a problem hiding this comment.
Confused by position of @? and \b'. Doesn't that defeat the purpose of \b'?
| (?x) | ||
| \b(into)\b\s* | ||
| \b([_[:alpha:]][_[:alnum:]]*)\b\s* | ||
| (@?\b[_[:alpha:]][_[:alnum:]]*)\b\s* |
| (?x) | ||
| (?:\b(async)\b\s*)? | ||
| \b([_[:alpha:]][_[:alnum:]]*)\b\s* | ||
| (@?\b[_[:alpha:]][_[:alnum:]]*)\b\s* |
| ) | ||
| )? | ||
| \b(\g<identifier>)\b\s* | ||
| (\g<identifier>)\b\s* |
There was a problem hiding this comment.
Why did the \b need to be removed here?
| ) | ||
| ) | ||
| (?:\b(?<tuple-name>\g<identifier>)\b)? | ||
| (?:(?<tuple-name>\g<identifier>)\b)? |
There was a problem hiding this comment.
Why did the \b need to be removed here?
|
As for I was also trying to replace those few |
|
It does make sense that |
|
Yes, in this case they can be removed, just left them there because they were there, but they don't affect current tests. Should I remove them then? |
|
If you don't mind removing them, that'd be great. |
|
Removed. |
|
Thanks! |
* Prefer multiplication over pointer types. ([csharp-tmLanguage#111](dotnet/csharp-tmLanguage#111)) * Add support for verbatim identifiers. ([csharp-tmLanguage#112](dotnet/csharp-tmLanguage#112)) All fixes contributed by [@Muchiachio](https://github.com/Muchiachio).
Sorry for a long diff, but had to add a lot of tests to make sure everything works.
Resolves #25.
Fixes #46.