mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-09 16:40:22 +09:00
* highlighter: Fix regions and patterns inside regions * highlighting: Remove 2nd recursive highlightRegion() call ...and add limitGroup checks to pattern search. * yaml: Add TODO type highlighting * highlighting: Don't stop in highlightRegion() at empty lines ...because possible region line end pattern must be detected. * syntax/sh: Correct string handling due to additional pattern handling * syntax/sh: Remove slash in variables * highlighter: Accept nested region only in case it's within the current reagion * highlighter: Accept nested patterns only in case it's within the current reagion * highlighter: Don't search for nesting in case the region end was found at start
35 lines
875 B
YAML
35 lines
875 B
YAML
filetype: yaml
|
|
|
|
detect:
|
|
filename: "\\.ya?ml$"
|
|
header: "%YAML"
|
|
|
|
rules:
|
|
- type: "(^| )!!(binary|bool|float|int|map|null|omap|seq|set|str) "
|
|
- constant: "\\b(YES|yes|Y|y|ON|on|TRUE|True|true|NO|no|N|n|OFF|off|FALSE|False|false)\\b"
|
|
- statement: "(:[[:space:]]|\\[|\\]|:[[:space:]]+[|>]|^[[:space:]]*- )"
|
|
- identifier: "[[:space:]][\\*&][A-Za-z0-9]+"
|
|
- type: "[-.\\w]+:"
|
|
- statement: ":"
|
|
- special: "(^---|^\\.\\.\\.|^%YAML|^%TAG)"
|
|
|
|
- constant.string:
|
|
start: "(^| )\""
|
|
end: "\""
|
|
skip: "\\\\."
|
|
rules:
|
|
- constant.specialChar: "\\\\."
|
|
|
|
- constant.string:
|
|
start: "(^| )'"
|
|
end: "'"
|
|
skip: "(\\\\.)|('')"
|
|
rules:
|
|
- constant.specialChar: "\\\\."
|
|
|
|
- comment:
|
|
start: "#"
|
|
end: "$"
|
|
rules:
|
|
- todo: "(TODO|XXX|FIXME):?"
|