Merge branch 'master' into fix/file-detection

This commit is contained in:
Dmytro Maluka
2024-03-14 04:32:09 +01:00
committed by GitHub
65 changed files with 1114 additions and 363 deletions

View File

@@ -28,3 +28,6 @@ color-link color-column "#2D2F31"
#No extended types (bool in C, etc.)
#color-link type.extended "default"
#Plain brackets
color-link match-brace "#1D1F21,#62B1FE"
color-link tab-error "#D75F5F"
color-link trailingws "#D75F5F"

View File

@@ -26,3 +26,6 @@ color-link color-column "254"
#No extended types (bool in C, &c.) and plain brackets
color-link type.extended "241,231"
color-link symbol.brackets "241,231"
color-link match-brace "231,28"
color-link tab-error "210"
color-link trailingws "210"

View File

@@ -42,3 +42,6 @@ color-link gutter-warning "red"
color-link color-column "cyan"
color-link underlined.url "underline blue, white"
color-link divider "blue"
color-link match-brace "black,cyan"
color-link tab-error "brightred"
color-link trailingws "brightred"

View File

@@ -38,3 +38,6 @@ color-link color-column "#f26522"
color-link constant.bool "bold #55ffff"
color-link constant.bool.true "bold #85ff85"
color-link constant.bool.false "bold #ff8585"
color-link match-brace "#1e2124,#55ffff"
color-link tab-error "#d75f5f"
color-link trailingws "#d75f5f"

View File

@@ -29,3 +29,6 @@ color-link color-column "#2C2C2C"
color-link type.extended "default"
#color-link symbol.brackets "default"
color-link symbol.tag "#AE81FF,#242424"
color-link match-brace "#242424,#7A9EC2"
color-link tab-error "#D75F5F"
color-link trailingws "#D75F5F"

View File

@@ -29,3 +29,6 @@ color-link color-column "#323232"
color-link type.extended "default"
#color-link symbol.brackets "default"
color-link symbol.tag "#AE81FF,#282828"
color-link match-brace "#282828,#AE81FF"
color-link tab-error "#D75F5F"
color-link trailingws "#D75F5F"

View File

@@ -43,3 +43,7 @@ color-link cursor-line "#44475A,#F8F8F2"
color-link color-column "#44475A"
color-link type.extended "default"
color-link match-brace "#282A36,#FF79C6"
color-link tab-error "#D75F5F"
color-link trailingws "#D75F5F"

View File

@@ -33,3 +33,6 @@ color-link type "bold #3cc83c,#001e28"
color-link type.keyword "bold #5aaae6,#001e28"
color-link type.extended "#ffffff,#001e28"
color-link underlined "#608b4e,#001e28"
color-link match-brace "#001e28,#5aaae6"
color-link tab-error "#d75f5f"
color-link trailingws "#d75f5f"

View File

@@ -33,3 +33,6 @@ color-link type "bold #004080,#f0f0f0"
color-link type.keyword "bold #780050,#f0f0f0"
color-link type.extended "#000000,#f0f0f0"
color-link underlined "#3f7f5f,#f0f0f0"
color-link match-brace "#f0f0f0,#780050"
color-link tab-error "#ff8787"
color-link trailingws "#ff8787"

View File

@@ -33,3 +33,6 @@ color-link type "bold #3cc83c,#2d0023"
color-link type.keyword "bold #5aaae6,#2d0023"
color-link type.extended "#ffffff,#2d0023"
color-link underlined "#886484,#2d0023"
color-link match-brace "#2d0023,#5aaae6"
color-link tab-error "#d75f5f"
color-link trailingws "#d75f5f"

View File

@@ -24,3 +24,6 @@ color-link diff-modified "yellow"
color-link diff-deleted "red"
color-link gutter-error ",red"
color-link gutter-warning "red"
color-link match-brace "black,cyan"
color-link tab-error "brightred"
color-link trailingws "brightred"

View File

