Kakoune: Adds and fixes ident highlighters, adds static_words and updates the keywords and builtins#40
Open
allenyade wants to merge 2 commits intoc3lang:mainfrom
Open
Kakoune: Adds and fixes ident highlighters, adds static_words and updates the keywords and builtins#40allenyade wants to merge 2 commits intoc3lang:mainfrom
allenyade wants to merge 2 commits intoc3lang:mainfrom
Conversation
Contributor
|
Do we have anyone who could review this one? |
Book-reader
approved these changes
Nov 7, 2025
Member
Book-reader
left a comment
There was a problem hiding this comment.
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'; } |
Member
There was a problem hiding this comment.
Suggested change
| 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)
Book-reader
reviewed
Nov 7, 2025
| 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' |
Member
There was a problem hiding this comment.
Suggested change
| 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[*]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