1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-04-15 07:10:43 +01:00
bat/assets/syntaxes/02_Extra/RPMSpec.sublime-syntax
2024-04-08 10:05:27 +08:00

67 lines
2.2 KiB
YAML
Vendored

%YAML 1.2
---
# http://www.sublimetext.com/docs/syntax.html
name: RPM Spec
file_extensions:
- spec
scope: source.spec
contexts:
main:
- match: '(Icon|ExclusiveOs|ExcludeOs):'
scope: keyword.spec
- match: '(BuildArch|BuildArchitectures|ExclusiveArch|ExcludeArch):'
captures:
0: keyword.spec
push:
- match: $
pop: true
- include: archs
- match: '[^\s,]+'
scope: invalid.spec
- match: '(Conflicts|Obsoletes|Provides|Requires|Requires\(.*\)|Enhances|Suggests|BuildConflicts|BuildRequires|Recommends|PreReq|Supplements):'
scope: keyword.spec
- match: '(Epoch|Serial|Nosource|Nopatch):'
scope: keyword.spec
- match: '(AutoReq|AutoProv|AutoReqProv):'
scope: keyword.spec
- match: '(Copyright|License|Summary|Summary\(.*\)|Distribution|Vendor|Packager|Group|Source\d*|Patch\d*|BuildRoot|Prefix):'
scope: keyword.spec
- match: '(Name|Version|Release|Url|URL):'
scope: keyword.spec
- match: ^(Source|Patch)
push:
- meta_scope: keyword.spec
- match: ':'
pop: true
- match: '^# norootforbuild'
scope: keyword.spec
- match: '%(ifarch|ifnarch)'
captures:
0: keyword.control.spec
push:
- match: $
pop: true
- include: archs
- match: '[^\s,]+'
scope: invalid.spec
- match: ^%(changelog|check$|description|files|package)
scope: keyword.control.spec
- match: ^(%(prep$|build$|install$|clean$|(pre|post)(un|trans)?|trigger(in|un|postun)|verifyscript))
scope: keyword.control.spec
- match: '%(if|else|endif|define|global|undefine|ifos|ifnos)'
scope: keyword.control.spec
- match: '%\{'
push:
- meta_scope: variable.other.spec
- match: '\}'
pop: true
- match: '%([A-Za-z0-9_]+)'
scope: variable.other.spec
- match: ^\s*#.*$
scope: comment.line.spec
- match: ^\* .*\)$
scope: meta.documentation.spec
archs:
- match: \b(i386|i486|i586|i686|athlon|ia64|alpha|alphaev5|alphaev56|alphapca56|alphaev6|alphaev67|sparc|sparcv9|sparc64armv3l|armv4b|armv4lm|ips|mipsel|ppc|ppc|iseries|ppcpseries|ppc64|m68k|m68kmint|Sgi|rs6000|i370|s390x|s390|noarch)\b
scope: constant.other