Ignore:
Timestamp:
04/30/08 00:22:52 (11 years ago)
Author:
Nicholas Riley
Message:

Fix asymmetric parsing of single words wrapped in ambiguous delimiters. Strip trailing exclamation points like commas, semicolons, periods and commas.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEParser.m

    r436 r473  
    7474   
    7575    @try {
    76         if ([[NSCharacterSet characterSetWithCharactersInString: @";,."] characterIsMember:
     76        if ([[NSCharacterSet characterSetWithCharactersInString: @";,.!"] characterIsMember:
    7777            [string characterAtIndex: selEnd - 1]]) {
    7878            selEnd--;
    7979        }
    8080        NSCharacterSet *alphanumericCharacterSet = [NSCharacterSet alphanumericCharacterSet];
    81         while (![alphanumericCharacterSet characterIsMember: [string characterAtIndex: selStart]]) {
     81        unichar opening, closing;
     82        while (![alphanumericCharacterSet characterIsMember:
     83                 (opening = [string characterAtIndex: selStart])]) {
     84            closing = [string characterAtIndex: selEnd - 1];
     85            if ((opening == '(' && closing == ')') ||
     86                (opening == '{' && closing == '}') ||
     87                (opening == '[' && closing == ']')) {
     88                selEnd--;
     89            }
    8290            selStart++;
    8391            NSCAssert(selStart < selEnd, @"No URL is selected");
Note: See TracChangeset for help on using the changeset viewer.