Improve highlighting of TypeScript (and React) and add more tests for PHP

Authored by nibags on Feb 24 2019, 4:45 PM.

Description

Improve highlighting of TypeScript (and React) and add more tests for PHP

Summary:
Add more examples in the PHP test units, with the highlighting within code of
CSS, JavaScript, JavaScript React, TypeScript and MustacheJS (according to D18951).

The TypeScript highlighting is also updated.

Changes:

TypeScript:

  • Fixes keywords delimiters (remove: +-).
  • Add support to bigint (example: 123n).
  • Add "is" keyword (for type guards).
  • Don't highlight some keywords when they are objects.
  • Small improvements in the highlighting of types.
  • Don't highlight regular expressions after "]" and ")".

TypeScript React:

  • Don't highlight tags within declarations of types, variables, classes and interfaces.
  • Fix tags at the beginning of substitutions in templates.
  • Adapt to modifications of "typescript.xml".
  • Reorder part of the code.

JavaScript React:

  • Don't highlight tags within declarations of variables, classes and interfaces.
  • Fix tags at the beginning of substitutions in templates.
  • Reorder part of the code.

JavaScript:

  • Move highlighting of region markers to the "FindComments" context.
  • Fix: highlight comments after "<".

Also, examples have been added in the test files.

Reviewers: Framework: Syntax Highlighting, dhaumann, cullmann

Reviewed By: Framework: Syntax Highlighting, dhaumann

Subscribers: kwrite-devel, kde-frameworks-devel

Tags: Kate, Frameworks

Differential Revision: https://phabricator.kde.org/D19249