summaryrefslogtreecommitdiffstats
path: root/share/ui/svgpoints.lang
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:50:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:50:49 +0000
commitc853ffb5b2f75f5a889ed2e3ef89b818a736e87a (patch)
tree7d13a0883bb7936b84d6ecdd7bc332b41ed04bee /share/ui/svgpoints.lang
parentInitial commit. (diff)
downloadinkscape-c853ffb5b2f75f5a889ed2e3ef89b818a736e87a.tar.xz
inkscape-c853ffb5b2f75f5a889ed2e3ef89b818a736e87a.zip
Adding upstream version 1.3+ds.upstream/1.3+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/ui/svgpoints.lang')
-rw-r--r--share/ui/svgpoints.lang47
1 files changed, 47 insertions, 0 deletions
diff --git a/share/ui/svgpoints.lang b/share/ui/svgpoints.lang
new file mode 100644
index 0000000..f341af6
--- /dev/null
+++ b/share/ui/svgpoints.lang
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ This file is part of Inkscape.
+
+ Authors:
+ Rafael Siejakowski <rs@rs-math.net>
+
+ Copyright (C) 2022 the Authors.
+
+ Released under GNU GPL v2+, read the file 'COPYING' for more information.
+-->
+<language id="svgpoints" _name="SVG attribute 'points' of polygon and polyline elements" version="2.0" _section="Markup">
+ <styles>
+ <style id="error" _name="Error" map-to="def:error"/>
+ <style id="numeric" _name="Vertex coordinate" map-to="def:number"/>
+ </styles>
+
+ <definitions>
+ <define-regex id="exponent">e[+\-]?\d+</define-regex>
+ <define-regex id="fractional-constant">\d*\.\d+|\d+</define-regex>
+ <define-regex id="number">\%{fractional-constant}(\%{exponent})?</define-regex>
+ <define-regex id="coordinate">[+\-]?\%{number}</define-regex>
+ <define-regex id="invalid">[^\-+\s\r\n,\.0-9eE]</define-regex>
+
+ <!-- Invalid character (not allowed in the 'points' attribute). -->
+ <context id="invalid-char" style-ref="error" extend-parent="false" end-parent="true">
+ <match>\%{invalid}</match>
+ </context>
+
+ <!-- The 'points' attribute. -->
+ <context id="svgpoints">
+ <include>
+ <!-- Coordinate pair is defined as a region (allows for two numbers on separate lines). -->
+ <context id="point">
+ <start>\%{coordinate}</start>
+ <end>\%{coordinate}</end>
+ <include>
+ <context ref="invalid-char"/>
+ <context sub-pattern="0" where="start" style-ref="numeric"/>
+ <context sub-pattern="0" where="end" style-ref="numeric"/>
+ </include>
+ </context>
+ <context ref="invalid-char"/>
+ </include>
+ </context>
+ </definitions>
+</language>