From 0f6c682da1c3d15edae87170c6c19f089134ac25 Mon Sep 17 00:00:00 2001 From: Matthew Rocklin Date: Wed, 2 May 2012 13:40:33 -0400 Subject: [PATCH 1/7] Added ftdetect/maude.vim file Connects .maude and .fm files to the syntax file --- ftdetect/maude.vim | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 ftdetect/maude.vim diff --git a/ftdetect/maude.vim b/ftdetect/maude.vim new file mode 100644 index 0000000..cea0a3b --- /dev/null +++ b/ftdetect/maude.vim @@ -0,0 +1,2 @@ +au BufNewFile,BufRead *.maude set filetype=maude +au BufNewFile,BufRead *.fm set filetype=maude From 9e28f9af801938fd205667069e31ddd90e89ac26 Mon Sep 17 00:00:00 2001 From: Matthew Rocklin Date: Thu, 10 May 2012 10:28:52 -0500 Subject: [PATCH 2/7] added sort, subsort, and if to maude syntax file --- syntax/maude.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntax/maude.vim b/syntax/maude.vim index c794631..6d5eea7 100644 --- a/syntax/maude.vim +++ b/syntax/maude.vim @@ -15,7 +15,7 @@ command! -nargs=+ MaudeHiLink hi def link syn keyword maudeModule mod fmod omod endm endfm endm is syn keyword maudeImports protecting including extending -syn keyword maudeSorts sorts subsorts +syn keyword maudeSorts sort sorts subsort subsorts syn keyword maudeStatements op ops var vars eq ceq syn match maudeFlags "\[.*\]" syn keyword maudeCommands reduce @@ -76,7 +76,7 @@ syn match maudeSorts "MatchPair\?" syn match maudeSorts "Substitution\?" " From the BOOL module -syn keyword maudeStatements and or xor not implies +syn keyword maudeStatements if and or xor not implies syn keyword maudeLiteral true false syn match maudeLiteral "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" From 3c7785aec5a7ccc2811118b06bfb69e4b0cb71a7 Mon Sep 17 00:00:00 2001 From: Matthew Rocklin Date: Thu, 10 May 2012 10:28:52 -0500 Subject: [PATCH 3/7] added sort, subsort, and if to maude syntax file --- syntax/maude.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntax/maude.vim b/syntax/maude.vim index c794631..6d5eea7 100644 --- a/syntax/maude.vim +++ b/syntax/maude.vim @@ -15,7 +15,7 @@ command! -nargs=+ MaudeHiLink hi def link syn keyword maudeModule mod fmod omod endm endfm endm is syn keyword maudeImports protecting including extending -syn keyword maudeSorts sorts subsorts +syn keyword maudeSorts sort sorts subsort subsorts syn keyword maudeStatements op ops var vars eq ceq syn match maudeFlags "\[.*\]" syn keyword maudeCommands reduce @@ -76,7 +76,7 @@ syn match maudeSorts "MatchPair\?" syn match maudeSorts "Substitution\?" " From the BOOL module -syn keyword maudeStatements and or xor not implies +syn keyword maudeStatements if and or xor not implies syn keyword maudeLiteral true false syn match maudeLiteral "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" From 60b3389b1adf25578098c43e27266ce2f0265ac4 Mon Sep 17 00:00:00 2001 From: Laurent Georget Date: Fri, 27 Feb 2015 13:56:23 +0100 Subject: [PATCH 4/7] Add several Maude keywords and operators - rewrite and frewrite commands - '=>' operator for rewrite - rl and crl statements --- syntax/maude.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/syntax/maude.vim b/syntax/maude.vim index c794631..be49931 100644 --- a/syntax/maude.vim +++ b/syntax/maude.vim @@ -16,9 +16,9 @@ command! -nargs=+ MaudeHiLink hi def link syn keyword maudeModule mod fmod omod endm endfm endm is syn keyword maudeImports protecting including extending syn keyword maudeSorts sorts subsorts -syn keyword maudeStatements op ops var vars eq ceq +syn keyword maudeStatements op ops var vars eq ceq rl crl syn match maudeFlags "\[.*\]" -syn keyword maudeCommands reduce +syn keyword maudeCommands reduce rewrite frewrite syn match maudeComment "\*\*\*.*" syn match maudeComment "---.*" syn match maudeOps "->" @@ -26,6 +26,7 @@ syn match maudeOps ":" "syn match maudeOps "^\s*subsorts[^<]*<"hs=e-1 "syn match maudeOps "^\s*ceq[^=]*=" syn match maudeOps "=" +syn match maudeOps "=>" syn match maudeOps "\.\s*$" syn keyword maudeModules INT FLOAT NAT RAT BOOL QID TRUTH IDENTICAL STRING From 7a6b2dcf1cf46b7c9471ec183b6c82539e5b736b Mon Sep 17 00:00:00 2001 From: Laurent Georget Date: Fri, 27 Feb 2015 14:01:54 +0100 Subject: [PATCH 5/7] Add 'sort' and 'subsort' --- syntax/maude.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/maude.vim b/syntax/maude.vim index be49931..912c9b4 100644 --- a/syntax/maude.vim +++ b/syntax/maude.vim @@ -15,7 +15,7 @@ command! -nargs=+ MaudeHiLink hi def link syn keyword maudeModule mod fmod omod endm endfm endm is syn keyword maudeImports protecting including extending -syn keyword maudeSorts sorts subsorts +syn keyword maudeSorts sorts subsorts sort subsort syn keyword maudeStatements op ops var vars eq ceq rl crl syn match maudeFlags "\[.*\]" syn keyword maudeCommands reduce rewrite frewrite From a87d36fa2d90d3dbd047316847bbbd9d3a380261 Mon Sep 17 00:00:00 2001 From: Laurent Georget Date: Thu, 12 Mar 2015 11:28:01 +0100 Subject: [PATCH 6/7] Region-differenciated highlighting --- syntax/maude.vim | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/syntax/maude.vim b/syntax/maude.vim index 8304305..41a3463 100644 --- a/syntax/maude.vim +++ b/syntax/maude.vim @@ -13,24 +13,32 @@ endif command! -nargs=+ MaudeHiLink hi def link -syn keyword maudeModule mod fmod omod endm endfm endm is +syn match maudeIdentifier "\<[a-z][a-zA-Z_]\+\>" +syn match maudeType contained "\<[A-Z][a-zA-Z_]\+\>" + +syn region maudeModule start="\(mod\|fmod\|omod\)" end="is" contains=maudeModules +syn keyword maudeModule endm endfm endom syn keyword maudeImports protecting including extending -syn keyword maudeSorts sort sorts subsort subsorts -syn keyword maudeStatements op ops var vars eq ceq rl crl -syn match maudeFlags "\[.*\]" -syn keyword maudeCommands reduce rewrite frewrite +syn region maudeSorts start="\(sort\|sorts\|subsort\|subsorts\)" matchgroup=maudeOps end="\." contains=maudeType,maudeSubsortOp +syn match maudeSubsortOp contained "<" +syn keyword maudeStatements op ops var vars +syn match maudeFlags "\[" +syn match maudeFlags "\]" +syn region maudeRewrite start="\(rl\|crl\)" matchgroup=maudeOps end=":" contains=maudeLabel +syn match maudeLabel contained "\[.*\]" +syn keyword maudeCommands reduce rewrite frewrite red rew frew eq ceq syn match maudeComment "\*\*\*.*" syn match maudeComment "---.*" syn match maudeOps "->" syn match maudeOps ":" -"syn match maudeOps "^\s*subsorts[^<]*<"hs=e-1 -"syn match maudeOps "^\s*ceq[^=]*=" syn match maudeOps "=" syn match maudeOps "=>" syn match maudeOps "\.\s*$" +syn match maudeQuoted "'\([a-zA-Z0-9_]\|`.\)\+" syn keyword maudeModules INT FLOAT NAT RAT BOOL QID TRUTH IDENTICAL STRING syn keyword maudeModules CONVERSION +syn match maudeModules contained "[A-Z-_]\+" syn match maudeModules "TRUTH-VALUE" syn match maudeModules "EXT-BOOL" syn match maudeModules "QID-LIST" @@ -40,13 +48,15 @@ syn match maudeModules "META-LEVEL" syn match maudeModules "LOOP-MODE" syn match maudeModules "CONFIGURATION" -syn keyword maudeSorts Bool Int Float Nat Qid -syn keyword maudeSorts Zero NzNat NzInt NzRat Rat FiniteFloat -syn keyword maudeSorts String Char FindResult DecFloat +syn keyword maudeType Bool Int Float Nat Qid +syn keyword maudeType Zero NzNat NzInt NzRat Rat FiniteFloat +syn keyword maudeType String Char FindResult DecFloat -syn keyword maudeAttrs assoc comm idem iter id left-id right-id strat memo +syn keyword maudeAttrs assoc comm idem iter id strat memo syn keyword maudeAttrs prec gather format ctor config object msg frozen syn keyword maudeAttrs poly special label metadata owise nonexec +syn match maudeAttrs "left\s\+id:" +syn match maudeAttrs "right\s\+id:" " Meta stuff; this may not actually be useful syn keyword maudeSorts Sort Kind Type @@ -83,21 +93,28 @@ syn keyword maudeLiteral true false syn match maudeLiteral "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" syn match maudeLiteral "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" +MaudeHiLink maudeIdentifier Identifier +MaudeHiLink maudeType Type MaudeHiLink maudeModule PreProc MaudeHiLink maudeImports PreProc -MaudeHiLink maudeSorts Type -MaudeHiLink maudeStatements Keyword +MaudeHiLink maudeSorts Underlined +MaudeHiLink maudeSubsortOp Special +MaudeHiLink maudeStatements Special +MaudeHiLink maudeRewrite Keyword +MaudeHiLink maudeLabel Label +MaudeHiLink maudeQuoted String MaudeHiLink maudeModules String MaudeHiLink maudeComment Comment MaudeHiLink maudeOps Special -MaudeHiLink maudeCommands Special +MaudeHiLink maudeCommands Keyword MaudeHiLink maudeFlags PreProc +MaudeHiLink maudeAttrs PreProc MaudeHiLink maudeSorts Type MaudeHiLink maudeLiteral String "hi def maudeMisc term=bold cterm=bold gui=bold delcommand MaudeHiLink - + let b:current_syntax = "maude" "EOF vim: tw=78:ft=vim:ts=8 From db53b39f70e94a88abb9eef8c7f5086ed7027106 Mon Sep 17 00:00:00 2001 From: Laurent Georget Date: Thu, 12 Mar 2015 15:18:03 +0100 Subject: [PATCH 7/7] README update from fork --- README | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README b/README index ed10ce8..e6e1cee 100644 --- a/README +++ b/README @@ -1,3 +1,5 @@ -This is a mirror of http://www.vim.org/scripts/script.php?script_id=1475 +This is a fork from https://github.com/vim-scripts/maude.vim, a small but yet +pretty functional syntax plugin for the Maude language +(http://maude.cs.uiuc.edu/). -This is a very rudimentary but functional and hopefully useful syntax file for the Maude language (http://maude.cs.uiuc.edu/). A screenshot with the "koehler" colorscheme is available here: http://severinghaus.org/projects/mandelbrot/maudelbrot_vim.png +Unfortunately, the code in upstream in unlicensed so mine too, for now...