[pure-lang-svn] SF.net SVN: pure-lang:[658] pure/trunk
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-08-29 21:08:52
|
Revision: 658 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=658&view=rev Author: agraef Date: 2008-08-29 21:08:59 +0000 (Fri, 29 Aug 2008) Log Message: ----------- Added Eddie Rucker's syntax highlighting for gedit. Modified Paths: -------------- pure/trunk/ChangeLog pure/trunk/README pure/trunk/lib/prelude.pure Added Paths: ----------- pure/trunk/etc/gpure.lang Modified: pure/trunk/ChangeLog =================================================================== --- pure/trunk/ChangeLog 2008-08-29 14:55:53 UTC (rev 657) +++ pure/trunk/ChangeLog 2008-08-29 21:08:59 UTC (rev 658) @@ -1,3 +1,8 @@ +2008-08-29 Albert Graef <Dr....@t-...> + + * etc/gpure.lang: Added syntax highlighting for gedit. Contributed + by Eddie Rucker. + 2008-08-28 Albert Graef <Dr....@t-...> * lib/system.pure: New definitions of fopen/popen and Modified: pure/trunk/README =================================================================== --- pure/trunk/README 2008-08-29 14:55:53 UTC (rev 657) +++ pure/trunk/README 2008-08-29 21:08:59 UTC (rev 658) @@ -69,8 +69,8 @@ Pure scripts are just ordinary text files, which can be created with any text editor. The distribution contains some language definition files and programming modes to provide syntax highlighting in various popular text -editors, such as Emacs, Kate and Vim. The Emacs mode also lets you run the -Pure interpreter in an Emacs buffer, this is probably the most convenient +editors, such as Emacs, Gedit, Kate and Vim. The Emacs mode also lets you run +the Pure interpreter in an Emacs buffer, this is probably the most convenient interface to the interpreter if you're friends with Emacs. A syntax file for Andre Simon's highlight program is also included, this lets you pretty-print Pure source in various output formats such as HTML and LaTeX. You can find all Added: pure/trunk/etc/gpure.lang =================================================================== --- pure/trunk/etc/gpure.lang (rev 0) +++ pure/trunk/etc/gpure.lang 2008-08-29 21:08:59 UTC (rev 658) @@ -0,0 +1,181 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Pure syntax highlighting for gedit. Usage: + + - Rename this file to 'pure.lang' and copy it to the + /usr/share/gtksourceview-2.0/language-specs directory. + + - You may also want to add a text/x-pure or text/x-puresrc mime type for + *.pure files so that your file manager can recognize them. + + - Fire up gedit on your Pure script and enjoy the syntax highlighting. + + Author: Eddie Rucker (mostly pilfered from Marco Barision and + Emanuela Aina's Ada and C packages) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +--> +<language id="pure" _name="Pure" version="2.0" _section="Sources"> + <metadata> + <property name="mimetypes">text/x-pure;text/x-puresrc</property> + <property name="globs">*.pure</property> + <property name="line-comment-start">//</property> + <property name="block-comment-start">/*</property> + <property name="block-comment-end">*/</property> + </metadata> + + <styles> + <style id="comment" _name="Comment" map-to="def:comment"/> + <style id="string" _name="String" map-to="def:string"/> + <style id="keyword" _name="Keyword" map-to="def:keyword"/> + <style id="storage-class" _name="Storage Class" map-to="def:type"/> + <style id="type" _name="Data Type" map-to="def:type"/> + <style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/> + <style id="double" _name="Double" map-to="def:floating-point"/> + <style id="hexadecimal" _name="Hexadecimal number" map-to="def:base-n-integer"/> + <style id="octal" _name="Octal" map-to="def:base-n-integer"/> + <style id="int" _name="Integer" map-to="def:decimal"/> + <style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/> + </styles> + + <default-regex-options case-sensitive="true"/> + + <definitions> + + <context id="line-comment" style-ref="comment" end-at-line-end="true"> + <start>//</start> + <include> + <context ref="def:in-line-comment"/> + </include> + </context> + + <context id="comment-multiline" style-ref="comment"> + <start>/\*</start> + <end>\*/</end> + <include> + <context ref="def:in-comment"/> + </include> + </context> + + <context id="string" style-ref="string" end-at-line-end="true"> + <start>"</start> + <end>"</end> + <include> + <context id="string-esc" style-ref="escaped-character" extend-parent="true"> + <match>""</match> + </context> + </include> + </context> + + <context id="preprocessor-keyword" style-ref="preprocessor"> + <keyword>def</keyword> + </context> + + <context id="keyword" style-ref="keyword"> + <keyword>case</keyword> + <keyword>when</keyword> + <keyword>with</keyword> + <keyword>end</keyword> + <keyword>else</keyword> + <keyword>if</keyword> + <keyword>infix</keyword> + <keyword>infixl</keyword> + <keyword>infixr</keyword> + <keyword>let</keyword> + <keyword>nullary</keyword> + <keyword>of</keyword> + <keyword>otherwise</keyword> + <keyword>prefix</keyword> + <keyword>postfix</keyword> + <keyword>then</keyword> + <keyword>catch</keyword> + <keyword>throw</keyword> + </context> + + <context id="storage-class" style-ref="storage-class"> + <keyword>const</keyword> + <keyword>private</keyword> + <keyword>extern</keyword> + <keyword>using</keyword> + </context> + + <context id="type" style-ref="type"> + <keyword>char</keyword> + <keyword>bool</keyword> + <keyword>float</keyword> + <keyword>int</keyword> + <keyword>double</keyword> + <keyword>expr</keyword> + <keyword>short</keyword> + <keyword>long</keyword> + <keyword>void</keyword> + <keyword>string</keyword> + <keyword>pointer</keyword> + </context> + + <!-- http://www.lysator.liu.se/c/ANSI-C-grammar-l.html --> + <context id="double" style-ref="double"> + <match extended="true"> + (?<![\w\.]) + ((\.[0-9]+ | [0-9]+\.[0-9]*) ([Ee][+-]?[0-9]*)?) + (?![\w\.]) + </match> + </context> + + <context id="hexadecimal" style-ref="hexadecimal"> + <match extended="true"> + (?<![\w\.]) + 0[xX][a-fA-F0-9]+L? + (?![\w\.]) + </match> + </context> + + <context id="octal" style-ref="octal"> + <match extended="true"> + (?<![\w\.]) + 0[0-7]+L? + (?![\w\.]) + </match> + </context> + + <context id="int" style-ref="int"> + <match extended="true"> + (?<![\w\.]) + [0-9]+L? + (?![\w\.]) + </match> + </context> + + <context id="pure"> + <include> + <context ref="line-comment"/> + <context ref="comment-multiline"/> + <context ref="string"/> + <context ref="preprocessor-keyword"/> + <context ref="keyword"/> + <context ref="storage-class"/> + <context ref="type"/> + <context ref="double"/> + <context ref="hexadecimal"/> + <context ref="octal"/> + <context ref="int"/> + </include> + </context> + + </definitions> +</language> Modified: pure/trunk/lib/prelude.pure =================================================================== --- pure/trunk/lib/prelude.pure 2008-08-29 14:55:53 UTC (rev 657) +++ pure/trunk/lib/prelude.pure 2008-08-29 21:08:59 UTC (rev 658) @@ -97,9 +97,9 @@ def f $ x = f x; def (f . g) x = f (g x); -/* The following rule is always valid and optimizes the case of list - comprehensions with throwaway results (useful if a list comprehension is - evaluated solely for its side effects). */ +/* The following rule is always valid and optimizes the case of "throwaway" + list comprehensions (useful if a list comprehension is evaluated solely for + its side effects). */ def void (catmap f x) = do f x; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |