فهرست منبع

`mybatis`语法高亮

mxd 3 سال پیش
والد
کامیت
1cd3715d1d
2فایلهای تغییر یافته به همراه6 افزوده شده و 3 حذف شده
  1. 3 0
      src/scripts/editor/magic-script.js
  2. 3 3
      src/scripts/editor/mybatis.js

+ 3 - 0
src/scripts/editor/magic-script.js

@@ -67,7 +67,10 @@ export const initializeMagicScript = () => {
             { open: '"""', close: '"""', notIn: ['string.multi'] },
             { open: '<where>', close: '</where>' },
             { open: '<if', close: ' test=""></if>' },
+            { open: '<elseif', close: ' test=""></elseif>' },
+            { open: '<else', close: '></else>' },
             { open: '<set>', close: '</set>' },
+            { open: '<trim>', close: '</trim>' },
             { open: '<foreach', close: ' collection=""></foreach>' },
             { open: '"', close: '"', notIn: ['string'] },
             { open: '\'', close: '\'', notIn: ['string'] },

+ 3 - 3
src/scripts/editor/mybatis.js

@@ -1315,7 +1315,7 @@ export const initMybatis = () => {
                 { include: '@strings' },
                 { include: '@complexIdentifiers' },
                 { include: '@scopes' },
-                [/(<)(where|set|foreach|if|trim)/, ['delimiter', { token: 'tag', next: '@xml' }]],
+                [/(<)(where|set|foreach|if|trim|elseif|else)/, ['delimiter', { token: 'tag', next: '@xml' }]],
                 [/[;,.]/, 'delimiter'],
                 [/[()]/, '@brackets'],
                 [
@@ -1409,10 +1409,10 @@ export const initMybatis = () => {
                     }
                 ],
                 [/[ \t\r\n]+/],
-                [/(<\/)(where|if|set|foreach|trim)(>)/, ['delimiter', 'tag', { token: 'delimiter', next: '@pop' }]]
+                [/(<\/)(where|if|set|foreach|trim|elseif|else)(>)/, ['delimiter', 'tag', { token: 'delimiter', next: '@pop' }]]
             ],
             xmlEmbedded: [
-                [/<\/(where|if|set|foreach|trim)/, { token: 'tag', next: '@pop', nextEmbedded: '@pop' }],
+                [/<\/(where|if|set|foreach|trim|elseif|else)/, { token: 'tag', next: '@pop', nextEmbedded: '@pop' }],
                 [/[^<]+/, '']
             ]
         }