Kakoune: Adds and fixes ident highlighters, adds static_words and updates the keywords and builtins#40
Kakoune: Adds and fixes ident highlighters, adds static_words and updates the keywords and builtins#40allenyade wants to merge 2 commits intoc3lang:mainfrom
Conversation
|
Do we have anyone who could review this one? |
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'; } |
There was a problem hiding this comment.
| 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.
| 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
|
Does it need any further fixes? |
There are some additional updates & fixes for new keywords & new generic modules syntax that I've made, I can make a PR with those based on this one |
[*]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