Matching Bracket fails

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
hansw
Posts: 3
Joined: Mon Jun 16, 2008 12:18 pm

Matching Bracket fails

Post by hansw »

Matching Bracket fails when there are lots of code that has been commented out.

Is there any fix ?
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post by talleyrand »

Are you able to provide a code sample?

Is it the case that your code looks approximately like

Code: Select all

if (true)
{
    // This demonstrates my failure }
   ;
}
or this

Code: Select all

if (true)
{
    // In the merry month of June from me home I started,
    // Left the girls of Tuam so nearly broken hearted,
    // Saluted Father dear, kissed me darling mother,
    // Drank a pint of beer, me grief and tears to smother,
    // Then off to reap the corn, leave where I was born,
    // Cut a stout blackthorn to banish ghosts and goblins;
    // In a brand new pair of brogues to rattle o'er the bogs
    // And frighten all the dogs on the rocky road to Dublin,
    // 
    // 
    // (Chorus):
    // One two three four five,
    // Hunt the Hare and turn her down the rocky road
    // And all the way to Dublin, Whack fol la de rah!
    // 
    // 
    // In Mullingar that night I rested limbs so weary
    // Started by daylight next morning bright and early
    // Took a drop of the pure to keep me heart from sinking;
    // That's a Paddy's cure whenever he's on drinking
    // See the lassies smile, laughing all the while
    // At me darlin' style, 'twould set your heart a bubblin'
    // Asked me was I hired, wages I required
    // Till I was almost tired of the rocky road to Dublin,
    // 
    // 
    // (Chorus)
    // 
    // In Dublin next arrived, I thought it be a pity
    // To be soon deprived a view of that fine city.
    // Decided to take a stroll, all among the quality;
    // Me bundle it was stole, all in a neat locality.
    // Something crossed me mind, when I looked behind,
    // No bundle could I find upon me stick a wobblin'
    // Enquiring for the rogue, they said me Connaught brogue
    // Wasn't much in vogue on the rocky road to Dublin,
    // 
    // 
    // (Chorus)
    // 
    // From there I got away, me spirits never falling,
    // Landed on the quay, just as the ship was sailing.
    // The Captain at me roared, said that no room had he;
    // When I jumped aboard, a cabin found for Paddy.
    // Down among the pigs, played some funny rigs,
    // Danced some hearty jigs, the water round me bubbling;
    // When off to Holyhead wished meself was dead,
    // Or better far instead on the rocky road to Dublin,
    // 
    // 
    // (Chorus)
    // 
    // The boys of Liverpool, when we were safely landed,
    // Called meself a fool, I could no longer stand it.
    // Blood began to boil, temper I was losing;
    // Poor old Erin's Isle they began abusing.
    // "Hurrah me soul!" says I, let the shillelagh fly.
    // Some Galway boys were nigh and saw I was a hobble in,
    // With a loud "hurray!" joined in the fray.
    // Soon we cleared the way on the rocky road to Dublin,

    ; // <- my elaborate code
}

In the first example, I see that TP will match the commented out bracket whereas Visual Studio does not. In the later, TP matches the bracket as expected.
I choose to fight with a sack of angry cats.
hansw
Posts: 3
Joined: Mon Jun 16, 2008 12:18 pm

thats about right

Post by hansw »

Thats about right. However the matching braces code should take into account the fact that lines are commented out !

Clearly some more work needs to be done !

Thanks
Post Reply