GNOME Bugzilla – Bug 312577
syntax file for the Pike language
Last modified: 2009-12-29 14:35:06 UTC
A new syntax file for the Pike language Other information:
Created attachment 50229 [details] syntax file for the Pike language
Comment on attachment 50229 [details] syntax file for the Pike language ><?xml version="1.0" encoding="UTF-8"?> ><!DOCTYPE language SYSTEM "language.dtd"> ><language _name="Pike" version="1.0" _section="Sources" mimetypes="text/x-pike;text/x-pikesrc"> > > <escape-char>\</escape-char> > > <line-comment _name = "Line Comment" style= "Comment"> > <start-regex>//</start-regex> > </line-comment> > > <block-comment _name = "Block Comment" style = "Comment"> > <start-regex>/\*</start-regex> > <end-regex>\*/</end-regex> > </block-comment> > > <block-comment _name = "'#if 0' Comment" style = "Comment"> > <start-regex>^[ \t]*#[ \t]*if[ \t]*0</start-regex> > <end-regex>[ \t]*#[ \t]*(endif|else)</end-regex> > </block-comment> > > <string _name = "String" style = "String" end-at-line-end = "TRUE"> > <start-regex>"</start-regex> > <end-regex>"</end-regex> > </string> > > <syntax-item _name = "Include/Pragma" style = "Preprocessor"> > <start-regex>^#[ \t]*(include|pragma)</start-regex> > <end-regex>\n</end-regex> > </syntax-item> > > <keyword-list _name = "Keywords" style = "Keyword" case-sensitive="TRUE"> > <keyword>break</keyword> > <keyword>case</keyword> > <keyword>catch</keyword> > <keyword>continue</keyword> > <keyword>default</keyword> > <keyword>do</keyword> > <keyword>else</keyword> > <keyword>for</keyword> > <keyword>foreach</keyword> > <keyword>gauge</keyword> > <keyword>goto</keyword> > <keyword>if</keyword> > <keyword>import</keyword> > <keyword>inherit</keyword> > <keyword>private</keyword> > <keyword>return</keyword> > <keyword>sizeof</keyword> > <keyword>switch</keyword> > <keyword>throw</keyword> > <keyword>try</keyword> > <keyword>typeof</keyword> > <keyword>while</keyword> > </keyword-list> > > <keyword-list _name = "Types" style = "Data Type" case-sensitive="TRUE"> > <keyword>array</keyword> > <keyword>constant</keyword> > <keyword>enum</keyword> > <keyword>float</keyword> > <keyword>int</keyword> > <keyword>mapping</keyword> > <keyword>mixed</keyword> > <keyword>multiset</keyword> > <keyword>object</keyword> > <keyword>optional</keyword> > <keyword>static</keyword> > <keyword>string</keyword> > <keyword>void</keyword> > </keyword-list> > > <string _name = "Array" style = "String" end-at-line-end = "FALSE"> > <start-regex>\(\{</start-regex> > <end-regex>\}\)</end-regex> > </string> > > <string _name = "Mapping" style = "String" end-at-line-end = "FALSE"> > <start-regex>\(\[</start-regex> > <end-regex>\]\)</end-regex> > </string> > > <string _name = "Multiset" style = "String" end-at-line-end = "FALSE"> > <start-regex>\(<</start-regex> > <end-regex>>\)</end-regex> > </string> > > <string _name = "Character Constant" style = "String" end-at-line-end = "TRUE"> > <start-regex>'</start-regex> > <end-regex>'</end-regex> > </string> > > <pattern-item _name = "Decimal" style = "Decimal"> > <regex>\b([1-9][0-9]*|0)([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</regex> > </pattern-item> > > <pattern-item _name = "Floating Point Number" style = "Floating Point"> > <regex>\b([0-9]+[Ee][-]?[0-9]+|([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-]?[0-9]+)?)[fFlL]?</regex> > </pattern-item> > > <pattern-item _name = "Octal Number" style = "Base-N Integer"> > <regex>\b0[0-7]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</regex> > </pattern-item> > > <pattern-item _name = "Hex Number" style = "Base-N Integer"> > <regex>\b0[xX][0-9a-fA-F]+([Uu]([Ll]|LL|ll)?|([Ll]|LL|ll)[Uu]?)?\b</regex> > </pattern-item> > > <keyword-list _name = "Preprocessor Definitions" style = "Preprocessor" case-sensitive="TRUE" > match-empty-string-at-beginning = "FALSE" > match-empty-string-at-end = "TRUE" > beginning-regex = "^[ \t]*#[ \t]*"> > <keyword>if</keyword> > <keyword>ifdef</keyword> > <keyword>ifndef</keyword> > <keyword>else</keyword> > <keyword>elif</keyword> > <keyword>define</keyword> > <keyword>endif</keyword> > <keyword>undef</keyword> > <keyword>error</keyword> > <keyword>pragma</keyword> > <keyword>line</keyword> > </keyword-list> > ></language>
forgive my ignorance, but I don't know pike :) Can you attach a couple of sample files to test the highlighting? thanks
Created attachment 50251 [details] test pike file Can you add a keyword, too? It is lambda, just under the keywords heading (like "if" and "switch") will be fine.
It seems text/x-pike and/or text/x-pikesrc are not registered mime-types in shared-mime-info. Lance: Please, file a request for the addition of the mime type to https://bugs.freedesktop.org, shared-mime-info product.
Lance: any news about the mime-type?
Now we support globs, so if you want to update the lang file to the 2.0 version would be great.
I am closing this for now, feel free to reopen if you attach a new file in the new format.