Anviking / Chromatism

iOS Syntax Highlighting in Swift
MIT License
100 stars 15 forks source link

NSOperation #19

Closed Anviking closed 10 years ago

Anviking commented 11 years ago

I thought a lot of hierarchy problems could be solved by making JLScope a subclass of NSOperation.

This means:

  1. Scopes don't have to be copied in order to have multiple parentScopes
  2. A scope will not begin "performing" until every parent is finished, and then it will merge it's parent's indexes first. (Before: performing regex in each parent's indexSet separately could have caused some matches not to match)
  3. A scope's identifier should now be completely unique (Wasn't the case before – copies)
  4. A method like [self addTokenWithIdentifier:@"" pattern:@"" andScopes:@[ LINE_SCOPE, STRINGS ]]; will be easy to make. (Unique identifiers and simpler hierarchy)
  5. JLScopes cannot be reused
Anviking commented 10 years ago

Since the scopes are not longer reusable, this creates problems with the scope:didChangeIndexesFrom:to:-method. Will merge this to development instead.