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>
Syntax delimiters per keyword section
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Also when using PHP
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.
Syntax delimiters
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.
Keywords1Start: <\[A-Za-z\]+
This would be great as long as you always put spaces between < and other variables in test statements.