protected void generatePreamble ( IStyleAppendable it ) { clearHilights ( ) ; final String nm = getLanguageSimpleName ( ) . toLowerCase ( ) ; final String cmd = Strings . toFirstUpper ( getLanguageSimpleName ( ) . toLowerCase ( ) ) + "HiLink" ; //$NON-NLS-1$ appendComment ( it , "Quit when a syntax file was already loaded" ) ; //$NON-NLS-1$ appendCmd ( it , false , "if !exists(\"main_syntax\")" ) . increaseIndentation ( ) . newLine ( ) ; //$NON-NLS-1$ appendCmd ( it , false , "if exists(\"b:current_syntax\")" ) . increaseIndentation ( ) . newLine ( ) ; //$NON-NLS-1$ appendCmd ( it , false , "finish" ) . decreaseIndentation ( ) . newLine ( ) ; //$NON-NLS-1$ appendCmd ( it , "endif" ) ; //$NON-NLS-1$ appendComment ( it , "we define it here so that included files can test for it" ) ; //$NON-NLS-1$ appendCmd ( it , "let main_syntax='" + nm + "'" ) ; //$NON-NLS-1$ //$NON-NLS-2$ appendCmd ( it , false , "syn region " + nm + "Fold start=\"{\" end=\"}\" transparent fold" ) ; //$NON-NLS-1$ //$NON-NLS-2$ it . decreaseIndentation ( ) . newLine ( ) ; appendCmd ( it , "endif" ) ; //$NON-NLS-1$ it . newLine ( ) ; appendCmd ( it , "let s:cpo_save = &cpo" ) ; //$NON-NLS-1$ appendCmd ( it , "set cpo&vim" ) ; //$NON-NLS-1$ it . newLine ( ) ; appendComment ( it , "don't use standard HiLink, it will not work with included syntax files" ) ; //$NON-NLS-1$ appendCmd ( it , false , "if version < 508" ) . increaseIndentation ( ) . newLine ( ) ; //$NON-NLS-1$ appendCmd ( it , false , "command! -nargs=+ " + cmd + " hi link <args>" ) . decreaseIndentation ( ) . newLine ( ) ; //$NON-NLS-1$ //$NON-NLS-2$ appendCmd ( it , false , "else" ) . increaseIndentation ( ) . newLine ( ) ; //$NON-NLS-1$ appendCmd ( it , false , "command! -nargs=+ " + cmd + " hi def link <args>" ) . decreaseIndentation ( ) . newLine ( ) ; //$NON-NLS-1$ //$NON-NLS-2$ appendCmd ( it , "endif" ) ; //$NON-NLS-1$ it . newLine ( ) ; appendComment ( it , "some characters that cannot be in a SARL program (outside a string)" ) ; //$NON-NLS-1$ appendMatch ( it , nm + "Error" , "[\\\\`]" ) ; //$NON-NLS-1$ //$NON-NLS-2$ it . newLine ( ) ; }
Generate the preamble of the Vim style .