Skip to content

Commit

Permalink
给MT高亮的op语句自操作做额外高亮, 方便查看
Browse files Browse the repository at this point in the history
  • Loading branch information
A4-Tacks committed Jun 26, 2024
1 parent b912b66 commit 2ed9c35
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
43 changes: 21 additions & 22 deletions syntax/MT-Manager/MindustryLogic-compiled.mtsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,31 +167,30 @@
6: "number"
}
{
match: include("bg") + /(op)/ + include("_") + /(?:(/ + include("op-operator1") + /)/ + include("_") + include("var") + include("_") + include("val") + include("_") + include("fill") + /|(/ + include("op-operator2") + /)/ + include("_") + include("var") + include("_") + include("val") + include("_") + include("val") + /|/ + include("err") + /(?:/ + include("_") + include("val") + /){3})/ + include("ed")
match: include("bg") + /(op)/ + include("_") + /(?:(/ + include("op-operator1") + /)/ + include("_") + /(?<a1>/ + include("var") + /)/ + include("_") + /(?:(\k<a1>)|/ + include("val") + /)/ + include("_") + include("fill") + /|(/ + include("op-operator2") + /)/ + include("_") + /(?<a2>/ + include("var") + /)(?:/ + include("_") + /(?:(\k<a2>)|/ + include("val") + /)){2}|/ + include("err") + /(?:/ + include("_") + include("val") + /){3})/ + include("ed")
recordAllGroups: true
1: "operation"
2: "operation"
3: "resultVar"
4: "strEscape"
5: "string"
6: "strEscape"
7: "number"
8: "comment"
9: "strEscape"
10: "operation"
11: "resultVar"
12: "strEscape"
13: "string"
14: "strEscape"
15: "number"
16: "string"
17: "strEscape"
18: "number"
19: "error"
20: "strEscape"
21: "string"
22: "strEscape"
23: "number"
4: "resultVar"
5: "strEscape"
6: "resultVar"
7: "string"
8: "strEscape"
9: "number"
10: "comment"
11: "strEscape"
12: "operation"
14: "resultVar"
15: "strEscape"
16: "resultVar"
17: "string"
18: "strEscape"
19: "number"
20: "error"
21: "strEscape"
22: "string"
23: "strEscape"
24: "number"
}
{
match: include("bg") + /(lookup)/ + include("_") + /(?:(item|block|unit|liquid)|/ + include("err") + /)/ + include("_") + include("var") + include("_") + include("val") + include("ed")
Expand Down
8 changes: 4 additions & 4 deletions syntax/MT-Manager/MindustryLogic.mtsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@
$recordAllGroups: true
$1: "operation"
: @bg /(op)/ @_ (?:
(@op-operator1) @_ @var @_ @val @_ @fill
| (@op-operator2) @_ @var @_ @val @_ @val
($operation @op-operator1) @_ (/?<a1>/ @var)
@_ (?:($resultVar /\k<a1>/) | @val) @_ @fill
| ($operation @op-operator2) @_ (/?<a2>/ @var)
(?:@_ (?:($resultVar /\k<a2>/) | @val)){2}
| @err (?:@_ @val){3}
) @ed
$recordAllGroups: true
$1: "operation"
$2: "operation"
$3: "operation"
: @bg /(lookup)/ @_ /(?:(item|block|unit|liquid)|/ @err /)/ @_ @var @_ @val @ed
$recordAllGroups: true
$1: "operation"
Expand Down

0 comments on commit 2ed9c35

Please sign in to comment.