mirror of
https://github.com/sharkdp/bat.git
synced 2026-11-26 11:36:11 +00:00
Add the official CUE grammar repository cue-lang/vscode-cue as a submodule, and CUE.sublime-syntax converted from its extension/syntaxes/cue.tmLanguage.json at commit 16796709f36c: 1. Inline rules that only group other patterns, which Sublime Text's converter rejects (cue-lang/cue#3427): jq 'walk(if type == "object" and has("patterns") then .patterns |= [.[] | if type == "object" and keys == ["patterns"] then .patterns[] else . end] else . end)' \ extension/syntaxes/cue.tmLanguage.json > CUE.tmLanguage.json 2. Convert the JSON grammar to a plist: python3 -c 'import json, plistlib, sys; plistlib.dump(json.load(sys.stdin), sys.stdout.buffer)' \ < CUE.tmLanguage.json > CUE.tmLanguage 3. Convert CUE.tmLanguage with Sublime Text's converter ("Tools → Developer → New Syntax from CUE.tmLanguage…"). The result reproduces all token goldens in vscode-cue's extension/testdata/syntax with both the oniguruma and fancy-regex engines.