Bug with nested SyntaxStart/SyntaxEnd

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
FWishbringer
Posts: 2
Joined: Fri Apr 16, 2010 5:51 pm

Bug with nested SyntaxStart/SyntaxEnd

Post by FWishbringer »

I'm working on an updated syntax definition for CSS, in which, nesting {}'s is legal, and used for 'classes' using the @keyword feature.

Now, the problem is, if SyntaxStart and SyntaxEnd are { and }, and you have a chunk of code such as:
@media all and (max-width: 200px) {
html {margin: 0;}
h1 {
margin: 0;
background-color: #FFFFFF;
}
h1::before, h1::after {display: none;}
}
It works like this...
@media all and (max-width: 200px) {
html {margin: 0;}

h1 {
margin: 0;
background-color: #FFFFFF;
}

h1::before, h1::after {display: none;}
}
If I add {} to valid parenthesis, it will highlight the dangling open or close only.

I believe what should occur is SyntaxStart and SyntaxEnd should follow the 'matching' rule, and use the outermost set, and ignore all occurrences between if the between occurrences are not listed as parenthesis, and then, treat the inner as parenthesis.
Post Reply