summaryrefslogtreecommitdiffstats
path: root/assets
diff options
context:
space:
mode:
authorKeith Hall <kingkeith+github@gmail.com>2021-04-04 22:42:13 +0300
committerKeith Hall <kingkeith+github@gmail.com>2021-04-04 22:47:01 +0300
commit1537733e6b0d764e092b701565de94c51ef3ecf1 (patch)
treec320554b2b3ebc0588be90afdff353deb7c4cfb5 /assets
parentba0d43672b783d4a7195b21bfb378e7ba0c4d6ab (diff)
replace Syslog dependency with a custom syntax
Diffstat (limited to 'assets')
m---------assets/syntaxes/02_Extra/Syslog0
-rw-r--r--assets/syntaxes/02_Extra/syslog.sublime-syntax70
2 files changed, 70 insertions, 0 deletions
diff --git a/assets/syntaxes/02_Extra/Syslog b/assets/syntaxes/02_Extra/Syslog
deleted file mode 160000
-Subproject 7628d4e0b89d3b4f0dcc014bfb4a3e3433f5133
diff --git a/assets/syntaxes/02_Extra/syslog.sublime-syntax b/assets/syntaxes/02_Extra/syslog.sublime-syntax
new file mode 100644
index 00000000..6233da17
--- /dev/null
+++ b/assets/syntaxes/02_Extra/syslog.sublime-syntax
@@ -0,0 +1,70 @@
+%YAML 1.2
+---
+# http://www.sublimetext.com/docs/3/syntax.html
+name: syslog
+file_extensions:
+ - syslog
+scope: text.syslog
+contexts:
+ main:
+ - match: '^\w+\s+\d+\s+\d{2}:\d{2}:\d{2}'
+ scope: meta.datetime.syslog constant.numeric.syslog
+ push: loghost
+ loghost:
+ - match: '[\w-]+'
+ scope: entity.other.attribute-name.loghost.syslog
+ set: process
+ process:
+ - match: ([\w-]+)(?:(\[)(\d+)(\]))?(:)
+ captures:
+ 1: support.function.process.syslog
+ 2: punctuation.separator.pid.begin.syslog
+ 3: meta.pid.syslog meta.number.integer.syslog constant.numeric.value.syslog
+ 4: punctuation.separator.mapping.syslog
+ set: structured-data
+ 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
+ - match: (?=\S)
+ set: text
+ text:
+ - match: (\w+)(=)
+ captures:
+ 1: variable.parameter.syslog
+ 2: keyword.operator.assignment.syslog
+ - match: (')([^']*)(')
+ scope: string.quoted.single.syslog
+ captures:
+ 1: punctuation.definition.string.begin.syslog
+ 3: punctuation.definition.string.end.syslog
+ - match: (")([^"]*)(")
+ scope: string.quoted.double.syslog
+ captures:
+ 1: punctuation.definition.string.begin.syslog
+ 3: punctuation.definition.string.end.syslog
+ - match: \d+
+ scope: meta.number.integer.syslog constant.numeric.value.syslog
+ - match: \b(CMD)\b\s+(\()
+ captures:
+ 1: entity.name.label.syslog
+ 2: punctuation.section.block.begin.syslog
+ embed: scope:source.shell.bash
+ escape: \)
+ escape_captures:
+ 0: punctuation.section.block.end.syslog
+ - match: $
+ pop: true