@@ -24,3 +24,6 @@ color-link gutter-warning "#EDB443,#11151C"
color-link cursor-line "#091F2E"
color-link color-column "#11151C"
color-link symbol "#99D1CE,#0C1014"
color-link match-brace "#0C1014,#D26937"
color-link tab-error "#D75F5F"
color-link trailingws "#D75F5F"

View File

@@ -24,3 +24,6 @@ color-link cursor-line "#3c3836"
color-link color-column "#79740e"
color-link statusline "#ebdbb2,#665c54"
color-link tabbar "#ebdbb2,#665c54"
color-link match-brace "#282828,#d3869b"
color-link tab-error "#d75f5f"
color-link trailingws "#d75f5f"

View File

@@ -21,3 +21,6 @@ color-link cursor-line "237"
color-link color-column "237"
color-link statusline "223,237"
color-link tabbar "223,237"
color-link match-brace "235,72"
color-link tab-error "167"
color-link trailingws "167"

View File

@@ -30,3 +30,6 @@ color-link tabbar "#80DEEA,#3b4d56"
color-link todo "bold #C792EA,#263238"
color-link type "#FFCB6B,#263238"
color-link underlined "underline #EEFFFF,#263238"
color-link match-brace "#263238,#C792EA"
color-link tab-error "#D75F5F"
color-link trailingws "#D75F5F"

View File

@@ -23,3 +23,6 @@ color-link gutter-error "#CB4B16"
color-link gutter-warning "#E6DB74"
color-link cursor-line "#323232"
color-link color-column "#323232"
color-link match-brace "#1D0000,#AE81FF"
color-link tab-error "#D75F5F"
color-link trailingws "#D75F5F"

View File

@@ -29,3 +29,6 @@ color-link color-column "#323232"
color-link type.extended "default"
#color-link symbol.brackets "default"
color-link symbol.tag "#AE81FF,#282828"
color-link match-brace "#282828,#AE81FF"
color-link tab-error "#D75F5F"
color-link trailingws "#D75F5F"

View File

@@ -34,3 +34,6 @@ color-link todo "#8B98AB"
color-link type "#66D9EF"
color-link type.keyword "#C678DD"
color-link underlined "#8996A8"
color-link match-brace "#21252C,#C678DD"
color-link tab-error "#D75F5F"
color-link trailingws "#D75F5F"

View File

@@ -28,6 +28,10 @@ color-link tabbar "bold #b1b1b1,#232323"
color-link cursor-line "#353535"
color-link color-column "#353535"
color-link space "underline #e6e1dc,#2b2b2b"
color-link tab-error "#d75f5f"
color-link trailingws "#d75f5f"
#the Python syntax definition are wrong. This is not how you should do decorators!
color-link brightgreen "#edb753,#2b2b2b"
color-link match-brace "#2b2b2b,#a5c261"

View File

@@ -10,6 +10,7 @@ color-link ignore "default"
color-link error ",brightred"
color-link todo ",brightyellow"
color-link hlsearch "black,yellow"
color-link statusline "black,white"
color-link indent-char "black"
color-link line-number "yellow"
color-link current-line-number "red"
@@ -27,3 +28,6 @@ color-link type.extended "default"
color-link symbol.brackets "default"
#Color shebangs the comment color
color-link preproc.shebang "comment"
color-link match-brace ",magenta"
color-link tab-error "brightred"
color-link trailingws "brightred"

View File

@@ -26,3 +26,6 @@ color-link cursor-line "#003541"
color-link color-column "#003541"
color-link type.extended "#839496,#002833"
color-link symbol.brackets "#839496,#002833"
color-link match-brace "#002833,#268BD2"
color-link tab-error "#D75F5F"
color-link trailingws "#D75F5F"

View File

@@ -25,3 +25,6 @@ color-link cursor-line "black"
color-link color-column "black"
color-link type.extended "default"
color-link symbol.brackets "default"
color-link match-brace ",blue"
color-link tab-error "brightred"
color-link trailingws "brightred"

View File

