diff options
author | Keith Hall <kingkeith+github@gmail.com> | 2022-03-21 20:00:58 +0200 |
---|---|---|
committer | Keith Hall <kingkeith+github@gmail.com> | 2022-03-22 22:20:39 +0200 |
commit | c0ec03e08a98694a9af53da12bf8a82ad5fe5cf2 (patch) | |
tree | 56bea3cb99263aa59867663198b8e9b4dcbe353d /assets/syntaxes/02_Extra | |
parent | 9ab378b5dc7fa7835a27a641e51b5c362bf3bb00 (diff) |
Syntax: [Log] highlight escape characters in double quoted strings
Diffstat (limited to 'assets/syntaxes/02_Extra')
-rw-r--r-- | assets/syntaxes/02_Extra/log.sublime-syntax | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/assets/syntaxes/02_Extra/log.sublime-syntax b/assets/syntaxes/02_Extra/log.sublime-syntax index 3c699d2e..772819d0 100644 --- a/assets/syntaxes/02_Extra/log.sublime-syntax +++ b/assets/syntaxes/02_Extra/log.sublime-syntax @@ -6,6 +6,7 @@ file_extensions: scope: text.log variables: ipv4_part: (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?) + hours_minutes_seconds: (?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d) contexts: main: - match: (\w+)(=) @@ -17,11 +18,10 @@ contexts: captures: 1: punctuation.definition.string.begin.log 3: punctuation.definition.string.end.log - - match: (")([^"]*)(") - scope: string.quoted.double.log + - match: \" captures: 1: punctuation.definition.string.begin.log - 3: punctuation.definition.string.end.log + push: double_quoted_string - include: dates - include: ip_addresses - include: numbers @@ -29,19 +29,34 @@ contexts: scope: markup.error.log - match: \b(?i:warn(?:ing)?)\b scope: markup.warning.log + - match: \b(?i:debug)\b + scope: markup.info.log #- include: scope:text.html.markdown#autolink-inet - match: \b\w+:/{2,3} scope: markup.underline.link.scheme.log push: url-host dates: - - match: \b\d{4}-\d{2}-\d{2}\b + - match: \b\d{4}-\d{2}-\d{2}(?=\b|T) scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log - - match: \b\d{4}/\d{2}/\d{2}\b + push: maybe_date_time_separator + - match: \b\d{4}/\d{2}/\d{2}(?=\b|T) scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log - - match: \b(?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)(?:(\.)\d{3})?\b + push: maybe_date_time_separator + - match: \b(?={{hours_minutes_seconds}}) + push: time + time: + - match: (?:{{hours_minutes_seconds}})(?:(\.)\d{3})?\b scope: meta.time.log meta.number.integer.decimal.log constant.numeric.value.log captures: 1: punctuation.separator.decimal.log + - match: '' + pop: true + maybe_date_time_separator: + - match: T(?={{hours_minutes_seconds}}) + scope: meta.date.log meta.time.log keyword.other.log + set: time + - match: '' + pop: true ip_addresses: - match: \b(?=(?:{{ipv4_part}}\.){3}{{ipv4_part}}\b) push: @@ -114,3 +129,12 @@ contexts: scope: markup.underline.link.path.log - match: '' pop: true + double_quoted_string: + - meta_scope: string.quoted.double.log + - match: \\" + scope: constant.character.escape.log + - match: \\n + scope: constant.character.escape.log + - match: \" + scope: punctuation.definition.string.end.log + pop: true |