From f3c4f932662d105b3a92bda646e7738d35503b39 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Sat, 19 Sep 2020 21:08:36 -0500 Subject: [PATCH] update editor syntax definitions --- misc/onyx.sublime-syntax | 6 +++--- misc/onyx.vim | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/misc/onyx.sublime-syntax b/misc/onyx.sublime-syntax index c9b92b1b..e399078c 100644 --- a/misc/onyx.sublime-syntax +++ b/misc/onyx.sublime-syntax @@ -29,11 +29,11 @@ contexts: - match: '\b(package|struct|proc|use|global|enum|if|elseif|else|for|while|do|break|continue|fallthrough|return|as|cast|sizeof|alignof|defer|switch|case)\b' scope: keyword.control.onyx - - match: '\b(bool|void|i8|u8|i16|u16|i32|u32|i64|u64|f32|f64|rawptr)\b' - scope: keyword.control.onyx + - match: '\b(bool|void|i8|u8|i16|u16|i32|u32|i64|u64|f32|f64|rawptr|string|cstring|range)\b' + scope: storage.type - match: '\b(i8x16|i16x8|i32x4|i64x2|f32x4|f64x2|v128)\b' - scope: keyword.control.onyx + scope: storage.type - match: '\b(true|false|null|context)\b' scope: constant.numeric.onyx diff --git a/misc/onyx.vim b/misc/onyx.vim index 1b707670..c0243d55 100644 --- a/misc/onyx.vim +++ b/misc/onyx.vim @@ -14,9 +14,7 @@ syn keyword onyxKeyword package struct enum proc use global syn keyword onyxKeyword if elseif else syn keyword onyxKeyword for while do syn keyword onyxKeyword switch case -syn keyword onyxKeyword break continue return defer fallthrough -syn keyword onyxKeyword as cast sizeof alignof - +syn keyword onyxKeyword break continue return defer fallthrough syn keyword onyxKeyword as cast sizeof alignof syn keyword onyxType bool void syn keyword onyxType i8 u8 syn keyword onyxType i16 u16 @@ -29,6 +27,11 @@ syn keyword onyxType i8x16 i16x8 i32x4 i64x2 f32x4 f64x2 v128 syn keyword onyxConstant true false null +syn match onyxNumber "\<0x[a-fA-F0-9]\+\>" +syn match onyxNumber "\<\d\+[lf]\=\>" +syn match onyxNumber "\<\d\+\.\d*f\=\>" +syn match onyxNumber "\.\d\+f\=\>" + syn keyword onyxCommentStart contained TODO NOTE BUG HACK syn region onyxComment start="//" end="$" keepend contains=onyxCommentStart @@ -45,6 +48,7 @@ hi def link onyxCommentStart Todo hi def link onyxConstant Constant hi def link onyxDirective Constant hi def link onyxString String +hi def link onyxNumber Number let b:current_syntax = "onyx" let &cpo = s:cpo_save -- 2.25.1