Fix T61253: Wrong syntax highlighting when @ is used as multiplication
authorJacques Lucke <mail@jlucke.com>
Mon, 11 Mar 2019 15:14:46 +0000 (16:14 +0100)
committerJacques Lucke <mail@jlucke.com>
Mon, 11 Mar 2019 15:15:46 +0000 (16:15 +0100)
commit81d5f15a2a71eaa7c506b0b87706059b9c48d23a
tree676c0b14b22343c7db62e98e41f1489b893137af
parenta65b068f6eb31b7ca251075a8362b2098fecafd4
Fix T61253: Wrong syntax highlighting when @ is used as multiplication

This is obviously not a perfect solution. However, to do proper
highlighting a more advanced Python parser would be necessary.
I think this patch implements a good heuristic to differentiate
between the cases when `@` is used for a decorator vs for
multiplication.

When `@` is directly followed by an identifier, it is interpreted
as decorated. Otherwise not.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D4495
source/blender/editors/space_text/text_format_py.c