jEdit Community - Resources for users of the jEdit Text Editor
Regex in SPAN_REGEXP/END
Submitted by Blitzcoder on Monday, 29 December, 2008 - 23:14
Hey guys, I'm writing a small IDE (http://blitz-coder.de/data/find1.png) for a basic-like language (BlitzMax) using the latest jedit textarea (pre16 I think). Multiline-comments are set using "Rem" and "EndRem" (case-insensetive). Now the end of a multiline comment can be "EndRem" or "End Rem". I'm using a SPAN_REGEXP-Tag in the mode file, but since I can just use regex in and not in . So I don't know how to highlight these comments. At the moment my definition looks like this: ^\W*Rem\W*$ EndRem Perfect would be a definition like this: ^\W*Rem\W*$ ^\W*End\s*Rem\W*$ Do you have any ideas how to highlight these comments? Do you have any reason for disallow regex in ? If not, I could write a patch to make this possible. Thanks for your answers.. Johannes Wotzka
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Hm, HTML broke down my layout
by Blitzcoder on Mon, 29/12/2008 - 23:23
Hm, HTML broke down my layout, here is the right text:
---

Hey guys,

I'm writing a small IDE (http://blitz-coder.de/data/find1.png) for a basic-like language (BlitzMax) using the latest jedit textarea (pre16 I think). Multiline-comments are set using "Rem" and "EndRem" (case-insensetive). Now the end of a multiline comment can be "EndRem" or "End Rem". I'm using a SPAN_REGEXP-Tag in the mode file, but since I can just use regex in BEGIN and not in END. So I don't know how to highlight these comments.

At the moment my definition looks like this:
<SPAN_REGEXP TYPE="COMMENT1" NO_LINE_BREAK="FALSE">
<BEGIN>^\W*Rem\W*$</BEGIN>
<EN>EndRem</END>
</SPAN_REGEXP>

Perfect would be a definition like this:

<SPAN_REGEXP TYPE="COMMENT1" NO_LINE_BREAK="FALSE">
<BEGIN>^\W*Rem\W*$</BEGIN>
<END>^\W*End\s*Rem\W*$</END>
</SPAN_REGEXP>

Do you have any ideas how to highlight these comments? Do you have any reason for disallow regex in <END>? If not, I could write a patch to make this possible.

Thanks for your answers..

Johannes <Blitzcoder> Wotzka
 
Hi, I've already tried to fi
by Robert Schwenn on Tue, 30/12/2008 - 16:03
Hi,
I've already tried to find a solution when You asked this question to the mailing list a few weeks ago. I didn't find any. And I think it's impossible at this point.

The reason for allowing regex only for BEGIN could be performance. But You should ask this at the mailing list. Since 4.3pre16 is out, the developers may have more time for this kind of problems now.

Robert
User login
Browse archives
« April 2024  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82348
Context Free Art (*.cfdg)   0.31   46055
JBuilder scheme   .001   18495
BBEdit scheme   1.0   18116
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293