Skip to content

Commit

Permalink
refactor, should be pretty good now
Browse files Browse the repository at this point in the history
  • Loading branch information
vladdeSV committed Feb 6, 2021
1 parent 35d635c commit af24dd3
Showing 1 changed file with 36 additions and 32 deletions.
68 changes: 36 additions & 32 deletions syntaxes/klog.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,23 @@
"name": "keyword.other.tag.klog",
"match": "#[\\p{L}\\d_]+"
},
"summary-under-date": {
"name": "string.unquoted.summary.after-date.klog",
"begin": "\\G",
"end": "(?=^\\s*$|^(?: {2,4}|\t))",
"patterns": [
{
"name": "invalid.illegal.summary.whitespace-prefix.klog",
"match": "^ ."
},
{
"include": "#tag"
}
]
},
"summary-behind-entry": {
"name": "string.unquoted.summary.behind-entry.klog",
"begin": "\\G",
"begin": "(?<= +)",
"end": "$",
"patterns": [
{
Expand All @@ -22,18 +36,15 @@
},
"timespan-open-ended": {
"name": "markup.other.timespan.open-ended.klog",
"match": "((<?(?:[01]?\\d|2[0-3]):[0-5]\\d(?:am|pm)?>?) ?- ?\\?)"
"match": "((<?(?:[01]?\\d|2[0-3]):[0-5]\\d(?:am|pm)?>?) ?- ?\\?+)"
},
"duration": {
"match": "(?:(\\+?(?:\\d+h\\d+m|\\d+h|\\d+m))|(-(?:\\d+h\\d+m|\\d+h|\\d+m)))",
"captures": {
"1": {
"name": "markup.other.duration.positive.klog"
},
"2": {
"name": "markup.other.duration.negative.klog"
}
}
"duration-negative": {
"match": "-(?:\\d+h\\d+m|\\d+h|\\d+m)",
"name": "markup.other.duration.negative.klog"
},
"duration-positive": {
"match": "\\+?(?:\\d+h\\d+m|\\d+h|\\d+m)",
"name": "markup.other.duration.positive.klog"
},
"record": {
"begin": "^(\\d{4}-\\d{2}-\\d{2}|\\d{4}\\\\\\d{2}\\\\\\d{2})(?:\\s+\\((\\d+h\\d+m|\\d+h|\\d+m)!\\))?",
Expand All @@ -47,18 +58,7 @@
},
"patterns": [
{
"name": "string.unquoted.summary.after-date.klog",
"begin": "\\G",
"end": "(?=^$|^(?: {2,4}|\t))",
"patterns": [
{
"name": "invalid.illegal.summary.whitespace-prefix.klog",
"match": "^ \\w"
},
{
"include": "#tag"
}
]
"include": "#summary-under-date"
},
{
"begin": "^(?:\t| {2,4})",
Expand All @@ -71,17 +71,21 @@
"include": "#timespan-open-ended"
},
{
"include": "#duration"
"include": "#duration-positive"
},
{
"include": "#duration-negative"
},
{
"include": "#summary-behind-entry"
},
{
"name": "string.unquoted.summary.behind-entry.klog",
"begin": " +",
"end": "$",
"patterns": [
{
"include": "#tag"
"match": "([^ ]*)(?: |$)",
"captures": {
"1": {
"name": "invalid.illegal.missing-spacing-after-entry.klog"
}
]
}
}
]
}
Expand Down

0 comments on commit af24dd3

Please sign in to comment.