D11470: SQL: various improvements and fix if/case/loop/end detection with SQL (Oracle)
Dominik Haumann
noreply at phabricator.kde.org
Sat Apr 14 00:46:29 UTC 2018
dhaumann requested changes to this revision.
dhaumann added a comment.
This revision now requires changes to proceed.
Looks mostly good, but there are some minor issues we first need to address:
- dsControlFlow and similar default styles were added with KDE Frameworks 5, so kateversion="5.0" is required in the header
- WordDetect for things like "end if" is not sensitive to multiple spaces anymore. Are you sure this is correct? If not, please keep RegExpr.
Please provide an updated revision, I think the next one is good to go in. :-)
INLINE COMMENTS
> sql-mysql.xml:9
> -->
> -<language name="SQL (MySQL)" version="3" kateversion="3.4" section="Database" extensions="*.sql;*.SQL;*.ddl;*.DDL" mimetype="text/x-sql" casesensitive="0" author="Shane Wright (me at shanewright.co.uk)" license="">
> +<language name="SQL (MySQL)" version="4" kateversion="3.4" section="Database" extensions="*.sql;*.SQL;*.ddl;*.DDL" mimetype="text/x-sql" casesensitive="0" author="Shane Wright (me at shanewright.co.uk)" license="">
> <highlighting>
kateversion="5.0" is required due to dsControlFlow.
> sql-oracle.xml:4
> <!-- Oracle SQL, syntax definition based on sql.xml by Yury Lebedev -->
> -<language name="SQL (Oracle)" version="4" kateversion="2.4" section="Database" extensions="*.sql;*.SQL;*.ddl;*.DDL;*.trg;*.TRG;*.spc;*.SPC;*.bdy;*.DBY" mimetype="text/x-sql" casesensitive="0" author="Andrey Karepin (egdfree at opensuse.org)" license="LGPL">
> +<language name="SQL (Oracle)" version="5" kateversion="2.4" section="Database" extensions="*.sql;*.SQL;*.ddl;*.DDL;*.trg;*.TRG;*.spc;*.SPC;*.bdy;*.DBY" mimetype="text/x-sql" casesensitive="0" author="Andrey Karepin (egdfree at opensuse.org)" license="LGPL">
> <highlighting>
Since you are using dsControlFlow and similar new itemDatas, you have to change kateversion="5.0".
> sql-oracle.xml:1873
> + <WordDetect attribute="ControlFlow" context="#stay" String="if" beginRegion="if_block" insensitive="true"/>
> + <WordDetect attribute="ControlFlow" context="#stay" String="end if" endRegion="if_block" insensitive="true"/>
> + <WordDetect attribute="ControlFlow" context="#stay" String="case" beginRegion="case_block" insensitive="true"/>
Hm, I can see that WordDetect is possibly faster than the RegExpr here. Still, I *assume* there are arbitrary many spaces allowed in "end if". If (and only if) this is true, then I would prefer to keep the RegExpr variant. Same for the others.
The changes from StringDetect to WordDetect are certainly fine.
> sql-postgresql.xml:6
> -->
> -<language name="SQL (PostgreSQL)" version="5" kateversion="2.4" section="Database" extensions="*.sql;*.SQL;*.ddl;*.DDL" mimetype="text/x-sql" casesensitive="0" author="Shane Wright (me at shanewright.co.uk)" license="">
> +<language name="SQL (PostgreSQL)" version="6" kateversion="2.4" section="Database" extensions="*.sql;*.SQL;*.ddl;*.DDL" mimetype="text/x-sql" casesensitive="0" author="Shane Wright (me at shanewright.co.uk)" license="">
> <highlighting>
kateversion="5.0" :-)
> sql.xml:8
> <!-- kate: space-indent on; indent-width 2; replace-tabs on; -->
> -<language name="SQL" version="3" kateversion="2.4" section="Database" extensions="*.sql;*.SQL;*.ddl;*.DDL" mimetype="text/x-sql" casesensitive="0" author="Yury Lebedev (yurylebedev at mail.ru)" license="LGPL">
> +<language name="SQL" version="4" kateversion="2.4" section="Database" extensions="*.sql;*.SQL;*.ddl;*.DDL" mimetype="text/x-sql" casesensitive="0" author="Yury Lebedev (yurylebedev at mail.ru)" license="LGPL">
> <highlighting>
kateversion="5.0"
REPOSITORY
R216 Syntax Highlighting
REVISION DETAIL
https://phabricator.kde.org/D11470
To: jpoelen, #framework_syntax_highlighting, dhaumann
Cc: #frameworks, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180414/d7faaef0/attachment.html>
More information about the Kde-frameworks-devel
mailing list