From 698b028f8316cde46cea92e9cd3a70a7467436b4 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Mon, 23 Nov 2020 17:51:21 +0100 Subject: [PATCH] zig: highlight escapes in strings, update to 0.7.0 --- rc/filetype/zig.kak | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/rc/filetype/zig.kak b/rc/filetype/zig.kak index c70a14c9..157083fe 100644 --- a/rc/filetype/zig.kak +++ b/rc/filetype/zig.kak @@ -36,18 +36,24 @@ provide-module zig %§ add-highlighter shared/zig regions add-highlighter shared/zig/code default-region group -add-highlighter shared/zig/doc_comment region '///[^/]' '$' fill documentation -add-highlighter shared/zig/comment region '//' '$' fill comment +add-highlighter shared/zig/doc_comment region '///[^/]' '$' fill documentation +add-highlighter shared/zig/comment region '//' '$' fill comment -# TODO: highlight escape sequences within strings -add-highlighter shared/zig/string_double region '"' (?|&|\||\^|~|\?|!)' 0:operator # builtin functions -add-highlighter shared/zig/code/ regex "@(?:addWithOverflow|ArgType|atomicLoad|atomicStore|bitCast|breakpoint)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:alignCast|alignOf|cDefine|cImport|cInclude)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:cUndef|canImplicitCast|clz|cmpxchgWeak|cmpxchgStrong|compileError)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:compileLog|ctz|popCount|divExact|divFloor|divTrunc)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:embedFile|export|tagName|TagType|errorName|call)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:errorReturnTrace|fence|fieldParentPtr|field|unionInit)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:frameAddress|import|newStackCall|asyncCall|intToPtr|IntType)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:memberCount|memberName|memberType|as)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:memcpy|memset|mod|mulWithOverflow|splat)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:bitOffsetOf|byteOffsetOf|OpaqueType|panic|ptrCast)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:ptrToInt|rem|returnAddress|setCold|Type|shuffle)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:setRuntimeSafety|setEvalBranchQuota|setFloatMode)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:setGlobalLinkage|setGlobalSection|shlExact|This|hasDecl|hasField)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:shlWithOverflow|shrExact|sizeOf|bitSizeOf|sqrt|byteSwap|subWithOverflow|intCast|floatCast|intToFloat|floatToInt|boolToInt|errSetCast)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:truncate|typeId|typeInfo|typeName|TypeOf|atomicRmw|bytesToSlice|sliceToBytes)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:intToError|errorToInt|intToEnum|enumToInt|setAlignStack|frame|Frame|frameSize|bitReverse|Vector)\b" 0:function -add-highlighter shared/zig/code/ regex "@(?:sin|cos|exp|exp2|log|log2|log10|fabs|floor|ceil|trunc|round)\b" 0:function +add-highlighter shared/zig/code/ regex "@(?:addWithOverflow|alignCast|alignOf|as|asyncCall|atomicLoad|atomicRmw|atomicStore|bitCast|bitOffsetOf|boolToInt|bitSizeOf|breakpoint|mulAdd|byteSwap|bitReverse|byteOffsetOf|call|cDefine|cImport|cInclude|clz|cmpxchgStrong|cmpxchgWeak|compileError|compileLog|ctz|cUndef|divExact|divFloor|divTrunc|embedFile|enumToInt|errorName|errorReturnTrace|errorToInt|errSetCast|export|fence|field|fieldParentPtr|floatCast|floatToInt|frame|Frame|frameAddress|frameSize|hasDecl|hasField|import|intCast|intToEnum|intToError|intToFloat|intToPtr|memcpy|memset|wasmMemorySize|wasmMemoryGrow|mod|mulWithOverflow|panic|popCount|ptrCast|ptrToInt|rem|returnAddress|setAlignStack|setCold|setEvalBranchQuota|setFloatMode|setRuntimeSafety|shlExact|shlWithOverflow|shrExact|shuffle|sizeOf|splat|reduce|src|sqrt|sin|cos|exp|exp2|log|log2|log10|fabs|floor|ceil|trunc|round|subWithOverflow|tagName|TagType|This|truncate|Type|typeInfo|typeName|TypeOf|unionInit)\b" 0:function # Commands # ‾‾‾‾‾‾‾‾