[gtksourceview] rst.lang: Handle roman numerals enumerations



commit 40508278ea5bf63b3f4a3f15c74e5d304f2098a7
Author: Pierre Ossman <ossman cendio se>
Date:   Fri Oct 15 09:58:50 2021 +0200

    rst.lang: Handle roman numerals enumerations

 data/language-specs/rst.lang | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/data/language-specs/rst.lang b/data/language-specs/rst.lang
index fabd260b..e171102e 100644
--- a/data/language-specs/rst.lang
+++ b/data/language-specs/rst.lang
@@ -77,8 +77,20 @@
       <match>^\s*[\*\+\-•‣⁃] </match>
     </context>
 
+    <define-regex id="roman-upper" extended="true">
+      (M*(C[MD]|D?C{0,3})(X[CL]|L?X{0,3})(I[XV]|V?I{0,3}))
+    </define-regex>
+
+    <define-regex id="roman-lower" extended="true">
+      (m*(c[md]|d?c{0,3})(x[cl]|l?x{0,3})(i[xc]|c?i{0,3}))
+    </define-regex>
+
+    <define-regex id="roman-numerals" extended="true">
+      ((\%{roman-upper})|(\%{roman-lower}))
+    </define-regex>
+
     <define-regex id="enumerator-chars" extended="true">
-      ([a-zA-Z]|([0-9]+))
+      ([a-zA-Z]|([0-9]+)|(\%{roman-numerals}))
     </define-regex>
 
     <context id="enumerator" style-ref="bullet">


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]