qmljs: fix arrow function reformatting

This is mainly just making sure that token that are "empty" are really
empty (to avoid writing them out in the reformatter), but still
contain the correct location (for error messages using for example
firstSourceLocation()).

Introduce a SourceLocation::zeroLength() method to make this change
simpler to do.

QtCreator does not run qlalr automatically, so it is "polluted" by the
updated generated files.

Fixes: QTCREATORBUG-25198
Change-Id: I0ab19fb380ee3d9a7d9e05d104fe313468f52703
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Fawzi Mohamed
2021-01-15 14:05:18 +01:00
parent 002db1fa42
commit b8d99af6fd
5 changed files with 144 additions and 116 deletions

View File

@@ -304,15 +304,15 @@ protected:
#define J_SCRIPT_EXPRESSIONSTATEMENTLOOKAHEAD_RULE 463
#line 4075 "qmljs.g"
#line 4076 "qmljs.g"
#define J_SCRIPT_CONCISEBODYLOOKAHEAD_RULE 533
#line 4617 "qmljs.g"
#line 4618 "qmljs.g"
#define J_SCRIPT_EXPORTDECLARATIONLOOKAHEAD_RULE 602
#line 4901 "qmljs.g"
#line 4902 "qmljs.g"
QT_QML_END_NAMESPACE