Mainly go by code indentation, ignoring empty lines.
Handle comment blocks at 0 as a special case.
Change-Id: Ibe5bef7286c640a2eea8b50140dae256b6635a56
Reviewed-by: hjk <hjk@qt.io>
Pass the mapping from custom enum to text style in form of a function,
which then can use a switch which is checked by compilers, and
avoids the need to lookup a different enum somewhere else to find
out what the mapping actually is.
That mapping is cached to keep performance as before.
Also, most highlighters created an enum just for the purpose of mapping
to text styles, basically creating duplicated subsets of text style like
enums everywhere. Instead provide a default, identity mapping from text
styles to text styles.
Change-Id: I2ea1ca702b99e36b8742dfda510b1b2753f0a1c2
Reviewed-by: David Schulz <david.schulz@qt.io>