I have a syntax file with the following definitions:
syn keyword pythonBuiltinFunc __import__ abs all any \ bin bool bytearray \ callable chr classmethod compile complex \ delattr dict dir divmod \ enumerate eval \ filter float format frozenset \ getattr globals hasattr hash hex \ id input int isinstance issubclass iter \ len list locals \ map max min next \ object oct open ord pow property \ range repr reversed round \ set setattr slice sorted \ staticmethod str sum super \ tuple type vars zip \ nextgroup=pythonArgs skipwhite
The problem is that this matches occurrences of
next (e.g.) even when that name is referenced as an object's attribute, as in
obj.next, and this messes up the highlighting.
While I might buy that it's useful to not shadow built-in names, I'm not sure that I buy this for bound names.
Does any one have thoughts on how to apply the above definitions, but exclude the pathological case I mentioned below? I guess I'd be allowing whitespace in the word pattern, but ignoring it in the match?