@@ -24,3 +24,6 @@ color-link gutter-warning "88"
color-link cursor-line "229"
#color-link color-column "196"
color-link current-line-number "246"
color-line match-brace "230,22"
color-link tab-error "210"
color-link trailingws "210"

View File

@@ -35,3 +35,6 @@ color-link todo "#8B98AB"
color-link type "#F9EE98"
color-link type.keyword "#CDA869"
color-link underlined "#8996A8"
color-link match-brace "#141414,#E0C589"
color-link tab-error "#D75F5F"
color-link trailingws "#D75F5F"

View File

@@ -25,3 +25,6 @@ color-link gutter-warning "174,237"
color-link cursor-line "238"
color-link color-column "238"
color-link current-line-number "188,237"
color-link match-brace "237,223"
color-link tab-error "167"
color-link trailingws "167"

View File

@@ -194,6 +194,7 @@ Here is a list of the colorscheme groups that you can use:
* divider (Color of the divider between vertical splits)
* message (Color of messages in the bottom line of the screen)
* error-message (Color of error messages in the bottom line of the screen)
* match-brace (Color of matching brackets when `matchbracestyle` is set to `highlight`)
Colorschemes must be placed in the `~/.config/micro/colorschemes` directory to
be used.

View File

@@ -31,9 +31,11 @@ quotes here but these are not necessary when entering the command in micro.
* `quit`: quits micro.
* `goto 'line'`: jumps to the given line number. A negative number can be
passed to jump inward from the end of the file; for example, -5 jumps
to the 5th-last line in the file.
* `goto 'line[:col]'`: Jumps to the given line (and optional column) number.
`line` can be prefixed with `+`, `-` or `~`.
+/- will perform relative jumps from the current position of the cursor
(e.g. +5 will jump 5 lines down), while ~ will perform a jump inward
from the end of the file (e.g. ~5 jumps to the 5th-last line in the file).
* `replace 'search' 'value' 'flags'?`: This will replace `search` with `value`.
The `flags` are optional. Possible flags are:

View File

@@ -409,8 +409,14 @@ mouse actions)
```
MouseLeft
MouseLeftDrag
MouseLeftRelease
MouseMiddle
MouseMiddleDrag
MouseMiddleRelease
MouseRight
MouseRightDrag
MouseRightRelease
MouseWheelUp
MouseWheelDown
MouseWheelLeft
@@ -524,11 +530,13 @@ conventions for text editing defaults.
"Esc": "Escape",
// Mouse bindings
"MouseWheelUp": "ScrollUp",
"MouseWheelDown": "ScrollDown",
"MouseLeft": "MousePress",
"MouseMiddle": "PastePrimary",
"Ctrl-MouseLeft": "MouseMultiCursor",
"MouseWheelUp": "ScrollUp",
"MouseWheelDown": "ScrollDown",
"MouseLeft": "MousePress",
"MouseLeftDrag": "MouseDrag",
"MouseLeftRelease": "MouseRelease",
"MouseMiddle": "PastePrimary",
"Ctrl-MouseLeft": "MouseMultiCursor",
// Multi-cursor bindings
"Alt-n": "SpawnMultiCursor",
@@ -634,10 +642,12 @@ are given below:
"Esc": "AbortCommand",
// Mouse bindings
"MouseWheelUp": "HistoryUp",
"MouseWheelDown": "HistoryDown",
"MouseLeft": "MousePress",
"MouseMiddle": "PastePrimary"
"MouseWheelUp": "HistoryUp",
"MouseWheelDown": "HistoryDown",
"MouseLeft": "MousePress",
"MouseLeftDrag": "MouseDrag",
"MouseLeftRelease": "MouseRelease",
"MouseMiddle": "PastePrimary"
}
}
```

View File

