Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
ui : update syntax highlight to match bitfan syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeantet committed Nov 15, 2017
1 parent e77db3e commit ac3eb8f
Showing 1 changed file with 59 additions and 44 deletions.
103 changes: 59 additions & 44 deletions cmd/bitfanUI/assets/public/vendor/ace/mode-logstash.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,87 +9,89 @@ var LogstashHighlightRules = function() {
// regexps are ordered -> the first match is used

this.$rules = {
start: [{
token: "storage.type.logstash",
start: [
{
token: "support.constant.logstash",
regex: /^(?:input|filter|codec|output)/,
comment: "classes: inputs, codecs, filters and outputs"
}, {
},


{
token: [
"keyword.control.logstash",
"text.logstash",
"text.logstash",
"string.text.logstash",
"text.logstash",
"text.logstash",
"keyword.operator.logstash"
],
regex: /(if|else if)(\s+)(\[)(\w*)(\])(\s*)(==|!=|<|>|<=|>=|=~|!~|in|not in|!)/,
comment: "if/else if statements"
},
{
token: [
"keyword.operator.logstash",
"text.logstash",
"text.logstash",
"entity.name.function.logstash",
"string.text.logstash",
"text.logstash"
],
regex: /(?:(and|or)(\s+)(\[)(\w*)(\]))+/,
comment: "complex if/else if statements"
}, {
},
{
token: "keyword.operator.logstash",
regex: /==|!=|<|>|<=|>=|=~|!~|in|not in|and|or|nand|xor|!/,
comment: "Operators"
}, {
},
{
token: "string.text.logstash",
regex: /".+?[^"]*"/,
comment: "String values"
},
{
token: [
"entity.name.function.logstash",
"entity.name.function.logstash",
"entity.name.function.logstash"
],
regex: /(%{)(\w*)(})/,
comment: "Groked Field"
}, {
token: "string.text.logstash",
regex: /".+?[^"]*"/,
comment: "String values"
}, {
token: [
"keyword.control.logstash",
"text.logstash",
"text.logstash",
"entity.name.function.logstash",
"text.logstash",
"text.logstash",
"keyword.operator.logstash"
],
regex: /(if|else if)(\s+)(\[)(\w*)(\])(\s*)(==|!=|<|>|<=|>=|=~|!~|in|not in|!)/,
comment: "if/else if statements"
}, {
},
{
token: [
"keyword.control.logstash",
"text.logstash",
"text.logstash"
],
regex: /(else)(\s+)({)/,
comment: "else statements"
}, {
},
{
token: [
"text.logstash",
"entity.name.function.logstash",
"variable.parameter.logstash",
"text.logstash",
"string.text.logstash",
"text.logstash",
"text.logstash",
"variable.text.logstash",
"text.logstash",
"keyword.operator.logstash",
"text.logstash"
"keyword.logstash",
],
regex: /^(\s*)(\w+)(\s*)("?.+?[^"]*"?)(\s*{)((?:\s*)?)((?:\w+)?)((?:\s*)?)((?:=>)?)((?:\s*)?)/,
comment: "functions: types of inputs, codecs, filters and outputs"
}, {
regex: /(\s*)(\w+)(\s*)(=>)/,
comment: "agent options"
},
{
token: "comment.line.number-sign.logstash",
regex: /#.+$/,
comment: "Comments"
}, {
},
{
token: [
"keyword.text.logstash",
"variable.text.logstash",
"keyword.text.logstash",
"keyword.operator.logstash",
"keyword.text.logstash",
"constant.numeric.logstash"
],
regex: /^((?:\s*)?)(\w+)((?:\s*)?)(=>)((?:\s*)?)(\d+)/,
regex: /(\d+)/,
comment: "Variables: Number values"
}, {
},
{
token: [
"keyword.text.logstash",
"variable.text.logstash",
Expand All @@ -99,7 +101,20 @@ var LogstashHighlightRules = function() {
],
regex: /^((?:\s*)?)(\w+)((?:\s*)?)(=>)((?:\s*)?)/,
comment: "Variables: String values"
}]
},
{
token: [
"keyword.text.logstash",
"entity.name.function.logstash",
"keyword.text.logstash",
"entity.name.function.logstash",
"keyword.text.logstash"
],
regex: /((?:\s}{*)?)(\w+)((?:\s*)?)(\w+)((?:\s*)?)/,
comment: "agent name"
}

]
}

this.normalizeRules();
Expand Down

0 comments on commit ac3eb8f

Please sign in to comment.