From 1248989279598014e8c0d4f68ff49215e7463d3c Mon Sep 17 00:00:00 2001 From: "psyc://loupsycedyglgamf.onion/~lynX" Date: Wed, 4 Apr 1984 00:44:05 +0000 Subject: [PATCH] simple vim syntax for psyc packets --- {emacs => share/emacs}/psyc.el | 0 share/vim/ftdetect/psyc.vim | 1 + share/vim/syntax/psyc.vim | 34 +++++++++++++++++++ .../{00-body-only => 00-body-only.psyc} | 0 test/packets/{00-empty => 00-empty.psyc} | 0 ...gth-body-only => 00-length-body-only.psyc} | 0 ...-length-no-data => 00-length-no-data.psyc} | 0 ...gth-no-entity => 00-length-no-entity.psyc} | 0 ...00-method-only-1 => 00-method-only-1.psyc} | 0 .../{00-method-only => 00-method-only.psyc} | 0 test/packets/{00-no-body => 00-no-body.psyc} | 0 .../{00-no-content => 00-no-content.psyc} | 0 test/packets/{00-no-data => 00-no-data.psyc} | 0 .../{00-no-entity => 00-no-entity.psyc} | 0 .../{00-no-routing => 00-no-routing.psyc} | 0 .../packets/{00-no-value => 00-no-value.psyc} | 0 .../{00-state-reset => 00-state-reset.psyc} | 0 .../{00-state-resync => 00-state-resync.psyc} | 0 test/packets/{01-length => 01-length.psyc} | 0 test/packets/{01-utf8 => 01-utf8.psyc} | 0 test/packets/{01 => 01.psyc} | 0 test/packets/{02-list => 02-list.psyc} | 0 test/packets/{02-list2 => 02-list2.psyc} | 0 test/packets/{03-dict => 03-dict.psyc} | 0 test/packets/{04-circuit => 04-circuit.psyc} | 0 ...essage-private => 05-message-private.psyc} | 0 ...-remote => 06-message-private-remote.psyc} | 0 .../packets/{07-dns-fake => 07-dns-fake.psyc} | 0 .../{07-dns-invalid => 07-dns-invalid.psyc} | 0 ...08-context-enter => 08-context-enter.psyc} | 0 ...08-context-leave => 08-context-leave.psyc} | 0 ...r-00-oper-alone => err-00-oper-alone.psyc} | 0 .../{err-01-length => err-01-length.psyc} | 0 .../packets/{err-02-list => err-02-list.psyc} | 0 34 files changed, 35 insertions(+) rename {emacs => share/emacs}/psyc.el (100%) create mode 100644 share/vim/ftdetect/psyc.vim create mode 100644 share/vim/syntax/psyc.vim rename test/packets/{00-body-only => 00-body-only.psyc} (100%) rename test/packets/{00-empty => 00-empty.psyc} (100%) rename test/packets/{00-length-body-only => 00-length-body-only.psyc} (100%) rename test/packets/{00-length-no-data => 00-length-no-data.psyc} (100%) rename test/packets/{00-length-no-entity => 00-length-no-entity.psyc} (100%) rename test/packets/{00-method-only-1 => 00-method-only-1.psyc} (100%) rename test/packets/{00-method-only => 00-method-only.psyc} (100%) rename test/packets/{00-no-body => 00-no-body.psyc} (100%) rename test/packets/{00-no-content => 00-no-content.psyc} (100%) rename test/packets/{00-no-data => 00-no-data.psyc} (100%) rename test/packets/{00-no-entity => 00-no-entity.psyc} (100%) rename test/packets/{00-no-routing => 00-no-routing.psyc} (100%) rename test/packets/{00-no-value => 00-no-value.psyc} (100%) rename test/packets/{00-state-reset => 00-state-reset.psyc} (100%) rename test/packets/{00-state-resync => 00-state-resync.psyc} (100%) rename test/packets/{01-length => 01-length.psyc} (100%) rename test/packets/{01-utf8 => 01-utf8.psyc} (100%) rename test/packets/{01 => 01.psyc} (100%) rename test/packets/{02-list => 02-list.psyc} (100%) rename test/packets/{02-list2 => 02-list2.psyc} (100%) rename test/packets/{03-dict => 03-dict.psyc} (100%) rename test/packets/{04-circuit => 04-circuit.psyc} (100%) rename test/packets/{05-message-private => 05-message-private.psyc} (100%) rename test/packets/{06-message-private-remote => 06-message-private-remote.psyc} (100%) rename test/packets/{07-dns-fake => 07-dns-fake.psyc} (100%) rename test/packets/{07-dns-invalid => 07-dns-invalid.psyc} (100%) rename test/packets/{08-context-enter => 08-context-enter.psyc} (100%) rename test/packets/{08-context-leave => 08-context-leave.psyc} (100%) rename test/packets/{err-00-oper-alone => err-00-oper-alone.psyc} (100%) rename test/packets/{err-01-length => err-01-length.psyc} (100%) rename test/packets/{err-02-list => err-02-list.psyc} (100%) diff --git a/emacs/psyc.el b/share/emacs/psyc.el similarity index 100% rename from emacs/psyc.el rename to share/emacs/psyc.el diff --git a/share/vim/ftdetect/psyc.vim b/share/vim/ftdetect/psyc.vim new file mode 100644 index 0000000..28f968a --- /dev/null +++ b/share/vim/ftdetect/psyc.vim @@ -0,0 +1 @@ +au BufRead,BufNewFile *.psyc set filetype=psyc diff --git a/share/vim/syntax/psyc.vim b/share/vim/syntax/psyc.vim new file mode 100644 index 0000000..3d7a554 --- /dev/null +++ b/share/vim/syntax/psyc.vim @@ -0,0 +1,34 @@ +" Vim syntax file +" Language: PSYC - syntax highlighting for protocol packets +" Maintainer: carlo von lynX +" Latest Revision: 2016-08-25 + +if exists("b:current_syntax") + finish +endif + +" PSYC2 syntax +syn match psycSeparator /^|$/ + +" PSYC1 syntax +syn match psycSeparator /^\.$/ + +" PSYC operators +syn match psycSet /^:[a-z_].*$/ +syn match psycAssign /^=[a-z_].*$/ +syn match psycAugment /^+[a-z_].*$/ +" why doesn't this one work? +syn match psycDiminsh /^\-[a-z_].*$/ + +" should define a region instead, so that header rules +" are not applied to body +syn match psycMethod /^[a-z_]\+$/ + +hi def link psycSeparator PreProc +hi def link psycMethod Statement +hi def link psycAssign Constant +hi def link psycSet Identifier +hi def link psycAugment Type +hi def link psycDiminish Type + +let b:current_syntax = "psyc" diff --git a/test/packets/00-body-only b/test/packets/00-body-only.psyc similarity index 100% rename from test/packets/00-body-only rename to test/packets/00-body-only.psyc diff --git a/test/packets/00-empty b/test/packets/00-empty.psyc similarity index 100% rename from test/packets/00-empty rename to test/packets/00-empty.psyc diff --git a/test/packets/00-length-body-only b/test/packets/00-length-body-only.psyc similarity index 100% rename from test/packets/00-length-body-only rename to test/packets/00-length-body-only.psyc diff --git a/test/packets/00-length-no-data b/test/packets/00-length-no-data.psyc similarity index 100% rename from test/packets/00-length-no-data rename to test/packets/00-length-no-data.psyc diff --git a/test/packets/00-length-no-entity b/test/packets/00-length-no-entity.psyc similarity index 100% rename from test/packets/00-length-no-entity rename to test/packets/00-length-no-entity.psyc diff --git a/test/packets/00-method-only-1 b/test/packets/00-method-only-1.psyc similarity index 100% rename from test/packets/00-method-only-1 rename to test/packets/00-method-only-1.psyc diff --git a/test/packets/00-method-only b/test/packets/00-method-only.psyc similarity index 100% rename from test/packets/00-method-only rename to test/packets/00-method-only.psyc diff --git a/test/packets/00-no-body b/test/packets/00-no-body.psyc similarity index 100% rename from test/packets/00-no-body rename to test/packets/00-no-body.psyc diff --git a/test/packets/00-no-content b/test/packets/00-no-content.psyc similarity index 100% rename from test/packets/00-no-content rename to test/packets/00-no-content.psyc diff --git a/test/packets/00-no-data b/test/packets/00-no-data.psyc similarity index 100% rename from test/packets/00-no-data rename to test/packets/00-no-data.psyc diff --git a/test/packets/00-no-entity b/test/packets/00-no-entity.psyc similarity index 100% rename from test/packets/00-no-entity rename to test/packets/00-no-entity.psyc diff --git a/test/packets/00-no-routing b/test/packets/00-no-routing.psyc similarity index 100% rename from test/packets/00-no-routing rename to test/packets/00-no-routing.psyc diff --git a/test/packets/00-no-value b/test/packets/00-no-value.psyc similarity index 100% rename from test/packets/00-no-value rename to test/packets/00-no-value.psyc diff --git a/test/packets/00-state-reset b/test/packets/00-state-reset.psyc similarity index 100% rename from test/packets/00-state-reset rename to test/packets/00-state-reset.psyc diff --git a/test/packets/00-state-resync b/test/packets/00-state-resync.psyc similarity index 100% rename from test/packets/00-state-resync rename to test/packets/00-state-resync.psyc diff --git a/test/packets/01-length b/test/packets/01-length.psyc similarity index 100% rename from test/packets/01-length rename to test/packets/01-length.psyc diff --git a/test/packets/01-utf8 b/test/packets/01-utf8.psyc similarity index 100% rename from test/packets/01-utf8 rename to test/packets/01-utf8.psyc diff --git a/test/packets/01 b/test/packets/01.psyc similarity index 100% rename from test/packets/01 rename to test/packets/01.psyc diff --git a/test/packets/02-list b/test/packets/02-list.psyc similarity index 100% rename from test/packets/02-list rename to test/packets/02-list.psyc diff --git a/test/packets/02-list2 b/test/packets/02-list2.psyc similarity index 100% rename from test/packets/02-list2 rename to test/packets/02-list2.psyc diff --git a/test/packets/03-dict b/test/packets/03-dict.psyc similarity index 100% rename from test/packets/03-dict rename to test/packets/03-dict.psyc diff --git a/test/packets/04-circuit b/test/packets/04-circuit.psyc similarity index 100% rename from test/packets/04-circuit rename to test/packets/04-circuit.psyc diff --git a/test/packets/05-message-private b/test/packets/05-message-private.psyc similarity index 100% rename from test/packets/05-message-private rename to test/packets/05-message-private.psyc diff --git a/test/packets/06-message-private-remote b/test/packets/06-message-private-remote.psyc similarity index 100% rename from test/packets/06-message-private-remote rename to test/packets/06-message-private-remote.psyc diff --git a/test/packets/07-dns-fake b/test/packets/07-dns-fake.psyc similarity index 100% rename from test/packets/07-dns-fake rename to test/packets/07-dns-fake.psyc diff --git a/test/packets/07-dns-invalid b/test/packets/07-dns-invalid.psyc similarity index 100% rename from test/packets/07-dns-invalid rename to test/packets/07-dns-invalid.psyc diff --git a/test/packets/08-context-enter b/test/packets/08-context-enter.psyc similarity index 100% rename from test/packets/08-context-enter rename to test/packets/08-context-enter.psyc diff --git a/test/packets/08-context-leave b/test/packets/08-context-leave.psyc similarity index 100% rename from test/packets/08-context-leave rename to test/packets/08-context-leave.psyc diff --git a/test/packets/err-00-oper-alone b/test/packets/err-00-oper-alone.psyc similarity index 100% rename from test/packets/err-00-oper-alone rename to test/packets/err-00-oper-alone.psyc diff --git a/test/packets/err-01-length b/test/packets/err-01-length.psyc similarity index 100% rename from test/packets/err-01-length rename to test/packets/err-01-length.psyc diff --git a/test/packets/err-02-list b/test/packets/err-02-list.psyc similarity index 100% rename from test/packets/err-02-list rename to test/packets/err-02-list.psyc