@@ -164,7 +164,7 @@ Here are the available options:
an effect if the file is empty/newly created, because otherwise the fileformat
will be automatically detected from the existing line endings.
default value: `unix`
default value: `unix` on Unix systems, `dos` on Windows
* `filetype`: sets the filetype for the current buffer. Set this option to
`off` to completely disable filetype detection.
@@ -181,6 +181,19 @@ Here are the available options:
default value: `false`
* `hltaberrors`: highlight tabs when spaces are expected, and spaces when tabs
are expected. More precisely: if `tabstospaces` option is on, highlight
all tab characters; if `tabstospaces` is off, highlight space characters
in the initial indent part of the line.
default value: `false`
* `hltrailingws`: highlight trailing whitespaces at ends of lines. Note that
it doesn't highlight newly added trailing whitespaces that naturally occur
while typing text. It highlights only nasty forgotten trailing whitespaces.
default value: `false`
* `incsearch`: enable incremental search in "Find" prompt (matching as you type).
default value: `true`
@@ -217,11 +230,19 @@ Here are the available options:
default value: `false`
* `matchbrace`: underline matching braces for '()', '{}', '[]' when the cursor
is on a brace character.
* `matchbrace`: show matching braces for '()', '{}', '[]' when the cursor
is on a brace character or next to it.
default value: `true`
* `matchbracestyle`: whether to underline or highlight matching braces when
`matchbrace` is enabled. The color of highlight is determined by the `match-brace`
field in the current theme. Possible values:
* `underline`: underline matching braces.
* `highlight`: use `match-brace` style from the current theme.
default value: `underline`
* `mkparents`: if a file is opened on a path that does not exist, the file
cannot be saved because the parent directories don't exist. This option lets
micro automatically create the parent directories in such a situation.
@@ -502,6 +523,7 @@ so that you can see what the formatting should look like.
"linter": true,
"literate": true,
"matchbrace": true,
"matchbracestyle": "underline",
"mkparents": false,
"mouse": true,
"parsecursor": false,

View File

