Hello,
I'm a xbase programmer. The files I edit are .PRG files. A .PRG file is a source file for any xbase compiler (xHarbour, Clipper, Xbase, Microsoft FoxPro, etc)
How can I configure TextMate so it highlights my source code correctly?
Thank you in advance! ;-)
These are the RegEx'es for my languages:
PRG Keywords: "(?i)^(IF|ELSEIF|ELSE|ENDIF|DO +WHILE|DO +CASE|DO|WHILE| LOOP|EXIT +(FUNCTION|PROCEDURE)|EXIT|ENDCASE|ENDDO|CASE|OTHERWISE| SWITCH|DEFAILT|ENDCLASS|FOR +EACH|FOR|NEXT|BEGIN +SEQUENCE|BREAK| RECOVER( +USING)?|ENDSEQUENCE|END +SEQUENCE|LOCAL|STATIC +(FUNCTION| PROCEDURE)|STATIC|METHOD|PRIVATE|PUBLIC|MEMVAR|DECALRE|FIELD|GLOBAL +EXTERNAL|GLOBAL|EXTERNAL|EXTERN|ANNOUNCE|REQUEST|PROCEDURE|FUNCTION| TRY|CATCH|INIT +(FUNCTION|PROCEDURE)|EXIT|RETURN|SAVE|RESTORE|CLASS| VAR|DATA|METHOD|ACCESS|ASSIGN|PROTECTED|READONLY|EXPORTED|PUBLISHED| HIDDEN|END|READ|WITH +OBJECT|CLEAR +SCREEN|DEFAULT)( +|$)"
PRG Reserved Words: "(?i)(IIF|WHILE|IN|STEP|TO|EXTERNAL|PROTECTED| READONLY|EXPORTED|PUBLISHED|INLINE|PRIVATE|HIDDEN|VIRTUAL|GET|SAY|GET| CLEAR) *"
PRG Literals: "(".*"|'.*'|E".*") *"
PRG Operators: "(?i)(++|--|**|:=|<>|>=|<=|==|!=|+=|-=|*=|/=|HAS| LIKE|.AND.|.OR.|.NOT.|[!@#$^&*(){}[]|/,><-=]|+) *"
PRG Functions: "(?i)^ *(INIT|EXIT|STATIC)? *(FUNCTION|PROCEDURE) + ([_a-z|0-9]+)"
PRG Methods: "(?i)^ *METHOD +([_a-z|0-9]+) *(([^)]*))? *CLASS + ([_a-z|0-9]+)" PRG Methods(2): "(?i)^ *METHOD +([_a-z|0-9]+) *: *([_a-z|0-9]+) *(([^ )]*))?"
PRG Classes: "(?i)^ *CLASS +([_a-z|0-9]+)"
PRG ClassVars: "(?i)^ *CLASS *(VAR|DATA)"
PRG InlineComment : "(^*)|//|&&"
-- Sincerely,
Patrick Mast
Patrick, On Dec 8, 2005, at 7:56 AM, Patrick Mast wrote:
Hello,
I'm a xbase programmer. The files I edit are .PRG files. A .PRG file is a source file for any xbase compiler (xHarbour, Clipper, Xbase, Microsoft FoxPro, etc)
How can I configure TextMate so it highlights my source code correctly?
1) First, you want to create a new bundle, so you open the bundle editor (ctrl-cmd-shift-b) and click on the plus on the bottom left, and choose "new bundle". This creates a new bundle. Name it appropriately. 2) In that bundle, you create a new language, named probably the same way. This already comes with some defaults. 3) Then you need to edit this to do what you want it to. You probably would want to read the "syntax highlight" part of the help, and to look at the code for some of the similar languages to xbase, for inspiration. That should get you started. Then you email the list if you get stuck. 4) I would suggest that you copy the contents of the language file onto a new textmate window, and edit it there, and then paste back. In the next version an "edit in textmate.." option thingy will make this step easier. If you set the language to "language definition" it will probably even look nice while you edit it. 5) Once done, add it to the repository for everyone's enjoyment. :-)
Good luck. Haris
Hello,
Can I set up Textmate so that the END button goes to the end of a line and the HOME button goes to the beginning of a line? -- Sincerely,
Patrick Mast, xHarbour.com Inc. http://www.xHarbour.com
Patrick Mast wrote:
Hello,
Can I set up Textmate so that the END button goes to the end of a line and the HOME button goes to the beginning of a line?
Have a look here, http://macromates.com/blog/archives/2005/07/05/key-bindings-for-switchers/
It shows you how to set it up system-wide.
Jeroen.
Hello,
I have a few Bundle questions as I'm making a new bundle for the xBase (And thus xHarbour) language.
1. How/where can I add KEYWORDS?
2. If I take the C bundle as a sample, i see that it uses "source.c". Where can I find this file?
3. See http://www.xHarbour.com/TextMate1.png -> I have set the color green for "String" Now everything after, "" stays green in color, how can I avoid that?
Thank you. -- Sincerely,
Patrick Mast, xHarbour.com Inc. http://www.xHarbour.com
Have a look at the manual, it can explain all your questions and then some: http://macromates.com/textmate/manual/language_grammars#language_grammars
Jeroen.