From 7459f99d141bbf9c73bb3a2181b7b45400339ba9 Mon Sep 17 00:00:00 2001 From: Piet Brauer Date: Thu, 3 Mar 2016 18:07:42 +0800 Subject: [PATCH] Update for Xcode 7.3 --- Common/Framework/Base/TokenizationState.swift | 3 ++- Common/Framework/Base/TokenizeOperation.swift | 8 ++++---- Common/Framework/States/Repeat.swift | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Common/Framework/Base/TokenizationState.swift b/Common/Framework/Base/TokenizationState.swift index b2ece9f4..6e9cdb41 100644 --- a/Common/Framework/Base/TokenizationState.swift +++ b/Common/Framework/Base/TokenizationState.swift @@ -45,7 +45,8 @@ public class TokenizationState : CustomStringConvertible, Equatable /*StringLite } init(){ - id = "\(stateClassName())\(__anonymousStateCount++)" + __anonymousStateCount += 1 + id = "\(stateClassName())\(__anonymousStateCount)" } // diff --git a/Common/Framework/Base/TokenizeOperation.swift b/Common/Framework/Base/TokenizeOperation.swift index 1e122890..27028211 100644 --- a/Common/Framework/Base/TokenizeOperation.swift +++ b/Common/Framework/Base/TokenizeOperation.swift @@ -76,8 +76,8 @@ public class TokenizeOperation : CustomStringConvertible { var output = "Tokenization Operation State\n\tCurrent=\(current) Next=\(next) scanAdvanced=\(scanAdvanced) Complete=\(complete)\n" //Print the context stack - for var i = __contextStack.endIndex-1; i>=0; i-- { - output+="\t"+__contextStack[i].description+"\n" + for index in __contextStack.endIndex-1...0 { + output+="\t"+__contextStack[index].description+"\n" } return output @@ -136,8 +136,8 @@ public class TokenizeOperation : CustomStringConvertible { current = eot } - context.__currentIndex++ - context.currentPosition++ + context.__currentIndex = context.__currentIndex.successor() + context.currentPosition += 1 } public func token(token:Token){ diff --git a/Common/Framework/States/Repeat.swift b/Common/Framework/States/Repeat.swift index e0b0edf1..b09ee7d4 100644 --- a/Common/Framework/States/Repeat.swift +++ b/Common/Framework/States/Repeat.swift @@ -87,7 +87,7 @@ public class Repeat : TokenizationState{ repeatingState.scan(operation) if operation.context.tokens.count > 0 { - repeats++ + repeats += 1 tokensCreated = true operation.context.tokens.removeAll(keepCapacity: true)