6491: Textmate grammar: allow variables to terminate ranges r=dustypomerleau a=dustypomerleau

Variables were originally designed not to match after a dot, in order to avoid matching struct field access, however this resulted in variables that end ranges not being highlighted. In order to fix this we match a preceding dot, only if it's preceded by at least one other dot. Attempting to match on `(\.{2,})?` won't work, because the optional group allows struct field access to match even when one dot is present.

Co-authored-by: Dusty Pomerleau <dustypomerleau@users.noreply.github.com>
This commit is contained in:
bors[bot] 2020-11-07 11:17:55 +00:00 committed by GitHub
commit f3fe6561c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1127,7 +1127,7 @@
{
"comment": "variables",
"name": "variable.other.rust",
"match": "\\b(?<!\\.)(?:r#(?!(crate|[Ss]elf|super)))?[a-z0-9_]+\\b"
"match": "\\b(?<!(?<!\\.)\\.)(?:r#(?!(crate|[Ss]elf|super)))?[a-z0-9_]+\\b"
}
]
}