diff options
| author | Rubén Beltrán del Río <jj@r.bdr.sh> | 2025-12-26 21:17:05 +0100 |
|---|---|---|
| committer | Rubén Beltrán del Río <jj@r.bdr.sh> | 2025-12-26 21:25:41 +0100 |
| commit | 5cb79e3f86b5328301eabbbc409f254b58ee9bf4 (patch) | |
| tree | 78d48265bc840b4e7564ed38b3ba9a3026001fdb /resources | |
Initial build
Diffstat (limited to 'resources')
| -rw-r--r-- | resources/wmap.lang | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/resources/wmap.lang b/resources/wmap.lang new file mode 100644 index 0000000..c00d29e --- /dev/null +++ b/resources/wmap.lang @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="UTF-8"?> +<language id="wmap" name="wmap Wardley Map Definition Language" version="2.0" section="Markup"> + <metadata> + <property name="mimetypes">text/x-wmap</property> + <property name="globs">*.wmap</property> + <property name="line-comment-start">#</property> + </metadata> + + <styles> + <style id="keyword" name="Keyword" map-to="def:keyword"/> + <style id="node-name" name="Node Name" map-to="def:identifier"/> + <style id="coordinate" name="Coordinate" map-to="def:number"/> + <style id="shape" name="Shape" map-to="def:type"/> + <style id="operator" name="Operator" map-to="def:operator"/> + <style id="note-text" name="Note Text" map-to="def:string"/> + <style id="evolution-sign" name="Evolution Sign" map-to="def:operator"/> + <style id="stage" name="Stage" map-to="def:special-constant"/> + <style id="group-list" name="Group List" map-to="def:identifier"/> + </styles> + + <definitions> + <!-- Node pattern: Name (x,y) [optional shape] --> + <context id="node"> + <match extended="true" case-sensitive="false"> + ^([^\(\[\]]*?)\s* + \(\s*([0-9]+\.?[0-9]*)\s*,\s*([0-9]+\.?[0-9]*)\s*\) + \s*(?:\[(Square|Triangle|x)\])?\s*$ + </match> + <include> + <context sub-pattern="1" style-ref="node-name"/> + <context sub-pattern="2" style-ref="coordinate"/> + <context sub-pattern="3" style-ref="coordinate"/> + <context sub-pattern="4" style-ref="shape"/> + </include> + </context> + + <!-- Edge pattern: Node -\- Node or Node -> Node --> + <context id="edge"> + <match extended="true" case-sensitive="false"> + ^(.+?)\s*(--|->)\s*(.+)$ + </match> + <include> + <context sub-pattern="1" style-ref="node-name"/> + <context sub-pattern="2" style-ref="operator"/> + <context sub-pattern="3" style-ref="node-name"/> + </include> + </context> + + <!-- Blocker pattern: [Blocker] Node --> + <context id="blocker"> + <match extended="true" case-sensitive="false"> + ^\[(Blocker)\]\s*(.+)$ + </match> + <include> + <context sub-pattern="1" style-ref="keyword"/> + <context sub-pattern="2" style-ref="node-name"/> + </include> + </context> + + <!-- Evolution pattern: [Evolution] Node +/-x --> + <context id="evolution"> + <match extended="true" case-sensitive="false"> + ^\[(Evolution)\]\s*(.+)\s*([-+])\s*([0-9]+\.?[0-9]*)$ + </match> + <include> + <context sub-pattern="1" style-ref="keyword"/> + <context sub-pattern="2" style-ref="node-name"/> + <context sub-pattern="3" style-ref="evolution-sign"/> + <context sub-pattern="4" style-ref="coordinate"/> + </include> + </context> + + <!-- Note pattern: [Note] (x,y) Text --> + <context id="note"> + <match extended="true" case-sensitive="false"> + ^\[(Note)\]\s* + \(\s*([0-9]+\.?[0-9]*)\s*,\s*([0-9]+\.?[0-9]*)\s*\) + \s*(.*)$ + </match> + <include> + <context sub-pattern="1" style-ref="keyword"/> + <context sub-pattern="2" style-ref="coordinate"/> + <context sub-pattern="3" style-ref="coordinate"/> + <context sub-pattern="4" style-ref="note-text"/> + </include> + </context> + + <!-- Stage pattern: [I], [II], or [III] x --> + <context id="stage"> + <match extended="true" case-sensitive="false"> + ^\[(I{1,3})\]\s*([0-9]+\.?[0-9]*)$ + </match> + <include> + <context sub-pattern="1" style-ref="stage"/> + <context sub-pattern="2" style-ref="coordinate"/> + </include> + </context> + + <!-- Group pattern: [Group] Node1, Node2, ... --> + <context id="group"> + <match extended="true" case-sensitive="false"> + ^\[(Group)\]\s*(.+)$ + </match> + <include> + <context sub-pattern="1" style-ref="keyword"/> + <context sub-pattern="2" style-ref="group-list"/> + </include> + </context> + + <!-- Main context --> + <context id="wmap"> + <include> + <context ref="blocker"/> + <context ref="evolution"/> + <context ref="note"/> + <context ref="stage"/> + <context ref="group"/> + <context ref="edge"/> + <context ref="node"/> + </include> + </context> + </definitions> +</language> |