Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -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...
2 changes: 2 additions & 0 deletions ftdetect/maude.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
au BufNewFile,BufRead *.maude set filetype=maude
au BufNewFile,BufRead *.fm set filetype=maude
50 changes: 34 additions & 16 deletions syntax/maude.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,32 @@ endif

command! -nargs=+ MaudeHiLink hi def link <args>

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 sorts subsorts
syn keyword maudeStatements op ops var vars eq ceq
syn match maudeFlags "\[.*\]"
syn keyword maudeCommands reduce
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"
Expand All @@ -39,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
Expand Down Expand Up @@ -76,27 +87,34 @@ 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]\=\>"
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
Expand Down