Rust lexer: bug fix with rust macros #1608
Rust macros would not be recognized/formatted, as they end with a '!', which does not count as word boundary. This was required by the suffix r'\b' (after the '!').
To fix this problem, the suffix is removed. As every macro ends with an '!' (which implicitely includes a word boundary before), it's not necessary anyway for the macros.
There were also several keywords which are not macros (as far as I know) listed in this category. They were moved to the correct section. As both categories used the same token anyway, it doesn't really matter.
Lastly, the token type for macros was changed. Rust macros seem to fit more into the magic function (
The text was updated successfully, but these errors were encountered:
'drop', 'Some', 'None', 'Ok' and 'Err' are types, not macros.
Rust macros end with a '!'. The word border (regex '\b') for such expressions is located before the '!' (e. g. "print\b!(...)"). The regex here used the suffix option, which added an r'\b' after each regex (e. g. r'print!\b'). Therefore, the supplied regular expressions didn't match the rust macros. To fix this problem, the suffix is removed. As every macro ends with an '!' (which implicitely includes a word border before), it's not necessary anyway.