Skip to content

Commit

Permalink
fix: Fix grammar for number values and size values
Browse files Browse the repository at this point in the history
  • Loading branch information
hangxingliu committed Apr 28, 2024
1 parent 1885c9a commit bb87cf9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/syntax/common/tmLanguage-repo-patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,19 @@ export const allRepositories = {
numbers: {
patterns: [
{
match: /(?<=\s|=)\d+(?:\.\d+)?(?=\s|$)/,
match: /(?<=\s|=)\d+(?:\.\d+)?(?=[\s:]|$)/,
name: scopes.numeric,
},
],
},
sizes: {
patterns: [
{
match: /(?<=\s|=)\d+(?:\.\d+)?[KMGT](?=\s|$)/,
match: /(?<=\s|=)\d+(?:\.\d+)?[KMGT](?=[\s:]|$)/,
name: scopes.numeric,
},
{
match: /(?<==)infinity(?=\s|$)/,
match: /(?<==)infinity(?=[\s:]|$)/,
name: scopes.numeric,
},
],
Expand Down
6 changes: 3 additions & 3 deletions src/syntax/mkosi.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<key>name</key>
<string>constant.numeric</string>
<key>match</key>
<string>(?&lt;=\s|=)\d+(?:\.\d+)?(?=\s|$)</string>
<string>(?&lt;=\s|=)\d+(?:\.\d+)?(?=[\s:]|$)</string>
</dict>
</array>
</dict>
Expand All @@ -136,13 +136,13 @@
<key>name</key>
<string>constant.numeric</string>
<key>match</key>
<string>(?&lt;=\s|=)\d+(?:\.\d+)?[KMGT](?=\s|$)</string>
<string>(?&lt;=\s|=)\d+(?:\.\d+)?[KMGT](?=[\s:]|$)</string>
</dict>
<dict>
<key>name</key>
<string>constant.numeric</string>
<key>match</key>
<string>(?&lt;==)infinity(?=\s|$)</string>
<string>(?&lt;==)infinity(?=[\s:]|$)</string>
</dict>
</array>
</dict>
Expand Down
6 changes: 3 additions & 3 deletions src/syntax/systemd.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@
<key>name</key>
<string>constant.numeric</string>
<key>match</key>
<string>(?&lt;=\s|=)\d+(?:\.\d+)?(?=\s|$)</string>
<string>(?&lt;=\s|=)\d+(?:\.\d+)?(?=[\s:]|$)</string>
</dict>
</array>
</dict>
Expand All @@ -466,13 +466,13 @@
<key>name</key>
<string>constant.numeric</string>
<key>match</key>
<string>(?&lt;=\s|=)\d+(?:\.\d+)?[KMGT](?=\s|$)</string>
<string>(?&lt;=\s|=)\d+(?:\.\d+)?[KMGT](?=[\s:]|$)</string>
</dict>
<dict>
<key>name</key>
<string>constant.numeric</string>
<key>match</key>
<string>(?&lt;==)infinity(?=\s|$)</string>
<string>(?&lt;==)infinity(?=[\s:]|$)</string>
</dict>
</array>
</dict>
Expand Down

0 comments on commit bb87cf9

Please sign in to comment.