Skip to content

Instantly share code, notes, and snippets.

@pstuifzand
Created April 8, 2012 11:02
Show Gist options
  • Save pstuifzand/2336634 to your computer and use it in GitHub Desktop.
Save pstuifzand/2336634 to your computer and use it in GitHub Desktop.
Vim syntax highlighting for Marpa
" Vim syntax file
" Language: Marpa grammar
" Maintainer: Peter Stuifzand <peter@tweevijftig.nl>
" URL: http://peterstuifzand.nl
" Version: 1
" Last Change: 2012 Apr 1
"
" Read the HTML syntax to start with
if version < 600
so <sfile>:p:h/perl.vim
else
runtime! syntax/perl.vim
unlet b:current_syntax
endif
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
syn match name /[A-Za-z]\+/
syn match char /$./
syn match operator /::=/
syn region marpaCode start="{{" end="}}" contains=perlExpr
syn region marpaRegex start="=\s\*/" end="/\s\*\$" contains=perlInterpMatch
hi def link name Identifier
hi def link char String
hi def link operator Operator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment