-
Notifications
You must be signed in to change notification settings - Fork 26
Kakoune: Adds and fixes ident highlighters, adds static_words and updates the keywords and builtins #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Do we have anyone who could review this one? |
Book-reader
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than this minor thing it looks good.
I am curious though, what edge case did you find that made you split the ident regex into separate ones for consts and types? (I don't think this should block this PR being merged, I'm just curious what it was)
| comptime_keywords='alignof assert assignable case default defined echo else embed endfor endforeach endif endswitch eval evaltype error exec extnameof feature for foreach if include is_const kindof nameof offsetof qnameof sizeof stringify switch typefrom typeof vacount vatype vaconst vaarg vaexpr vasplat' | ||
| # Both joins with a separator and escapes '$' characters | ||
| join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*" | sed -e 's/\$/\\\$/g'; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*" | sed -e 's/\$/\\\$/g'; } | |
| join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; } |
the sed isn't needed anymore since it was my hack to escape all the $$ in the builtins (I'm starting to think maybe I didn't have the best ideas when I updated this highlighter a while ago lol)
| addhl shared/c3/code/types regex '(?<![@#$])\\b(?:$(join '${types}' '|'))\\b' 0:type | ||
| " | ||
| keywords='alias assert asm attrdef bitstruct break case catch const continue default defer do else enum extern false faultdef for foreach foreach_r fn tlocal if inline import lengthof macro module nextcase null interface return static struct switch true try typedef union var while' | ||
| attributes='align allow_deprecated benchmark bigendian builtin callconv compact const deprecated dynamic export extern finalizer format if inline init jump link littleendian local maydiscard naked noalias nodiscard noinit noinline nopadding norecurse noreturn nosanitize nostrip obfuscate operator operator_r operator_s optional overlap packed private public pure reflect safeinfer safemacro section structlike tag test unused used wasm weak winmain' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| attributes='align allow_deprecated benchmark bigendian builtin callconv compact const deprecated dynamic export extern finalizer format if inline init jump link littleendian local maydiscard naked noalias nodiscard noinit noinline nopadding norecurse noreturn nosanitize nostrip obfuscate operator operator_r operator_s optional overlap packed private public pure reflect safeinfer safemacro section structlike tag test unused used wasm weak winmain' | |
| attributes='align allow_deprecated benchmark bigendian builtin callconv cname compact const deprecated dynamic export finalizer format if inline init jump link littleendian local maydiscard naked noalias nodiscard noinit noinline nopadding norecurse noreturn nosanitize nostrip obfuscate operator operator_r operator_s optional overlap packed private public pure reflect safeinfer safemacro simd section structlike tag test unused used wasm weak winmain' |
oh right and these should probably be updated
[*]and[<*>]\win regex pattern (it includes UTF-8 charactersc3cwill not accept as valid idents, therefore they should not be highlighted)%shsection variables and adds them in the highlighters declarations directly%shsection and adds builtins fromstd::core::envso they get properly highlighted