diff --git a/assets/syntaxes/02_Extra/log.sublime-syntax b/assets/syntaxes/02_Extra/log.sublime-syntax index a68c7e83..0ce01f10 100644 --- a/assets/syntaxes/02_Extra/log.sublime-syntax +++ b/assets/syntaxes/02_Extra/log.sublime-syntax @@ -38,21 +38,21 @@ contexts: scope: markup.underline.link.scheme.log push: url-host log_level_lines: - - match: ^(?=.*{{error}}) + - match: (?=.*{{error}}) push: - - error_line + - error_line_meta - main_pop_at_eol - - match: ^(?=.*{{warning}}) + - match: (?=.*{{warning}}) push: - - warning_line + - warning_line_meta - main_pop_at_eol - - match: ^(?=.*{{info}}) + - match: (?=.*{{info}}) push: - - info_line + - info_line_meta - main_pop_at_eol - - match: ^(?=.*{{debug}}) + - match: (?=.*{{debug}}) push: - - debug_line + - debug_line_meta - main_pop_at_eol log_levels: - match: '{{error}}' @@ -63,16 +63,16 @@ contexts: scope: markup.info.log - match: '{{debug}}' scope: markup.info.log - error_line: + error_line_meta: - meta_scope: meta.annotation.error-line.log - include: immediately_pop - warning_line: + warning_line_meta: - meta_scope: meta.annotation.warning-line.log - include: immediately_pop - info_line: + info_line_meta: - meta_scope: meta.annotation.info-line.log - include: immediately_pop - debug_line: + debug_line_meta: - meta_scope: meta.annotation.debug-line.log - include: immediately_pop immediately_pop: diff --git a/assets/syntaxes/02_Extra/syslog.sublime-syntax b/assets/syntaxes/02_Extra/syslog.sublime-syntax index 1efad346..b1e10cca 100644 --- a/assets/syntaxes/02_Extra/syslog.sublime-syntax +++ b/assets/syntaxes/02_Extra/syslog.sublime-syntax @@ -31,22 +31,24 @@ contexts: structured-data: - match: '\[' scope: punctuation.section.mapping.begin.syslog - push: - - match: \] - scope: punctuation.section.mapping.end.syslog - pop: true - - match: \w+ - scope: variable.parameter.syslog - - match: = - scope: keyword.operator.assignment.syslog - push: - - match: '[^\s\]]+' - scope: constant.other.syslog - pop: true - - match: (?=\]) - pop: true + push: structured-data-contents - match: (?=\S) set: text + structured-data-contents: + - match: \] + scope: punctuation.section.mapping.end.syslog + pop: true + - match: \w+ + scope: variable.parameter.syslog + - match: = + scope: keyword.operator.assignment.syslog + push: structured-data-assignment + structured-data-assignment: + - match: '[^\s\]]+' + scope: constant.other.syslog + pop: true + - match: (?=\]) + pop: true text: - match: $ pop: true diff --git a/tests/syntax-tests/source/Syslog/example.syslog b/tests/syntax-tests/source/Syslog/example.syslog index 9dc82e7c..5b7e575b 100644 --- a/tests/syntax-tests/source/Syslog/example.syslog +++ b/tests/syntax-tests/source/Syslog/example.syslog @@ -14,3 +14,4 @@ Aug 11 13:36:34 192.168.220.5 nginx: 2021/08/11 13:36:34 [debug] 2031#2031: epol Aug 11 21:31:08 ::1 nginx: 2021/08/11 21:31:08 [debug] 760831#760831: epoll add event: fd:6 op:1 ev:10000001 Aug 11 21:40:31 hostname-here scop hello Aug 16 21:38:21 hostname-here systemd[1]: Finished Cleanup of Temporary Directories. +2025-02-08 20:52:11.039 - setfont: ERROR kdfontop.c:183 put_font_kdfontop: Unable to load such font with such kernel version