Syntax delimiters per keyword section

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply

How important is this feature for future versions of TextPad?

Important, even if the size/efficiency of TextPad increases/degrades
5
38%
Somewhat important
4
31%
I'm okay either way
3
23%
Somewhat unimportant
1
8%
Unimportant, even if the size/efficiency of TextPad remains unaffected
0
No votes
 
Total votes: 13

ftaco96
Posts: 3
Joined: Wed Jan 26, 2005 8:50 pm
Location: Dallas, TX

Syntax delimiters per keyword section

Post by ftaco96 »

I'd like to see TextPad be able to differentiate (for instance) JSP from javascript by recognizing the JSP delimiters <% and %>, highlighting them, and using them as a trigger to highlight only the JSP keywords in that section. Then it would follow that you'd have to be able to establish a precedence of one type of keyword over another. I would think you could have syntax file parameters like Keywords1StartDelim and Keywords1EndDelim, which could be blank if there's no good way to delimit the beginning of the syntax, as in the case of javascript.

As an example:
<script>
function blahBlah() {
var firstNum = 1234;
var secondNum = <%=Int2.toString() %>;
alert(firstNum.toString() + ":" + secondNum.toString());
}
</script>
ftaco96
Posts: 3
Joined: Wed Jan 26, 2005 8:50 pm
Location: Dallas, TX

Post by ftaco96 »

Then my select tag could look like this...

<select name='selMkt' class='select11px' style='width:115px' onChange='getCycNames();'>

instead of like this...

<select name='selMkt' class='select11px' style='width:115px' onChange='getCycNames();'>
xjack
Posts: 1
Joined: Fri Jan 28, 2005 3:01 pm
Location: Reston, VA, USA

Also when using PHP

Post by xjack »

Another example is when php code is embedded in html. It would be nice to highlight the php according to one set of rules and to highlight the html to another set of rules.
ftaco96
Posts: 3
Joined: Wed Jan 26, 2005 8:50 pm
Location: Dallas, TX

Syntax delimiters

Post by ftaco96 »

Perhaps the syntax delimiters could even be a regular expression like this one for HTML:

Keywords1Start: <\[A-Za-z\]+

This would be great as long as you always put spaces between < and other variables in test statements.
Parasyte
Posts: 1
Joined: Sat Feb 05, 2005 7:19 am

Post by Parasyte »

I am highly interested in such a feature. It is nearly required for PHP with embedded HTML. (As it is now, it's probably best not using syntax highlighting for PHP files if it contains HTML outside of the PHP delimiters -- <?php [or <?] and ?>.)
Post Reply