Skip to content

Commit

Permalink
fix: Fix syntax for value(numbers,keywords) highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
hangxingliu committed Feb 28, 2024
1 parent f80a9e1 commit 49159c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/syntax/nginx.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -3406,7 +3406,7 @@
</dict>
<dict>
<key>match</key>
<string>[\t ](=?\d[\d\.]*[bBkKmMgGtTsShHdD]?)(?=[\t ;])</string>
<string>(?&lt;=\G|\s)(=?[0-9][0-9\.]*[bBkKmMgGtTsShHdD]?)(?=[\t ;])</string>
<key>captures</key>
<dict>
<key>1</key>
Expand All @@ -3420,13 +3420,13 @@
<key>name</key>
<string>constant.language.nginx</string>
<key>match</key>
<string>[\t ](on|off|true|false)(?=[\t ;])</string>
<string>(?&lt;=\G|\s)(on|off|true|false)(?=[\t ;])</string>
</dict>
<dict>
<key>name</key>
<string>constant.language.nginx</string>
<key>match</key>
<string>[\t ](kqueue|rtsig|epoll|\/dev\/poll|select|poll|eventport|max|all|default_server|default|main|crit|error|debug|warn|notice|last)(?=[\t ;])</string>
<string>(?&lt;=\G|\s)(kqueue|rtsig|epoll|\/dev\/poll|select|poll|eventport|max|all|default_server|default|main|crit|error|debug|warn|notice|last)(?=[\t ;])</string>
</dict>
<dict>
<key>name</key>
Expand Down
8 changes: 4 additions & 4 deletions src/syntax/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,22 @@ export const syntaxRepository: {
name: names.comment,
},
// {
// match: /[\t ]([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|[0-9a-f:]+)(\/[0-9]{2})?(?=[\t ;])/,
// match: /(?<=\G|\s)([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|[0-9a-f:]+)(\/[0-9]{2})?(?=[\t ;])/,
// captures: {
// '1': names.ipaddr,
// '2': names.cidr,
// }
// },
{
match: /[\t ](=?\d[\d\.]*[bBkKmMgGtTsShHdD]?)(?=[\t ;])/,
match: /(?<=\G|\s)(=?[0-9][0-9\.]*[bBkKmMgGtTsShHdD]?)(?=[\t ;])/,
captures: {
'1': names.numeric,
}
}, {
match: /[\t ](on|off|true|false)(?=[\t ;])/,
match: /(?<=\G|\s)(on|off|true|false)(?=[\t ;])/,
name: names.languageConstant,
}, {
match: /[\t ](kqueue|rtsig|epoll|\/dev\/poll|select|poll|eventport|max|all|default_server|default|main|crit|error|debug|warn|notice|last)(?=[\t ;])/,
match: /(?<=\G|\s)(kqueue|rtsig|epoll|\/dev\/poll|select|poll|eventport|max|all|default_server|default|main|crit|error|debug|warn|notice|last)(?=[\t ;])/,
name: names.languageConstant,
}, {
match: /\\.*\ |\~\*|\~|\!\~\*|\!\~/,
Expand Down

0 comments on commit 49159c0

Please sign in to comment.