Wikia

Vim Tips Wiki

Changes: EP3 Syntax File

Edit

Back to page

(Insert TipProposed template + minor manual clean)
(Assign tip id + convert to TipNew template + minor clean)
 
Line 1: Line 1:
{{TipProposed
+
{{TipNew
|id=0
+
|id=1659
|previous=0
+
|previous=1658
|next=0
+
|next=1660
 
|created=July 19, 2010
 
|created=July 19, 2010
 
|complexity=basic
 
|complexity=basic
Line 11: Line 11:
 
|category2=
 
|category2=
 
}}
 
}}
This is a syntax file for the [http://search.cpan.org/~mykl/Text-EP3-1.10/lib/Text/EP3.pm Perl EP3 pre-processor].
+
This is a syntax file for the [http://search.cpan.org/~mykl/Text-EP3-1.10/lib/Text/EP3.pm Perl EP3 pre-processor] which will render the Perl parts as Perl and the rest as Verilog.
 
This will render the Perl parts as Perl and the rest as Verilog.
 
   
 
==ep3.vim==
 
==ep3.vim==
 
 
<pre>
 
<pre>
 
" Vim syntax file
 
" Vim syntax file
Line 56: Line 55:
 
{{todo}}
 
{{todo}}
 
*Tell people how to use it.
 
*Tell people how to use it.
JohnBeckett aka [[User:JohnBot|JohnBot]] 08:21, September 20, 2010 (UTC)
+
[[User:JohnBeckett|JohnBeckett]] 08:21, September 20, 2010 (UTC)

Latest revision as of 09:07, May 31, 2011

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