Vim Tips Wiki

EP3 Syntax File

Revision as of 08:21, September 20, 2010 by JohnBot (Talk | contribs)

1,619pages on
this wiki

Proposed tip Please edit this page to improve it, or add your comments below (do not use the discussion page).

Please use new tips to discuss whether this page should be a permanent tip, or whether it should be merged to an existing tip.
created July 19, 2010 · complexity basic · author Maxslug · version 7.0

This is a syntax file for the Perl EP3 pre-processor.

This will render the Perl parts as Perl and the rest as Verilog.


" 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")

" 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"



  • Tell people how to use it.

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

Around Wikia's network

Random Wiki