Wikia

Vim Tips Wiki

EP3 Syntax File

Talk0
1,612pages on
this wiki
Revision as of 09:07, May 31, 2011 by JohnBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Tip 1659 Printable Monobook Previous Next

created July 19, 2010 · complexity basic · author Maxslug · version 7.0


This is a syntax file for the Perl EP3 pre-processor which will render the Perl parts as Perl and the rest as Verilog.

ep3.vimEdit

" Vim syntax file
" Language:    EP3 (Perl/Verilog)
"
" Based on mason.vim, html.vim
"
" Clear previous syntax settings unless this is v6 or above, in which case just
" exit without doing anything.
"
if version < 600
  syn clear
elseif exists("b:current_syntax")
  finish
endif

" Load perl and verilog into their own namespaces
syn include @ep3Perl    syntax/perl.vim
unlet b:current_syntax
syn include @ep3Verilog syntax/verilog.vim
unlet b:current_syntax

" Load verilog as the default syntax
runtime! syntax/verilog.vim
unlet b:current_syntax

" Add some EP3-specific syntax
syn match verilogGlobal "@include"

" TODO: How do I get the strings in a perl section to render as verilog?
"syn region ep3String   start=+"+ end=+"+ contained contains=@ep3Verilog
"hi def link perlString @ep3Verilog

syn region ep3Vline     matchgroup=Delimiter start="^@>"         end="$"         contains=@ep3Verilog
syn region ep3PerlChunk matchgroup=Delimiter start="@perl_begin" end="@perl_end" contains=@ep3Perl,ep3Vline

let b:current_syntax = "ep3"

CommentsEdit

 TO DO 

  • Tell people how to use it.

JohnBeckett 08:21, September 20, 2010 (UTC)

Around Wikia's network

Random Wiki