Discussion › Forums › discussion › Create own Tags
This topic contains 0 voices and has 5 replies.
| Author | Posts |
|---|---|
| Author | Posts |
| July 29, 2011 at 5:09 pm #5393 | |
|
Pf@nne Member
|
Hello, how can i create my own Tags for BASCOM language. Like this: http://www.pnotepad.org/wp-content/uploads/2006/12/207tags.png For C++ this function still exist. Thanks for your help Pf@nne |
| August 1, 2011 at 11:45 am #17951 | |
|
Pf@nne Member
|
Meanwhile i have found the “taggersctagsadditionalLanguages.conf” . Is there anywere a Syntax-Sample? I got *.inc files (Basic BASCOM-AVR Code) and i want to use them with the Visual Basic Scheme the Syntax-highlighting still works, but the cTAG function not. Who can Help me with my Problem… Thank for your Help Pf@nne |
| August 11, 2011 at 11:40 am #17952 | |
|
Nux Member
|
I’ve used the below syntax in previous version. Haven’t tested in current PN. In additionalLanguages.conf you have to add:
Where: * langname is your language name * ext is an extension for the language * regexp is PCRE regular expression * replacement is a replacement string in withch you will probably want to use “1″ to insert phrase you caught in regexp. * type-short, type-long are types of caught tags eg. “f” and “Function” for functions This is what I’ve used for ActionScript:
In additionalSupportedSchemes.ini I had to add:
|
| August 12, 2011 at 8:38 am #17953 | |
|
Pf@nne Member
|
Hi Nux, thanks for your hint. Meanwhile i understand the way to implement my own cTAGs in PN, but the PCRE syntax is a little bit confusing. For example: I want to tag every line with - 0 or more blanks at the beging - folowed by a regular Charakter - and ended by a “:” I want to use this to tag a label. I tryed like this: –regex-vb=/^ *[A-Za-z](.*):$/1/l,Label/ This works but the first charakter of the Tag will be truncated. In the cTAGs-tree a “abel” is added. How to solve this problem? To bypass the first problem i used the following expression: –regex-vb=/(.*):$/1/l,Label/ Now all “:” ending lines will be listed. The problem, also “case xx:” commands will be listet. How to except charakters/words. I want to except the word “case” You use 2 option what does this mean? Also t and w+ Do you have a good description for PCRE syntax. Thanks for your Help Greets from Hamburg Pf@nne |
| August 12, 2011 at 9:43 am #17954 | |
|
Nux Member
|
Have a look at: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp If you want to catch lines that only contains: “[optional whitespace][letters]:” Then the regexp would be: ^[ t]*([a-z]+)$ In replacement string “2″ is the content form the second pair of parentheses (“1″ from the first and so on). Note that in JavaScript (linked above) different syntax is used in replacement string (“$1″, “$2″…). Other then that it should be the same. |
| August 12, 2011 at 12:28 pm #17955 | |
|
Pf@nne Member
|
Hi Nux, it works, now only real Labels (Label:) will be listet! I think you forgot the “:” I have modifyed the expression as follows: –regex-vb=/^[t ]*(w+):$/1/l,Label/ Now all Lines that: - Start with a TAB or a BLANK, - followed by a Word that only contains A-Z or a-z or 0-9 or a “_”, - and finaly ends with a “:” will be listed. Thanks for your Help again! Later i will study your link. Wish you a great day Pf@nne |
You must be logged in to reply to this topic.
