|
2 | 2 | " Language: Mermaid |
3 | 3 | " Maintainer: Craig MacEahern <https://github.com/craigmac/vim-mermaid> |
4 | 4 | " Filenames: *.mmd |
5 | | -" Last Change: 2022 Nov 22 |
| 5 | +" Last Change: 2023 Dec 26 |
6 | 6 |
|
7 | 7 | if exists("b:current_syntax") |
8 | 8 | finish |
@@ -85,54 +85,30 @@ syntax keyword mermaidKeyword |
85 | 85 | highlight link mermaidKeyword Keyword |
86 | 86 |
|
87 | 87 | syntax match mermaidStatement "|" |
88 | | -syntax match mermaidStatement "--\?[>x)]>\?+\?-\?" |
89 | 88 | syntax match mermaidStatement "\~\~\~" |
90 | 89 | syntax match mermaidStatement "--" |
91 | | -syntax match mermaidStatement "---" |
92 | | -syntax match mermaidStatement "-->" |
| 90 | +syntax match mermaidStatement "\%(<|\|[<*o]\)\?\%(--\|\.\.\)\%(|>\|[>*o]\)\?" |
| 91 | +syntax match mermaidStatement "-\{2,4}[>ox-]" |
| 92 | +syntax match mermaidStatement "\.-[>ox]" |
93 | 93 | syntax match mermaidStatement "-\." |
94 | | -syntax match mermaidStatement "\.->" |
95 | | -syntax match mermaidStatement "-\.-" |
96 | | -syntax match mermaidStatement "-\.\.-" |
97 | | -syntax match mermaidStatement "-\.\.\.-" |
| 94 | +syntax match mermaidStatement "-\.\{1,3}-" |
98 | 95 | syntax match mermaidStatement "==" |
99 | | -syntax match mermaidStatement "==>" |
100 | | -syntax match mermaidStatement "===>" |
101 | | -syntax match mermaidStatement "====>" |
| 96 | +syntax match mermaidStatement "=\{2,4}[>ox=]" |
102 | 97 | syntax match mermaidStatement "&" |
103 | | -syntax match mermaidStatement "--o" |
104 | | -syntax match mermaidStatement "--x" |
| 98 | +syntax match mermaidStatement "--\?[>x)]>\?[+-]\?" |
105 | 99 | syntax match mermaidStatement "x--x" |
106 | | -syntax match mermaidStatement "-----" |
107 | | -syntax match mermaidStatement "---->" |
108 | | -syntax match mermaidStatement "===" |
109 | | -syntax match mermaidStatement "====" |
110 | | -syntax match mermaidStatement "=====" |
| 100 | +syntax match mermaidStatement "o--o\?" |
| 101 | +syntax match mermaidStatement "<-->\?" |
111 | 102 | syntax match mermaidStatement ":::" |
112 | | -syntax match mermaidStatement "<|--" |
113 | | -syntax match mermaidStatement "\*--" |
114 | | -syntax match mermaidStatement "o--" |
115 | | -syntax match mermaidStatement "o--o" |
116 | | -syntax match mermaidStatement "<--" |
117 | | -syntax match mermaidStatement "<-->" |
118 | | -syntax match mermaidStatement "\.\." |
119 | | -syntax match mermaidStatement "<\.\." |
120 | | -syntax match mermaidStatement "<|\.\." |
121 | | -syntax match mermaidStatement "--|>" |
122 | | -syntax match mermaidStatement "--\*" |
123 | | -syntax match mermaidStatement "--o" |
124 | | -syntax match mermaidStatement "\.\.>" |
125 | | -syntax match mermaidStatement "\.\.|>" |
126 | | -syntax match mermaidStatement "<|--|>" |
127 | 103 | syntax match mermaidStatement "||--o{" |
128 | 104 | highlight link mermaidStatement Statement |
129 | 105 |
|
130 | | -syntax match mermaidIdentifier "[\+-]\?\w\+(.*)[\$\*]\?" |
131 | | -highlight link mermaidIdentifier Identifier |
| 106 | +" FIXME: This unexpectedly matches flow chart node `id1(text)` or others. |
| 107 | +"syntax match mermaidIdentifier "[\+-]\?\w\+(.*)[\$\*]\?" |
| 108 | +"highlight link mermaidIdentifier Identifier |
132 | 109 |
|
133 | | -syntax match mermaidType "[\+-\#\~]\?\cint\>" |
134 | | -syntax match mermaidType "[\+-\#\~]\?\cString\>" |
135 | | -syntax match mermaidType "[\+-\#\~]\?\cbool\>" |
| 110 | +syntax match mermaidType "[\+-\#\~]\?\c\%(const\s\+\|\*\s*\)*\%(unsigned\s\+\)\?\%(int\|u\?int\%(8\|16\|32\|64\)_t\|char\|long\|long\s\+long\)\>\%(\s\+const\|\s*[\*&]\)*" |
| 111 | +syntax match mermaidType "[\+-\#\~]\?\c\%(const\s\+\|\*\s*\)*\%(double\|float\|String\|bool\)\>\%(\s\+const\|\s*[\*&]\)*" |
136 | 112 | syntax match mermaidType "[\+-\#\~]\?\cBigDecimal\>" |
137 | 113 | syntax match mermaidType "[\+-\#\~]\?\cList\~.\+\~" |
138 | 114 | syntax match mermaidType "<<\w\+>>" |
|
0 commit comments