@@ -67,9 +67,9 @@ which micro defines:
by the user. Returns a boolean which defines whether the action should
be canceled.
* `onRune(rune)`: runs when the composed rune has been inserted
* `onRune(bufpane, rune)`: runs when the composed rune has been inserted
* `preRune(rune)`: runs before the composed rune will be inserted
* `preRune(bufpane, rune)`: runs before the composed rune will be inserted
For example a function which is run every time the user saves the buffer
would be:
@@ -367,6 +367,7 @@ strings
regexp
errors
time
unicode/utf8
archive/zip
net/http
```

View File

@@ -50,11 +50,11 @@ function preInsertNewline(bp)
for i = 1, #autoNewlinePairs do
if curRune == charAt(autoNewlinePairs[i], 1) then
if nextRune == charAt(autoNewlinePairs[i], 2) then
bp:InsertNewline()
bp:InsertTab()
bp.Buf:Insert(-bp.Cursor.Loc, "\n" .. ws)
bp:StartOfLine()
bp:CursorLeft()
bp:InsertNewline()
bp:InsertTab()
return false
end
end

View File

@@ -5,18 +5,22 @@ detect:
rules:
- identifier: "\\b[A-Z_][0-9A-Z_]+\\b"
- type: "\\b(float|double|bool|char|int|short|long|enum|void|struct|union|typedef|(un)?signed|inline)\\b"
- type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\\b"
- type: "\\b(_Atomic|_BitInt|float|double|_Decimal32|_Decimal64|_Decimal128|_Complex|complex|_Imaginary|imaginary|_Bool|bool|char|int|short|long|enum|void|struct|union|typedef|typeof|typeof_unqual|(un)?signed|inline|_Noreturn)\\b"
- type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr))|char(8|16|32)|wchar)_t\\b"
# GCC float/decimal/fixed types
- type: "\\b(_Float16|__fp16|_Float32|_Float32x|_Float64|_Float64x|__float80|_Float128|_Float128x|__float128|__ibm128|__int128|_Fract|_Sat|_Accum)\\b"
- type: "\\b[a-z_][0-9a-z_]+(_t|_T)\\b"
- statement: "\\b(auto|volatile|register|restrict|static|const|extern)\\b"
- statement: "\\b(for|if|while|do|else|case|default|switch)\\b"
- statement: "\\b(auto|volatile|register|restrict|_Alignas|alignas|_Alignof|alignof|static|const|constexpr|extern|_Thread_local|thread_local)\\b"
- statement: "\\b(for|if|while|do|else|case|default|switch|_Generic|_Static_assert|static_assert)\\b"
- statement: "\\b(goto|continue|break|return)\\b"
- preproc: "^[[:space:]]*#[[:space:]]*(define|pragma|include|(un|ifn?)def|endif|el(if|se)|if|warning|error)"
- statement: "\\b(asm|fortran)\\b"
- preproc: "^[[:space:]]*#[[:space:]]*(define|embed|pragma|include|(un|ifn?)def|endif|el(if|ifdef|ifndef|se)|if|line|warning|error|__has_include|__has_embed|__has_c_attribute)"
- preproc: "^[[:space:]]*_Pragma\\b"
# GCC builtins
- statement: "__attribute__[[:space:]]*\\(\\([^)]*\\)\\)"
- statement: "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
- statement: "__(aligned|asm|builtin|extension|hidden|inline|packed|restrict|section|typeof|weak)__"
# Operator Color
- symbol.operator: "[-+*/%=<>.:;,~&|^!?]|\\b(sizeof)\\b"
- symbol.operator: "[-+*/%=<>.:;,~&|^!?]|\\b(offsetof|sizeof)\\b"
- symbol.brackets: "[(){}]|\\[|\\]"
# Integer Constants
- constant.number: "(\\b([1-9][0-9]*|0[0-7]*|0[Xx][0-9A-Fa-f]+|0[Bb][01]+)([Uu][Ll]?[Ll]?|[Ll][Ll]?[Uu]?)?\\b)"

7
runtime/syntax/cake.yaml Normal file
View File

@@ -0,0 +1,7 @@
filetype: cake
detect:
filename: "\\.cake$"
rules:
- include: "csharp"
- preproc: "^[[:space:]]*#(addin|break|l|load|module|r|reference|tool)"

View File

@@ -10,10 +10,11 @@ rules:
# Annotation
- identifier.var: "@[A-Za-z]+"
- preproc: "^[[:space:]]*#[[:space:]]*(define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)"
- identifier: "([A-Za-z0-9_]*[[:space:]]*[()])"
- type: "\\b(bool|byte|sbyte|char|decimal|double|float|IntPtr|int|uint|long|ulong|object|short|ushort|string|base|this|var|void)\\b"
- statement: "\\b(alias|as|case|catch|checked|default|do|dynamic|else|finally|fixed|for|foreach|goto|if|is|lock|new|null|return|switch|throw|try|unchecked|while)\\b"
- statement: "\\b(abstract|async|class|const|delegate|enum|event|explicit|extern|get|implicit|in|internal|interface|namespace|operator|out|override|params|partial|private|protected|public|readonly|ref|sealed|set|sizeof|stackalloc|static|struct|typeof|unsafe|using|value|virtual|volatile|yield)\\b"
- type: "\\b(bool|byte|sbyte|char|decimal|double|float|IntPtr|int|uint|long|ulong|managed|unmanaged|nint|nuint|object|short|ushort|string|base|this|var|void)\\b"
- statement: "\\b(alias|as|case|catch|checked|default|do|dynamic|else|finally|fixed|for|foreach|goto|if|is|lock|new|null|return|switch|throw|try|unchecked|when|while|with)\\b"
- statement: "\\b(abstract|add|and|args|async|await|class|const|delegate|enum|event|explicit|extern|file|get|global|implicit|in|init|internal|interface|nameof|namespace|not|notnull|operator|or|out|override|params|partial|private|protected|public|readonly|record|ref|remove|required|scoped|sealed|set|sizeof|stackalloc|static|struct|typeof|unsafe|using|value|virtual|volatile|yield)\\b"
# LINQ-only keywords (ones that cannot be used outside of a LINQ query - lots others can)
- statement: "\\b(from|where|select|group|info|orderby|join|let|in|on|equals|by|ascending|descending)\\b"
- special: "\\b(break|continue)\\b"

31
runtime/syntax/gomod.yaml Normal file
View File

@@ -0,0 +1,31 @@
filetype: gomod
detect:
filename: "go.mod"
rules:
# URL
- type: "(^|[ \\t])+\\b([a-zA-Z0-9-]+\\.?)+(/[a-zA-Z0-9-_\\.]+)*\\b"
# Keywords
- special: "(^|[ \\t])+\\b(module|go)\\b"
- preproc: "(^|[ \\t])+\\b(toolchain|require|exclude|replace|retract)\\b"
- symbol.operator: "=>"
# Brackets
- type: "(\\(|\\))"
# Go version
- type: "(^|[ \\t])+([0-9]+\\.?)+"
# Version
- constant.string: "(^|[ \\t])+v([0-9]+\\.?){3}.*"
- constant.number: "(^|[ \\t])+v([0-9]+\\.?){3}"
- comment:
start: "//"
end: "$"
rules:
- todo: "(indirect):?"
# (^|[ \\t])+ means after start of string or space or tab character

View File

@@ -8,7 +8,7 @@ rules:
- preproc: "<!(?i)(DOCTYPE html.*)>"
# Opening tag
- symbol.tag:
start: "<(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|bdi|bdo|big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h[1-6]|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|section|select|small|source|span|strike|strong|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr)\\b"
start: "<(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|bdi|bdo|big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h[1-6]|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|main|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|section|select|small|source|span|strike|strong|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr)\\b"
end: ">"
rules:
- identifier: "\\b(placeholder|style|alt|bgcolor|height|href|id|(aria|data)\\-.+|label|longdesc|name|on(click|focus|load|mouseover)|size|span|src|target|type|value|width|class|charset|content|rel|integrity|crossorigin|for|onsubmit|lang|role)\\b"
@@ -34,7 +34,7 @@ rules:
# Closing tag
- symbol.tag:
start: "</(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|bdi|bdo|big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h[1-6]|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|section|select|small|source|span|strike|strong|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr)\\b"
start: "</(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|bdi|bdo|big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h[1-6]|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|main|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|section|select|small|source|span|strike|strong|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr)\\b"
end: ">"
rules:
# Anything in the closing tag is an error

View File

@@ -0,0 +1,67 @@
filetype: "kvlang"
detect:
filename: "\\.kv$"
rules:
# layouts
- special: "\\b[a-z].+"
- identifier: "\\b(self|app|root)\\b"
- type: "\\b[A-Z].+"
- type: "\\b(AnchorLayout|BoxLayout|FloatLayout|RelativeLayout|GridLayout|PageLayout|StackLayout)\\b"
- type: "\\b(canvas)\\b"
# functions
- identifier.function: "[a-zA-Z_0-9]+\\("
# built-in functions
- type: "\\b(abs|all|any|ascii|bin|bool|breakpoint|bytearray|bytes)\\b"
- type: "\\b(callable|chr|classmethod|compile|copyright|credits|oct)\\b"
- type: "\\b(delattr|dict|dir|display|divmod|enumerate|eval|filter)\\b"
- type: "\\b(float|format|frozenset|get_ipython|getattr|globals|type)\\b"
- type: "\\b(hash|help|hex|id|input|int|isinstance|issubclass|iter|len)\\b"
- type: "\\b(license|list|locals|map|max|memoryview|min|next|object)\\b"
- type: "\\b(open|ord|pow|print|property|range|repr|reversed|round|set)\\b"
- type: "\\b(setattr|slice|sorted|staticmethod|hasattr|super|tuple|str)\\b"
- type: "\\b(vars|zip|exec|sum|complex)\\b"
# keywords
- statement.built_in: "\\b(and|as|assert|async|await|break|class|continue|def)\\b"
- statement.built_in: "\\b(del|elif|else|except|finally|for|from|global|if)\\b"
- statement.built_in: "\\b(import|in|is|lambda|nonlocal|not|or|pass|raise)\\b"
- statement.built_in: "\\b(return|try|while|with|yield|match|case)\\b"
# operators
- symbol.operator: "([~^.:;,+*|=!\\%]|<|>|/|-|&)"
# parentheses
- symbol.brackets: "([(){}]|\\[|\\])"
# numbers
- constant.number: "\\b[0-9](_?[0-9])*(\\.([0-9](_?[0-9])*)?)?(e[0-9](_?[0-9])*)?\\b" # decimal
- constant.number: "\\b0b(_?[01])+\\b" # bin
- constant.number: "\\b0o(_?[0-7])+\\b" # oct
- constant.number: "\\b0x(_?[0-9a-f])+\\b" # hex
- constant.bool.none: "\\b(None)\\b"
- constant.bool.true: "\\b(True)\\b"
- constant.bool.false: "\\b(False)\\b"
# strings
- constant.string:
start: "\""
end: "(\"|$)"
skip: "\\\\."
rules: []
- constant.string:
start: "'"
end: "('|$)"
skip: "\\\\."
rules: []
- comment:
start: "#"
end: "$"
rules: []

94
runtime/syntax/log.yaml Normal file
View File

@@ -0,0 +1,94 @@
filetype: log
detect:
filename: "(\\.log|log\\.txt)$"
rules:
- diff-modified: "\\b(WARN(ING)?|[Ww]arn(ing)?|w(r)?n|w|W/)\\b"
- diff-modified: "\\b(CRITICAL|[Cc]ritical)\\b"
- constant: "\\b(INFO(RMATION)?|[Ii]nfo(rmation)?|[Ii]n(f)?|i|I/)\\b"
- constant: "\\b(DEBUG|[Dd]ebug|dbug|dbg|de|d|D/)\\b"
- constant: "\\b(VERBOSE|[Vv]erbose|V/)\\b"
- constant: "\\b(ALERT|[Aa]lert)\\b"
- preproc: "\\b(TRACE|Trace|NOTICE|VERBOSE|verb|vrb|vb|v)\\b"
- gutter-error: "\\b(ERROR|[Ee]rr(or)?|[Ee]r(or)?|e|E\\x2F)\\b"
- gutter-error: "\\b(FATAL|[Ff]atal)\\b"
- gutter-error: "\\b(EMERGENCY|[Ee]mergency)\\b"
- gutter-error: "\\b(FAIL(URE)?|[Ff]ail(ure)?)\\b"
# constants
- constant.bool.true: "\\b(YES|yes|Y|y|ON|on|TRUE|True|true)\\b"
- constant.bool.false: "\\b(NO|no|N|n|OFF|off|FALSE|False|false)\\b"
- constant.bool.false: "\\b(None|null|nil)\\b"
# numbers
- constant.number: "\\b[0-9](_?[0-9])*(\\.([0-9](_?[0-9])*)?)?(e[0-9](_?[0-9])*)?\\b" # decimal
- constant.number: "\\b0b(_?[01])+\\b" # bin
- constant.number: "\\b0o(_?[0-7])+\\b" # oct
- constant.number: "\\b0x(_?[0-9a-f])+\\b" # hex
# operators
- symbol.operator: "([~^.:;,+*|=!\\%]|<|>|/|-|&)"
# parentheses
- symbol.brackets: "([(){}]|\\[|\\])"
# string
- constant.string:
start: "\""
end: "(\"|$)"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "('|$)"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
# file
- preproc: "\\b(FILE|File|file)\\b"
# time
- identifier: "\\b((([Mm]on|[Tt]ues|[Ww]ed(nes)?|[Tt]hur(s)?|[Ff]ri|[Ss]at(ur)?|[Ss]un)(day)?\\s)?([Jj]an(uary)?|[Ff]eb(ruary)?|[Mm]ar(ch)?|[Aa]pr(il)?|[Mm]ay|[Jj]un(e)?|[Jj]ul(y)?|[Aa]ug(ust)?|[Aa]go|[Ss]ep(tember)?|[Oo]ct(ober)?|[Nn]ov(ember)?|[Dd]ec(ember)?)\\s\\d{1,2},?(\\s\\d{4})?)\\b" # date
- identifier: "\\b(\\d{2,4}[-/\\.]?\\d{2,3}[-/\\.]?\\d{2,4})\\b" # date
- identifier: "\\b(\\d{2}:\\d{2}(:\\d{2})?([\\.,]?\\d{1,8}[\\.\\+,]?\\d{1,8}?)?([\\.\\+,]?\\d{1,8}[\\.\\+,]?\\d{1,8}?)?([\\.\\+,]?\\d{1,8}?)?(\\s-\\d{0,4})?)\\b" # time
- identifier: "^([0-2][0-9][0-2][0-9][-/]?[0-9][0-9][-/]?[0-9][0-9])"
# - identifier: "^([0-2][0-9][0-2][0-9][-/]?[0-9][0-9][-/]?[0-9][0-9]\\s[0-9][0-9]:[0-9][0-9](:[0-9][0-9])?(\\.?[0-9][0-9][0-9])?)"
- identifier: "^(\\d{4}[-/]?\\d{2}[-/]?\\d{2}\\s\\d{2}:\\d{2}(:\\d{2})?(\\.?\\d{2,8})?)"
- identifier: "^([0-2][0-9]|[0-2]-?[0-9][0-9]-?[0-9][0-9])\\-([0-1][0-9])\\-([0-3][0-9]) ([0-2][0-9])\\:([0-5][0-9])\\:([0-5][0-9]),([0-9][0-9][0-9])"
# ISO 8601:2004(E)
- identifier: ""
# Complete precision:
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z))"
# No milliseconds:
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))"
# No Seconds:
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))"
# Putting it all together:
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))"
# Complete precision:
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+)"
# No milliseconds
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d)"
# No Seconds
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d)"
# Putting it all together
- identifier: "^(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+)|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d)|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d)"
# link
- constant.string.url:
start: "https?://"
end: "\\s"
rules: []
# path
# - constant.string.url: "\\b(.+)/([^/]+)\\b" # linux
# - constant.string.url: "\\b(^[a-zA-Z]:)\\b" # windowns
- diff-modified: "([Cc]ommit:)\\s\\w+\\[\\w+]"

View File

@@ -0,0 +1,6 @@
filetype: msbuild
detect:
filename: "\\.(.*proj|props|targets|tasks)$"
rules:
- include: "xml"

View File

@@ -39,7 +39,7 @@ rules:
# Coreutils commands
- type: "\\b(base64|basename|cat|chcon|chgrp|chmod|chown|chroot|cksum|comm|cp|csplit|cut|date|dd|df|dir|dircolors|dirname|du|env|expand|expr|factor|false|fmt|fold|head|hostid|id|install|join|link|ln|logname|ls|md5sum|mkdir|mkfifo|mknod|mktemp|mv|nice|nl|nohup|nproc|numfmt|od|paste|pathchk|pinky|pr|printenv|printf|ptx|pwd|readlink|realpath|rm|rmdir|runcon|seq|(sha1|sha224|sha256|sha384|sha512)sum|shred|shuf|sleep|sort|split|stat|stdbuf|stty|sum|sync|tac|tail|tee|test|time|timeout|touch|tr|true|truncate|tsort|tty|uname|unexpand|uniq|unlink|users|vdir|wc|who|whoami|yes)\\b"
# Conditional flags
- statement: " (-[A-Za-z]+|--[a-z]+)"
- statement: "\\s+(-[A-Za-z]+|--[a-z]+)"
- identifier: "\\$\\{[0-9A-Za-z_:!%&=+#~@*^$?, .\\-\\/\\[\\]]+\\}"
- identifier: "\\$[0-9A-Za-z_:!%&=+#~@*^$?,\\-\\[\\]]+"