aboutsummaryrefslogtreecommitdiff
path: root/editors/vim/syntax
diff options
context:
space:
mode:
Diffstat (limited to 'editors/vim/syntax')
-rw-r--r--editors/vim/syntax/bqn.vim50
1 files changed, 50 insertions, 0 deletions
diff --git a/editors/vim/syntax/bqn.vim b/editors/vim/syntax/bqn.vim
new file mode 100644
index 00000000..cbd71386
--- /dev/null
+++ b/editors/vim/syntax/bqn.vim
@@ -0,0 +1,50 @@
+if exists('b:current_syntax')
+ finish
+endif
+
+syn match bqnerr "[^ \r\n]"
+syn match bqnblk "[{}]"
+syn match bqnlst "[⟨⟩\[\]‿]"
+syn match bqnpar "[()]"
+syn match bqnhed "[:;]"
+syn match bqnsep "[⋄,]"
+syn match bqnarw "[←↩→]"
+syn match bqnchr "'.'"
+syn match bqn1md "[˜˘¨⌜⁼´˝`]"
+syn match bqn2md "[∘○⊸⟜⌾⊘◶⎉⚇⍟⎊]"
+syn match bqnfun "[𝔽𝔾𝕎𝕏𝕊+\-×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍↑↓↕⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!⍕⍎]"
+syn match bqnsub "[𝕗𝕘𝕨𝕩𝕤]"
+syn match bqnnot "·"
+syn match bqnnum "\v\c¯?((\d+\.)?\d+(e¯?\d+)?|π|∞)(i¯?((\d+\.)?\d+(e¯?\d+)?|π|∞))?"
+syn match bqnsid "\(•\|•\?[a-z][A-Z_a-z0-9]*\|𝕣\)"
+syn match bqnfid "•\?[A-Z][A-Z_a-z0-9]*"
+syn match bqn1id "\(•\?_[A-Za-z][A-Z_a-z0-9]*\|_𝕣\)"
+syn match bqn2id "\(•\?_[A-Za-z][A-Z_a-z0-9]*_\|_𝕣_\)"
+syn match bqncom "#.*$"
+syn match bqnquo /""/ contained
+syn region bqnstr matchgroup=bqnstr start=/"/ end=/"/ contains=bqnquo
+syn sync fromstart
+
+hi link bqnerr error
+hi link bqncom comment
+hi link bqnblk special
+hi link bqnhed delimiter
+hi link bqnpar delimiter
+hi link bqnlst preproc
+hi link bqnsep preproc
+hi link bqnarw normal
+hi link bqnchr string
+hi link bqnstr string
+hi link bqnquo specialchar
+hi link bqnnum number
+hi link bqnnot constant
+hi link bqnsub normal
+hi link bqnsid normal
+hi link bqnfun type
+hi link bqnfid type
+hi link bqn1md macro
+hi link bqn1id macro
+hi link bqn2md operator
+hi link bqn2id operator
+
+let b:current_syntax='bqn'