c-family.kak: Sort keywords, attributes, values, and decorators

This commit is contained in:
fsub 2017-11-05 10:02:17 +01:00
parent 52f4af6a83
commit 1ad83745c2

View File

@ -154,9 +154,11 @@ define-command -hidden c-family-insert-on-newline %[ evaluate-commands -draft %[
add-highlighter shared/c/code regex %{\b-?(0x[0-9a-fA-F]+|\d+)[fdiu]?|'((\\.)?|[^'\\])'} 0:value add-highlighter shared/c/code regex %{\b-?(0x[0-9a-fA-F]+|\d+)[fdiu]?|'((\\.)?|[^'\\])'} 0:value
%sh{ %sh{
# Grammar # Grammar
keywords="while|for|if|else|do|switch|case|default|goto|asm|break|continue|return|sizeof" keywords="asm|break|case|continue|default|do|else|for|goto|if|return"
attributes="const|auto|register|inline|static|volatile|struct|enum|union|typedef|extern|restrict" keywords="${keywords}|sizeof|switch|while"
types="void|char|short|int|long|signed|unsigned|float|double|size_t" attributes="auto|const|enum|extern|inline|register|restrict|static|struct"
attributes="${attributes}|typedef|union|volatile"
types="char|double|float|int|long|short|signed|size_t|unsigned|void"
values="NULL" values="NULL"
# Add the language's grammar to the static completion list # Add the language's grammar to the static completion list
@ -178,17 +180,17 @@ add-highlighter shared/cpp/code regex %{\b-?(0x[0-9a-fA-F]+|\d+)[fdiu]?|'((\\.)?
%sh{ %sh{
# Grammar # Grammar
keywords="while|for|if|else|do|switch|case|default|goto|asm|break|continue" keywords="alignas|alignof|and|and_eq|asm|break|case|catch|const_cast"
keywords="${keywords}|return|using|try|catch|throw|new|delete|and|and_eq|or" keywords="${keywords}|continue|decltype|default|delete|do|dynamic_cast"
keywords="${keywords}|or_eq|not|operator|explicit|reinterpret_cast" keywords="${keywords}|else|explicit|for|goto|if|new|not|operator|or|or_eq"
keywords="${keywords}|const_cast|static_cast|dynamic_cast|sizeof|alignof" keywords="${keywords}|reinterpret_cast|return|sizeof|static_cast|switch"
keywords="${keywords}|alignas|decltype" keywords="${keywords}|throw|try|using|while"
attributes="const|constexpr|mutable|auto|noexcept|namespace|inline|static" attributes="auto|class|const|constexpr|enum|extern|final|friend|inline"
attributes="${attributes}|volatile|class|struct|enum|union|public|protected" attributes="${attributes}|mutable|namespace|noexcept|override|private"
attributes="${attributes}|private|template|typedef|virtual|friend|extern" attributes="${attributes}|protected|public|static|struct|template|typedef"
attributes="${attributes}|typename|override|final" attributes="${attributes}|typename|union|virtual|volatile"
types="void|char|short|int|long|signed|unsigned|float|double|size_t|bool" types="bool|char|double|float|int|long|short|signed|size_t|unsigned|void"
values="this|true|false|NULL|nullptr" values="NULL|false|nullptr|this|true"
# Add the language's grammar to the static completion list # Add the language's grammar to the static completion list
printf %s\\n "hook global WinSetOption filetype=cpp %{ printf %s\\n "hook global WinSetOption filetype=cpp %{
@ -219,15 +221,17 @@ add-highlighter shared/objc/code regex %{\b-?\d+[fdiu]?|'((\\.)?|[^'\\])'} 0:val
%sh{ %sh{
# Grammar # Grammar
keywords="while|for|if|else|do|switch|case|default|goto|break|continue|return" keywords="break|case|continue|default|do|else|for|goto|if|return|switch"
attributes="const|auto|inline|static|volatile|struct|enum|union|typedef" keywords="${keywords}|while"
attributes="${attributes}|extern|__block|nonatomic|assign|copy|strong" attributes="IBAction|IBOutlet|__block|assign|auto|const|copy|enum|extern"
attributes="${attributes}|retain|weak|readonly|IBAction|IBOutlet" attributes="${attributes}|inline|nonatomic|readonly|retain|static|strong"
types="void|char|short|int|long|signed|unsigned|float|bool|size_t" attributes="${attributes}|struct|typedef|union|volatile|weak"
types="${types}|instancetype|BOOL|NSInteger|NSUInteger|CGFloat|NSString" types="BOOL|CGFloat|NSInteger|NSString|NSUInteger|bool|char|float"
values="self|nil|id|super|TRUE|FALSE|YES|NO|NULL" types="${types}|instancetype|int|long|short|signed|size_t|unsigned|void"
decorators="property|synthesize|interface|implementation|protocol|end" values="FALSE|NO|NULL|TRUE|YES|id|nil|self|super"
decorators="${decorators}|selector|autoreleasepool|try|catch|class|synchronized" decorators="autoreleasepool|catch|class|end|implementation|interface"
decorators="${decorators}|property|protocol|selector|synchronized"
decorators="${decorators}|synthesize|try"
# Add the language's grammar to the static completion list # Add the language's grammar to the static completion list
printf %s\\n "hook global WinSetOption filetype=objc %{ printf %s\\n "hook global WinSetOption filetype=objc %{