Skip to content

WIP: General improvements to syntax highlighter module

  • Use modern QRegularExpression objects instead of QRegExp [1]
  • Use C++ raw string literals for representing regular expressions
  • Promoted even_quotes_pattern regular expression to class member
  • Use single regular expression rule for Lua keywords matching
  • Simplified all other regular expressions (strings and comments)
  • Re-order rules application: keywords -> single-line comments -> strings
  • Modernise highlightBlock() function using recent examples [2] [3]
  • Use even_quotes_pattern for skipping multi-line comments in strings

Tested this myself. Any feedback from veteran Quest Editor users/developers is welcome.

The syntax highlighter is still not 100% perfect but I think is better than before.

Fixes #472


Before:

sqe-before

After:

sqe-after

Edited by Hugo Hromic

Merge request reports