[education/rkward] rkward: Install rkward.xml via qrc

Thomas Friedrichsmeier null at kde.org
Mon Jan 2 11:10:44 GMT 2023


Git commit 5a7cbffdcbde02861096aba33c019cd5c0596d55 by Thomas Friedrichsmeier.
Committed on 02/01/2023 at 11:10.
Pushed by tfry into branch 'master'.

Install rkward.xml via qrc

M  +3    -0    rkward/resources.qrc
M  +4    -6    rkward/syntax/CMakeLists.txt
M  +1    -1    rkward/syntax/rkward.xml

https://invent.kde.org/education/rkward/commit/5a7cbffdcbde02861096aba33c019cd5c0596d55

diff --git a/rkward/resources.qrc b/rkward/resources.qrc
index f3bed08e..2b4c87e9 100644
--- a/rkward/resources.qrc
+++ b/rkward/resources.qrc
@@ -16,4 +16,7 @@
 
 	<file alias="rkdummypart.rc">misc/rkdummypart.rc</file>
 </qresource>
+<qresource prefix="/org.kde.syntax-highlighting/syntax-addons">
+	<file alias="rkward.xml">syntax/rkward.xml</file>
+</qresource>
 </RCC>
diff --git a/rkward/syntax/CMakeLists.txt b/rkward/syntax/CMakeLists.txt
index 3d08bdb6..5ccbecf4 100644
--- a/rkward/syntax/CMakeLists.txt
+++ b/rkward/syntax/CMakeLists.txt
@@ -1,7 +1,5 @@
-IF(${KF5_VERSION} VERSION_GREATER "5.27.9")
-    SET(SYNTAX_DEST ${DATA_INSTALL_DIR}/org.kde.syntax-highlighting/syntax/)
-ELSE(${KF5_VERSION} VERSION_GREATER "5.27.9")
-    SET(SYNTAX_DEST ${DATA_INSTALL_DIR}/katepart5/syntax/)
-ENDIF(${KF5_VERSION} VERSION_GREATER "5.27.9")
+# rkward.xml is also installed as a qresource via the parent CMakeLists.txt, but will not be found, there, before KF5 5.86.0
+IF(${KF5_VERSION} VERSION_LESS "5.86.0")
+    INSTALL(FILES rkward.xml DESTINATION ${DATA_INSTALL_DIR}/org.kde.syntax-highlighting/syntax/)
+ENDIF()
 
-INSTALL(FILES rkward.xml DESTINATION ${SYNTAX_DEST})
diff --git a/rkward/syntax/rkward.xml b/rkward/syntax/rkward.xml
index bfd1674e..db902ced 100644
--- a/rkward/syntax/rkward.xml
+++ b/rkward/syntax/rkward.xml
@@ -140,7 +140,7 @@
 			<RegExpr attribute="Assign" context="operator_rhs" String="[<]{1,2}\-"/>
 			<RegExpr attribute="Assign" context="operator_rhs" String="\-[>]{1,2}"/>
 			<RegExpr attribute="Assign" context="operator_rhs" String="=(?!=)"/>
-			<RegExpr attribute="Operator" context="operator_rhs" String="(\+|\-|\*{1,2}|/|<=?|>=?|={1,2}|\!=?|\|{1,2}|&{1,2}|:{1,3}|\^|@|\$|~)"/>
+			<RegExpr attribute="Operator" context="operator_rhs" String="(\+|\-|\*{1,2}|/|<=?|>=?|={1,2}|\!=?|\|[>\|]?|&{1,2}|:{1,3}|\^|@|\$|~)"/>
 			<RegExpr attribute="Operator" context="operator_rhs" String="%[^%]*%"/>
 
 			<!-- Contrary to the normal R Script highlighting, we don't start a region here, but we do go into a command sub-context -->


More information about the rkward-tracker mailing list